Please do not reply directly to this email. All additional comments should be made in the comments box of this bug.
Summary: [gold] ld.script with relative paths breaks with ld.gold linker
https://bugzilla.redhat.com/show_bug.cgi?id=635935
Summary: [gold] ld.script with relative paths breaks with ld.gold linker Product: Fedora Version: rawhide Platform: All OS/Version: Linux Status: NEW Severity: medium Priority: low Component: binutils AssignedTo: nickc@redhat.com ReportedBy: petersen@redhat.com QAContact: extras-qa@fedoraproject.org CC: jakub@redhat.com, petersen@redhat.com, bos@serpentine.com, nickc@redhat.com, mnowak@redhat.com, loupgaroublond@gmail.com, fedora-haskell-list@redhat.com, dvlasenk@redhat.com Depends on: 635581 Classification: Fedora Target Release: --- Clone Of: 635581
ld.gold seems to not like relative paths in link scripts:
[ghc-6.12.3]$ /usr/bin/gcc -nostdlib -nodefaultlibs -Wl,-r -Wl,-x -o libraries/ghc-prim/dist-install/build/GHC/Generics.o libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/ld.script /usr/bin/ld: error: cannot find libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__1.o /usr/bin/ld: error: cannot find libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/.o::Generics(void) /usr/bin/ld: error: cannot find libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__3.o : /usr/bin/ld: error: cannot find libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__16.o collect2: ld returned 1 exit status [ghc-6.12.3]$ cat libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/ld.script INPUT(libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__1.o libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__2.o libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__3.o : libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__16.o)
It links ok with ld.bfd
Here is how I ran into this in bug 635581:
"inplace/bin/ghc-stage1" -H32m -O -package-name ghc-prim-0.2.0.0 -hide-all-packages -i -ilibraries/ghc-prim/. -ilibraries/ghc-prim/dist-install/build -ilibraries/ghc-prim/dist-install/build/autogen -Ilibraries/ghc-prim/dist-install/build -Ilibraries/ghc-prim/dist-install/build/autogen -Ilibraries/ghc-prim/. -optP-include -optPlibraries/ghc-prim/dist-install/build/autogen/cabal_macros.h -package rts-1.0 -split-objs -package-name ghc-prim -XCPP -XMagicHash -XForeignFunctionInterface -XUnliftedFFITypes -XUnboxedTuples -XEmptyDataDecls -XNoImplicitPrelude -O2 -XGenerics -fno-warn-deprecated-flags -odir libraries/ghc-prim/dist-install/build -hidir libraries/ghc-prim/dist-install/build -stubdir libraries/ghc-prim/dist-install/build -hisuf hi -osuf o -hcsuf hc -c libraries/ghc-prim/./GHC/Generics.hs -o libraries/ghc-prim/dist-install/build/GHC/Generics.o /usr/bin/ld: error: cannot find libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__1.o /usr/bin/ld: error: cannot find libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/.o::Generics(void) /usr/bin/ld: error: cannot find libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__3.o /usr/bin/ld: error: cannot find libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__4.o /usr/bin/ld: error: cannot find libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__5.o /usr/bin/ld: error: cannot find libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__6.o /usr/bin/ld: error: cannot find libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__7.o /usr/bin/ld: error: cannot find libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__8.o /usr/bin/ld: error: cannot find libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__9.o /usr/bin/ld: error: cannot find libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__10.o /usr/bin/ld: error: cannot find libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__11.o /usr/bin/ld: error: cannot find libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__12.o /usr/bin/ld: error: cannot find libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__13.o /usr/bin/ld: error: cannot find libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__14.o /usr/bin/ld: error: cannot find libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__15.o /usr/bin/ld: error: cannot find libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__16.o collect2: ld returned 1 exit status make[1]: *** [libraries/ghc-prim/dist-install/build/GHC/Generics.o] Error 1 make: *** [all] Error 2
I see a link script:
[ghc-6.12.3]$ ls libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/ Generics__1.o Generics__12.o Generics__15.o Generics__3.o Generics__6.o Generics__9.o Generics__10.o Generics__13.o Generics__16.o Generics__4.o Generics__7.o ld.script Generics__11.o Generics__14.o Generics__2.o Generics__5.o Generics__8.o [petersen@localhost ghc-6.12.3]$ cat libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/ld.script INPUT(libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__1.o libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__2.o libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__3.o libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__4.o libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__5.o libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__6.o libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__7.o libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__8.o libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__9.o libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__10.o libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__11.o libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__12.o libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__13.o libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__14.o libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__15.o libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/Generics__16.o)
Checking the verbose ghc output the problem occurs here with :
/usr/bin/gcc -nostdlib -nodefaultlibs -Wl,-r -Wl,-x -o libraries/ghc-prim/dist-install/build/GHC/Generics.o libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/ld.script
Editing the linking script generated by ghc-split:
[ghc-6.12.3]$ sed -i.orig -e "s%libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/%%g" libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/ld.script [ghc-6.12.3]$ /usr/bin/gcc -nostdlib -nodefaultlibs -Wl,-r -Wl,-x -o libraries/ghc-prim/dist-install/build/GHC/Generics.o libraries/ghc-prim/dist-install/build/GHC/Generics_o_split/ld.script [ghc-6.12.3]$
So question that arises is should ld.gold support relative paths in link scripts or should ghc be changes to just like the local objects?
--- Additional comment from petersen@redhat.com on 2010-09-21 12:51:14 EST ---
The above sed change only works with ld.gold not ld.bfd. So it seems to be a ld.gold change of behaviour or regression compared to ld.bfd. I would be willing to patch ghc for Fedora if ld.gold and ld.bfd can agree on at least one of the versions of link scripts working.
Please do not reply directly to this email. All additional comments should be made in the comments box of this bug.
https://bugzilla.redhat.com/show_bug.cgi?id=635935
Jens Petersen petersen@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Blocks| |635581 Depends on|635581 |
Please do not reply directly to this email. All additional comments should be made in the comments box of this bug.
https://bugzilla.redhat.com/show_bug.cgi?id=635935
Jens Petersen petersen@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |law@redhat.com
Please do not reply directly to this email. All additional comments should be made in the comments box of this bug.
https://bugzilla.redhat.com/show_bug.cgi?id=635935
Jens Petersen petersen@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Blocks| |635965
Please do not reply directly to this email. All additional comments should be made in the comments box of this bug.
https://bugzilla.redhat.com/show_bug.cgi?id=635935
Jens Petersen petersen@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC|fedora-haskell-list@redhat. | |com |
haskell-devel@lists.fedoraproject.org