aboutsummaryrefslogtreecommitdiff
path: root/Makefile.rules
diff options
context:
space:
mode:
authorRobert Muth <robertm@chromium.org>2012-07-31 16:23:55 -0700
committerDerek Schuff <dschuff@chromium.org>2012-07-31 16:23:55 -0700
commitcf90a95c58b80652832b10de3683945eb0a94f64 (patch)
tree38bef21a63a14b1f2182fee5dbc3bc8b54cbc649 /Makefile.rules
parent2741c8bf7b34a8987bb7fd2ba5a77b56ed440bd9 (diff)
This hack is necessary under ubuntu precise to produce a gold plugin which has a
proper dt_needed entry for LTO. Without this the linkline looks like: g++ -I../native_client/pnacl/build/llvm/include -I.../native_client/pnacl/build/llvm/tools/gold -I.../native_client/pnacl/src/upstream/llvm/include -I.../native_client/pnacl/src/upstream/llvm/tools/gold -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -fomit-frame-pointer -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -fPIC -Woverloaded-virtual -Wcast-qual -I.../native_client/pnacl/src/binutils/binutils-2.20/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -L.../native_client/pnacl/build/llvm/Release+Asserts/lib/lib -lLTO ^^^^^^ -O3 -Wl,-R -Wl,'$ORIGIN' -L.../native_client/pnacl/build/llvm/Release+Asserts/lib -L.../native_client/pnacl/build/llvm/Release+Asserts/lib -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -shared -o .../native_client/pnacl/build/llvm/Release+Asserts/lib/LLVMgold.so .../native_client/pnacl/build/llvm/tools/gold/Release+Asserts/gold-plugin.o ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -lLLVMSupport -Wl,--version-script,.../native_client/pnacl/build/llvm/tools/gold/Release+Asser ts/gold.exports.map -lpthread -ldl -lm Since the -lLTO preceeds gold-plugin.o it seems legit for the linker to ignore this dependency. Which on precise, unlike lucid, it does. Adding -lLTO to the very end of the link-line fixed the problem BUG= http://code.google.com/p/nativeclient/issues/detail?id=2872 TEST= manual REVIEW= http://codereview.chromium.org/10693178/
Diffstat (limited to 'Makefile.rules')
-rw-r--r--Makefile.rules4
1 files changed, 3 insertions, 1 deletions
diff --git a/Makefile.rules b/Makefile.rules
index a3ffbd41e4..f44d2c5884 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -1239,8 +1239,10 @@ endif
$(LibName.SO): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(SharedLibDir)/.dir
$(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \
$(notdir $@)
+ # @LOCALMOD: the EXTRA_LIBS hack is necessary for LLVMgold.so
+ # c.f. llvm/tools/gold/Makefile
$(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO) \
- $(ProjLibsOptions) $(LLVMLibsOptions) $(LIBS)
+ $(ProjLibsOptions) $(LLVMLibsOptions) $(LIBS) $(EXTRA_LIBS)
else
$(LibName.SO): $(ObjectsO) $(SharedLibDir)/.dir
$(Echo) Linking $(BuildMode) Shared Library $(notdir $@)