Bug 635935 - [gold] ld.script with relative paths breaks with ld.gold linker
Summary: [gold] ld.script with relative paths breaks with ld.gold linker
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: binutils
Version: 19
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Nick Clifton
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 635581 635965
TreeView+ depends on / blocked
 
Reported: 2010-09-21 03:57 UTC by Jens Petersen
Modified: 2015-02-17 13:23 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 635581
Environment:
Last Closed: 2015-02-17 13:23:38 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jens Petersen 2010-09-21 03:57:33 UTC
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 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.

Comment 1 Fedora End Of Life 2013-04-03 18:51:38 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 2 Fedora End Of Life 2015-01-09 16:21:38 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 3 Fedora End Of Life 2015-02-17 13:23:38 UTC
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.