From 5680d650ab11555ebc111b245366817ec28eb469 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 21 Apr 2015 16:49:17 -0700 Subject: [PATCH] Fix c-to-rust on OSX --- c-to-rust/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/c-to-rust/Makefile b/c-to-rust/Makefile index d39910e..ea7df1d 100644 --- a/c-to-rust/Makefile +++ b/c-to-rust/Makefile @@ -1,3 +1,9 @@ +ifeq ($(shell uname),Darwin) + LDFLAGS := -Wl,-dead_strip +else + LDFLAGS := -Wl,--gc-sections -lpthread +endif + all: target/double target/double @@ -5,7 +11,7 @@ target: mkdir -p $@ target/double: target/main.o target/libdouble_input.a - $(CC) -o $@ -Wl,--gc-sections $^ -lpthread + $(CC) -o $@ $(LDFLAGS) $^ target/libdouble_input.a: src/lib.rs Cargo.toml cargo build