[GHC] #12460: Solaris linker does not recognize option --gc-sections
GHC
ghc-devs at haskell.org
Mon Aug 29 23:15:20 UTC 2016
#12460: Solaris linker does not recognize option --gc-sections
-------------------------------------+-------------------------------------
Reporter: herzen | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
(Linking) |
Resolution: | Keywords:
Operating System: Solaris | Architecture:
| Unknown/Multiple
Type of failure: Other | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Description changed by bgamari:
@@ -3,0 +3,1 @@
+ {{{
@@ -4,0 +5,1 @@
+ }}}
@@ -7,1 +9,1 @@
-
+ {{{
@@ -148,0 +150,1 @@
+ }}}
New description:
Linking helloworld.hs fails with the error
{{{
ld: fatal: unrecognized option '--'
}}}
If gcc is called by hand to link with "-Wl,--gc-sections" removed, the
link succeeds.
{{{
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.0.1
$ uname -a
SunOS diotima 5.11 11.3 i86pc i386 i86pc
$ gcc --version
gcc (GCC) 4.9.3
$ cat helloworld.hs
main = putStrLn "hello, world"
$ ghc -c helloworld.hs
$ ghc -v -keep-tmp-files -o helloworld helloworld.o
Glasgow Haskell Compiler, Version 8.0.1, stage 2 booted by GHC version
7.10.1
Using binary package database:
/usr/lib/ghc-8.0.1/package.conf.d/package.cache
loading package database /usr/lib/ghc-8.0.1/package.conf.d
wired-in package ghc-prim mapped to ghc-prim-0.5.0.0
wired-in package integer-gmp mapped to integer-gmp-1.0.0.1
wired-in package base mapped to base-4.9.0.0
wired-in package rts mapped to rts
wired-in package template-haskell mapped to template-haskell-2.11.0.0
wired-in package ghc mapped to ghc-8.0.1
wired-in package dph-seq not found.
wired-in package dph-par not found.
Hsc static flags:
Created temporary directory: /tmp/ghc5103_0
*** C Compiler:
gcc -U__i686 -fno-stack-protector -DTABLES_NEXT_TO_CODE -c
/tmp/ghc5103_0/ghc_1.c -o /tmp/ghc5103_0/ghc_2.o
-I/usr/lib/ghc-8.0.1/include
*** Linker:
gcc -U__i686 -fno-stack-protector -DTABLES_NEXT_TO_CODE -o helloworld -Wl
,--gc-sections helloworld.o -L/usr/lib/ghc-8.0.1/base-4.9.0.0
-L/usr/lib/ghc-8.0.1/integer-gmp-1.0.0.1 -L/usr/lib/ -L/usr/lib/ghc-8.0.1
/ghc-prim-0.5.0.0 -L/usr/lib/ghc-8.0.1/rts /tmp/ghc5103_0/ghc_2.o
-Wl,-u,ghczmprim_GHCziTypes_Izh_static_info
-Wl,-u,ghczmprim_GHCziTypes_Czh_static_info
-Wl,-u,ghczmprim_GHCziTypes_Fzh_static_info
-Wl,-u,ghczmprim_GHCziTypes_Dzh_static_info
-Wl,-u,base_GHCziPtr_Ptr_static_info
-Wl,-u,ghczmprim_GHCziTypes_Wzh_static_info
-Wl,-u,base_GHCziInt_I8zh_static_info
-Wl,-u,base_GHCziInt_I16zh_static_info
-Wl,-u,base_GHCziInt_I32zh_static_info
-Wl,-u,base_GHCziInt_I64zh_static_info
-Wl,-u,base_GHCziWord_W8zh_static_info
-Wl,-u,base_GHCziWord_W16zh_static_info
-Wl,-u,base_GHCziWord_W32zh_static_info
-Wl,-u,base_GHCziWord_W64zh_static_info
-Wl,-u,base_GHCziStable_StablePtr_static_info
-Wl,-u,ghczmprim_GHCziTypes_Izh_con_info
-Wl,-u,ghczmprim_GHCziTypes_Czh_con_info
-Wl,-u,ghczmprim_GHCziTypes_Fzh_con_info
-Wl,-u,ghczmprim_GHCziTypes_Dzh_con_info -Wl,-u,base_GHCziPtr_Ptr_con_info
-Wl,-u,base_GHCziPtr_FunPtr_con_info
-Wl,-u,base_GHCziStable_StablePtr_con_info
-Wl,-u,ghczmprim_GHCziTypes_False_closure
-Wl,-u,ghczmprim_GHCziTypes_True_closure
-Wl,-u,base_GHCziPack_unpackCString_closure
-Wl,-u,base_GHCziIOziException_stackOverflow_closure
-Wl,-u,base_GHCziIOziException_heapOverflow_closure
-Wl,-u,base_ControlziExceptionziBase_nonTermination_closure
-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnMVar_closure
-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnSTM_closure
-Wl,-u,base_GHCziIOziException_allocationLimitExceeded_closure
-Wl,-u,base_ControlziExceptionziBase_nestedAtomically_closure
-Wl,-u,base_GHCziEventziThread_blockedOnBadFD_closure
-Wl,-u,base_GHCziWeak_runFinalizzerBatch_closure
-Wl,-u,base_GHCziTopHandler_flushStdHandles_closure
-Wl,-u,base_GHCziTopHandler_runIO_closure
-Wl,-u,base_GHCziTopHandler_runNonIO_closure
-Wl,-u,base_GHCziConcziIO_ensureIOManagerIsRunning_closure
-Wl,-u,base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure
-Wl,-u,base_GHCziConcziSync_runSparks_closure
-Wl,-u,base_GHCziConcziSignal_runHandlersPtr_closure -lHSbase-4.9.0.0
-lHSinteger-gmp-1.0.0.1 -lHSghc-prim-0.5.0.0 -lHSrts -lCffi -lgmp -lm -lrt
-ldl
ld: fatal: unrecognized option '--'
ld: fatal: use the '-z help' option for usage information
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
$ gcc -U__i686 -fno-stack-protector -DTABLES_NEXT_TO_CODE -o helloworld
helloworld.o -L/usr/lib/ghc-8.0.1/base-4.9.0.0 -L/usr/lib/ghc-8.0.1
/integer-gmp-1.0.0.1 -L/usr/lib/ -L/usr/lib/ghc-8.0.1/ghc-prim-0.5.0.0
-L/usr/lib/ghc-8.0.1/rts /tmp/ghc5103_0/ghc_2.o
-Wl,-u,ghczmprim_GHCziTypes_Izh_static_info
-Wl,-u,ghczmprim_GHCziTypes_Czh_static_info
-Wl,-u,ghczmprim_GHCziTypes_Fzh_static_info
-Wl,-u,ghczmprim_GHCziTypes_Dzh_static_info
-Wl,-u,base_GHCziPtr_Ptr_static_info
-Wl,-u,ghczmprim_GHCziTypes_Wzh_static_info
-Wl,-u,base_GHCziInt_I8zh_static_info
-Wl,-u,base_GHCziInt_I16zh_static_info
-Wl,-u,base_GHCziInt_I32zh_static_info
-Wl,-u,base_GHCziInt_I64zh_static_info
-Wl,-u,base_GHCziWord_W8zh_static_info
-Wl,-u,base_GHCziWord_W16zh_static_info
-Wl,-u,base_GHCziWord_W32zh_static_info
-Wl,-u,base_GHCziWord_W64zh_static_info
-Wl,-u,base_GHCziStable_StablePtr_static_info
-Wl,-u,ghczmprim_GHCziTypes_Izh_con_info
-Wl,-u,ghczmprim_GHCziTypes_Czh_con_info
-Wl,-u,ghczmprim_GHCziTypes_Fzh_con_info
-Wl,-u,ghczmprim_GHCziTypes_Dzh_con_info -Wl,-u,base_GHCziPtr_Ptr_con_info
-Wl,-u,base_GHCziPtr_FunPtr_con_info
-Wl,-u,base_GHCziStable_StablePtr_con_info
-Wl,-u,ghczmprim_GHCziTypes_False_closure
-Wl,-u,ghczmprim_GHCziTypes_True_closure
-Wl,-u,base_GHCziPack_unpackCString_closure
-Wl,-u,base_GHCziIOziException_stackOverflow_closure
-Wl,-u,base_GHCziIOziException_heapOverflow_closure
-Wl,-u,base_ControlziExceptionziBase_nonTermination_closure
-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnMVar_closure
-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnSTM_closure
-Wl,-u,base_GHCziIOziException_allocationLimitExceeded_closure
-Wl,-u,base_ControlziExceptionziBase_nestedAtomically_closure
-Wl,-u,base_GHCziEventziThread_blockedOnBadFD_closure
-Wl,-u,base_GHCziWeak_runFinalizzerBatch_closure
-Wl,-u,base_GHCziTopHandler_flushStdHandles_closure
-Wl,-u,base_GHCziTopHandler_runIO_closure
-Wl,-u,base_GHCziTopHandler_runNonIO_closure
-Wl,-u,base_GHCziConcziIO_ensureIOManagerIsRunning_closure
-Wl,-u,base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure
-Wl,-u,base_GHCziConcziSync_runSparks_closure
-Wl,-u,base_GHCziConcziSignal_runHandlersPtr_closure -lHSbase-4.9.0.0
-lHSinteger-gmp-1.0.0.1 -lHSghc-prim-0.5.0.0 -lHSrts -lCffi -lgmp -lm -lrt
-ldl
$ ./helloworld
hello, world
}}}
--
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12460#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list