diff options
| author | Rafael Ávila de Espíndola <[email protected]> | 2011-04-08 13:54:48 -0400 |
|---|---|---|
| committer | Rafael Ávila de Espíndola <[email protected]> | 2011-04-08 14:25:18 -0400 |
| commit | f8e22cdff328dc9895e146cdcf0089f3e4db27f8 (patch) | |
| tree | efcc5554072e2974bcd00eda7f1d8cb929dba858 | |
| parent | fix long lines (diff) | |
| download | rust-f8e22cdff328dc9895e146cdcf0089f3e4db27f8.tar.xz rust-f8e22cdff328dc9895e146cdcf0089f3e4db27f8.zip | |
Gold is more strict about --whole-archive and will report duplicated
symbols because of an Object.o in a .a and one outside. A similar
problem happens for the non-shared part of libpthread.
This patch moves the -whole-archive/-no-whole-archive to include just the
llvm libs.
| -rw-r--r-- | Makefile.in | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Makefile.in b/Makefile.in index c9b54115..a9d79182 100644 --- a/Makefile.in +++ b/Makefile.in @@ -38,7 +38,8 @@ ifeq ($(CFG_OSTYPE), Linux) CFG_LIB_NAME=lib$(1).so CFG_GCC_CFLAGS += -fPIC -march=i686 -O2 CFG_GCC_LINK_FLAGS += -shared -fPIC -ldl -lpthread -lrt - CFG_GCC_DEF_FLAG := -Wl,-whole-archive,--export-dynamic,--dynamic-list= + CFG_GCC_DEF_FLAG := -Wl,--export-dynamic,--dynamic-list= + CFG_GCC_PRE_LIB_FLAGS := -Wl,-whole-archive CFG_GCC_POST_LIB_FLAGS := -Wl,-no-whole-archive ifeq ($(CFG_CPUTYPE), x86_64) CFG_GCC_CFLAGS += -m32 @@ -417,11 +418,19 @@ rt/$(CFG_RUNTIME): $(RUNTIME_OBJS) $(MKFILES) $(RUNTIME_HDR) $(RUNTIME_DEF) @$(call E, link: $@) $(Q)$(call CFG_LINK_C,$@,$(RUNTIME_LIBS) $(RUNTIME_OBJS),$(RUNTIME_DEF)) -rustllvm/$(CFG_RUSTLLVM): $(RUSTLLVM_OBJS) $(MKFILES) $(RUSTLLVM_HDR) \ +# FIXME: Building a .a is a hack so that we build with both older and newer +# versions of LLVM. In newer versions some of the bits of this library are +# already in LLVM itself, so they are skipped. +rustllvm/rustllvmbits.a: $(RUSTLLVM_OBJS) + rm -f $@ + ar crs $@ $^ + +rustllvm/$(CFG_RUSTLLVM): rustllvm/rustllvmbits.a $(MKFILES) $(RUSTLLVM_HDR) \ $(RUSTLLVM_DEF) @$(call E, link: $@) - $(Q)$(call CFG_LINK_C,$@,$(RUSTLLVM_LIBS) $(RUSTLLVM_OBJS) \ - $(CFG_LLVM_LIBS) $(CFG_LLVM_LDFLAGS),$(RUSTLLVM_DEF)) + $(Q)$(call CFG_LINK_C,$@,$(RUSTLLVM_LIBS) rustllvm/rustllvmbits.a \ + $(CFG_GCC_PRE_LIB_FLAGS) $(CFG_LLVM_LIBS) \ + $(CFG_GCC_POST_LIB_FLAGS) $(CFG_LLVM_LDFLAGS),$(RUSTLLVM_DEF)) ifdef CFG_BOOT_NATIVE boot/rustboot$(X): $(BOOT_CMXS) $(MKFILES) |