diff options
author | thakis@chromium.org <thakis@chromium.org@78cadc50-ecff-11dd-a971-7dbc132099af> | 2014-06-17 23:59:21 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@78cadc50-ecff-11dd-a971-7dbc132099af> | 2014-06-17 23:59:21 +0000 |
commit | 63a1f78eb0ec6c4ddcc23e920230bdb0b14f7855 (patch) | |
tree | b57b3b358f19aa146706e7a770a8bbea6f051c0a | |
parent | dacdd38025590eb2d6f443401d018c34e9e5c3b7 (diff) | |
download | gyp-63a1f78eb0ec6c4ddcc23e920230bdb0b14f7855.tar.gz |
ninja: Pass .so files outside of --start-group/--end-group.
When doing 32bit release component builds of chromium, nacl_helper fails to
link like so:
g++ [...] -Wl,--as-needed -o nacl_helper -Wl,--start-group [...] obj/components/libnacl_linux.a [...] lib/libppapi_shared.so -Wl,--end-group [...]
/usr/bin/ld: .../nacl_linux.plugin_main.o: undefined reference to symbol '_ZN5ppapi16PPB_Audio_Shared18SetThreadFunctionsEPK18PP_ThreadFunctions'
/usr/bin/ld: note: '_ZN5ppapi16PPB_Audio_Shared18SetThreadFunctionsEPK18PP_ThreadFunctions' is defined in DSO lib/libppapi_shared.so so try adding it to the linker command line
Note that libppapi_shared.so is on the link line. The error goes away if
--as-needed isn't passed, if I use gold, or if the .so file is moved after
--end-group. http://wiki.gentoo.org/wiki/Project:Quality_Assurance/As-needed
suggests that --as-needed has additional constraints on library ordering, and
I'm guessing that this error depends on how the implementations of
--as-needed and --start-group/--end-group in ld.bfd interact.
Moving $solibs out of --start-group/--end-group seems to work, so just do that.
No test because we have no 32bit linux gyp bot.
BUG=none (but found while working on 368384 / 385472)
TEST=Build nacl_test on a 32bit release bot using the components build. links correctly
R=scottmg@chromium.org
Review URL: https://codereview.chromium.org/341613003
git-svn-id: http://gyp.googlecode.com/svn/trunk@1944 78cadc50-ecff-11dd-a971-7dbc132099af
-rw-r--r-- | pylib/gyp/generator/ninja.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pylib/gyp/generator/ninja.py b/pylib/gyp/generator/ninja.py index fcb50b12..f31068a9 100644 --- a/pylib/gyp/generator/ninja.py +++ b/pylib/gyp/generator/ninja.py @@ -1953,13 +1953,13 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params, restat=True, command=mtime_preserving_solink_base % {'suffix': '@$link_file_list'}, rspfile='$link_file_list', - rspfile_content='-Wl,--start-group $in $solibs -Wl,--end-group $libs', + rspfile_content='-Wl,--start-group $in -Wl,--end-group $solibs $libs', pool='link_pool') master_ninja.rule( 'link', description='LINK $out', command=('$ld $ldflags -o $out ' - '-Wl,--start-group $in $solibs -Wl,--end-group $libs'), + '-Wl,--start-group $in -Wl,--end-group $solibs $libs'), pool='link_pool') elif flavor == 'win': master_ninja.rule( |