[commit: ghc] master: Fix binary linking errors on Solaris (b9b94ec)
git at git.haskell.org
git at git.haskell.org
Tue Jan 14 09:46:58 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/b9b94ec82d9125da47c619c69e626120b3e60457/ghc
>---------------------------------------------------------------
commit b9b94ec82d9125da47c619c69e626120b3e60457
Author: Karel Gardas <karel.gardas at centrum.cz>
Date: Mon Jan 13 17:00:18 2014 -0600
Fix binary linking errors on Solaris
The -u option must be placed before libraries which define the necessary
symbols.
Signed-off-by: Austin Seipp <austin at well-typed.com>
>---------------------------------------------------------------
b9b94ec82d9125da47c619c69e626120b3e60457
compiler/main/DriverPipeline.hs | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index df0f8e6..a95c179 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1800,7 +1800,16 @@ linkBinary' staticLink dflags o_files dep_packages = do
-- HS packages, because libtool doesn't accept other options.
-- In the case of iOS these need to be added by hand to the
-- final link in Xcode.
- else package_hs_libs ++ extra_libs ++ other_flags
+ else other_flags ++ package_hs_libs ++ extra_libs -- -Wl,-u,<sym> contained in other_flags
+ -- needs to be put before -l<package>,
+ -- otherwise Solaris linker fails linking
+ -- a binary with unresolved symbols in RTS
+ -- which are defined in base package
+ -- the reason for this is a note in ld(1) about
+ -- '-u' option: "The placement of this option
+ -- on the command line is significant.
+ -- This option must be placed before the library
+ -- that defines the symbol."
pkg_framework_path_opts <-
if platformUsesFrameworks platform
More information about the ghc-commits
mailing list