Always use -Xlinker for -rpath
ClosedPublic

Authored by niteria on Jan 13 2017, 7:28 AM.

Details

Summary

Currently we use -Wl which takes a list of
comma-separated options. Unfortunately that
breaks when you use it with -rpath and
a path that has commas in them.
Buck, the build system, produces paths with
commas in them.

-Xlinker doesn't have this disadvantage
and as far as I can tell is supported by
both gcc and clang. Anecdotally nvcc
supports -Xlinker, but not -Wl.

Test Plan

./validate, harbourmaster

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
niteria updated this revision to Diff 10457.Jan 13 2017, 7:28 AM
niteria retitled this revision from to Always use -Xlinker for -rpath.
niteria updated this object.
niteria edited the test plan for this revision. (Show Details)
niteria added reviewers: simonmar, bgamari, nomeata.
niteria updated this object.Jan 13 2017, 7:29 AM
niteria edited edge metadata.

I plan to add a test soon.

simonmar accepted this revision.Jan 13 2017, 7:36 AM
simonmar edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jan 13 2017, 7:36 AM
bgamari requested changes to this revision.Jan 18 2017, 3:23 PM
bgamari edited edge metadata.

Looks fine but I'll wait until you add a test to merge.

This revision now requires changes to proceed.Jan 18 2017, 3:23 PM
niteria updated this revision to Diff 10561.Jan 20 2017, 11:15 AM
niteria edited edge metadata.
  • add a test
niteria updated this revision to Diff 10563.Jan 20 2017, 11:59 AM
niteria edited edge metadata.

rebase

bgamari requested changes to this revision.Jan 20 2017, 3:51 PM
bgamari edited edge metadata.

Hmm, the test seems to fail on OS X,

Stdout ( path_with_commas ):
[1 of 1] Compiling Dummy            ( Dummy.hs, test,path/Dummy.o )
Linking test,path/libfoo.so ...
Reading package info from "test.pkg" ... done.
[1 of 1] Compiling Main             ( Main.hs, Main.o )
Stderr ( path_with_commas ):
Warning: -rtsopts and -with-rtsopts have no effect with -shared.
    Call hs_init_ghc() from your main() function to set these options.
<command line>: can't load .so/.DLL for: libfoo.dylib (dlopen(libfoo.dylib, 5): image not found)
make[1]: *** [path_with_commas] Error 1
*** unexpected failure for path_with_commas(normal)
This revision now requires changes to proceed.Jan 20 2017, 3:51 PM
niteria updated this revision to Diff 10575.Jan 20 2017, 8:29 PM
niteria edited edge metadata.
  • attempt to fix for OSX
niteria updated this revision to Diff 10576.Jan 20 2017, 8:35 PM
niteria edited edge metadata.

a better attempt, should work for windows as well

niteria planned changes to this revision.Jan 21 2017, 7:18 AM

Still need to make stdout platform independent.

niteria updated this revision to Diff 10580.Jan 21 2017, 7:59 AM
niteria edited edge metadata.

another try

bgamari accepted this revision.Jan 21 2017, 10:35 AM
bgamari edited edge metadata.

Looks good to me but a comment would be nice so future contributors don't accidentally revert to using -Wl. I can add one when I merge.

This revision is now accepted and ready to land.Jan 21 2017, 10:35 AM
niteria updated this revision to Diff 10584.Jan 21 2017, 11:58 AM
niteria edited edge metadata.

add note

This revision was automatically updated to reflect the committed changes.