Linker error in stage2

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Linker error in stage2

Gabor Greif-2
Hi Ian,

I am getting linker errors when bootstrapping HEAD with a recent
v7.7-20130220 GHC. This is a RHEL5 system:

"inplace/bin/ghc-stage1" -package-name rts -shared -dynamic -dynload
deploy -no-auto-link-packages -Lrts/dist/build -lffi  -optl-Wl,-rpath
-optl-Wl,'$ORIGIN' `cat rts/libs.depend`
rts/dist/build/Adjustor.debug_dyn_o rts/dist/build/Arena.debug_dyn_o
rts/dist/build/Capability.debug_dyn_o
rts/dist/build/ClosureFlags.debug_dyn_o
rts/dist/build/Disassembler.debug_dyn_o
rts/dist/build/FileLock.debug_dyn_o
rts/dist/build/FrontPanel.debug_dyn_o
rts/dist/build/Globals.debug_dyn_o rts/dist/build/Hash.debug_dyn_o
rts/dist/build/Hpc.debug_dyn_o rts/dist/build/HsFFI.debug_dyn_o
rts/dist/build/Inlines.debug_dyn_o
rts/dist/build/Interpreter.debug_dyn_o
rts/dist/build/LdvProfile.debug_dyn_o
rts/dist/build/Linker.debug_dyn_o rts/dist/build/Messages.debug_dyn_o
rts/dist/build/OldARMAtomic.debug_dyn_o
rts/dist/build/Papi.debug_dyn_o rts/dist/build/Printer.debug_dyn_o
rts/dist/build/ProfHeap.debug_dyn_o
rts/dist/build/Profiling.debug_dyn_o
rts/dist/build/Proftimer.debug_dyn_o
rts/dist/build/RaiseAsync.debug_dyn_o
rts/dist/build/RetainerProfile.debug_dyn_o
rts/dist/build/RetainerSet.debug_dyn_o
rts/dist/build/RtsAPI.debug_dyn_o
rts/dist/build/RtsDllMain.debug_dyn_o
rts/dist/build/RtsFlags.debug_dyn_o rts/dist/build/RtsMain.debug_dyn_o
rts/dist/build/RtsMessages.debug_dyn_o
rts/dist/build/RtsStartup.debug_dyn_o
rts/dist/build/RtsUtils.debug_dyn_o
rts/dist/build/Schedule.debug_dyn_o rts/dist/build/Sparks.debug_dyn_o
rts/dist/build/Stable.debug_dyn_o rts/dist/build/Stats.debug_dyn_o
rts/dist/build/StgCRun.debug_dyn_o
rts/dist/build/StgPrimFloat.debug_dyn_o rts/dist/build/STM.debug_dyn_o
rts/dist/build/Task.debug_dyn_o
rts/dist/build/ThreadLabels.debug_dyn_o
rts/dist/build/ThreadPaused.debug_dyn_o
rts/dist/build/Threads.debug_dyn_o rts/dist/build/Ticky.debug_dyn_o
rts/dist/build/Timer.debug_dyn_o rts/dist/build/Trace.debug_dyn_o
rts/dist/build/Weak.debug_dyn_o rts/dist/build/WSDeque.debug_dyn_o
rts/dist/build/hooks/FlagDefaults.debug_dyn_o
rts/dist/build/hooks/MallocFail.debug_dyn_o
rts/dist/build/hooks/OnExit.debug_dyn_o
rts/dist/build/hooks/OutOfHeap.debug_dyn_o
rts/dist/build/hooks/StackOverflow.debug_dyn_o
rts/dist/build/sm/BlockAlloc.debug_dyn_o
rts/dist/build/sm/Compact.debug_dyn_o
rts/dist/build/sm/Evac.debug_dyn_o rts/dist/build/sm/GCAux.debug_dyn_o
rts/dist/build/sm/GC.debug_dyn_o rts/dist/build/sm/GCUtils.debug_dyn_o
rts/dist/build/sm/MarkWeak.debug_dyn_o
rts/dist/build/sm/MBlock.debug_dyn_o
rts/dist/build/sm/Sanity.debug_dyn_o
rts/dist/build/sm/Scav.debug_dyn_o
rts/dist/build/sm/Storage.debug_dyn_o
rts/dist/build/sm/Sweep.debug_dyn_o
rts/dist/build/eventlog/EventLog.debug_dyn_o
rts/dist/build/posix/GetEnv.debug_dyn_o
rts/dist/build/posix/GetTime.debug_dyn_o
rts/dist/build/posix/Itimer.debug_dyn_o
rts/dist/build/posix/OSMem.debug_dyn_o
rts/dist/build/posix/OSThreads.debug_dyn_o
rts/dist/build/posix/Select.debug_dyn_o
rts/dist/build/posix/Signals.debug_dyn_o
rts/dist/build/posix/TTY.debug_dyn_o
rts/dist/build/Apply.debug_dyn_o rts/dist/build/Exception.debug_dyn_o
rts/dist/build/HeapStackCheck.debug_dyn_o
rts/dist/build/PrimOps.debug_dyn_o
rts/dist/build/StgMiscClosures.debug_dyn_o
rts/dist/build/StgStartup.debug_dyn_o
rts/dist/build/StgStdThunks.debug_dyn_o
rts/dist/build/Updates.debug_dyn_o
rts/dist/build/AutoApply.debug_dyn_o  -o
rts/dist/build/libHSrts_debug-ghc7.7.20130402.so
/usr/bin/ld: rts/dist/build/Schedule.dyn_o: relocation R_X86_64_PC32
against `StgRun' can not be used when making a shared object;
recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status

Apparently stage1 builds fine, not sure what can cause this.

Any idea?

Cheers,

    Gabor


Reply | Threaded
Open this post in threaded view
|

Linker error in stage2

Nicolas Frisby
I don't know if it's related, but I recently added -ticky and -DTICKY_TICKY
to that way in ways.mk. Commit: 460abd75c

I simultaneously hope this does and does not help :)



On Wed, Apr 3, 2013 at 10:42 AM, Gabor Greif <ggreif at gmail.com> wrote:

> Hi Ian,
>
> I am getting linker errors when bootstrapping HEAD with a recent
> v7.7-20130220 GHC. This is a RHEL5 system:
>
> "inplace/bin/ghc-stage1" -package-name rts -shared -dynamic -dynload
> deploy -no-auto-link-packages -Lrts/dist/build -lffi  -optl-Wl,-rpath
> -optl-Wl,'$ORIGIN' `cat rts/libs.depend`
> rts/dist/build/Adjustor.debug_dyn_o rts/dist/build/Arena.debug_dyn_o
> rts/dist/build/Capability.debug_dyn_o
> rts/dist/build/ClosureFlags.debug_dyn_o
> rts/dist/build/Disassembler.debug_dyn_o
> rts/dist/build/FileLock.debug_dyn_o
> rts/dist/build/FrontPanel.debug_dyn_o
> rts/dist/build/Globals.debug_dyn_o rts/dist/build/Hash.debug_dyn_o
> rts/dist/build/Hpc.debug_dyn_o rts/dist/build/HsFFI.debug_dyn_o
> rts/dist/build/Inlines.debug_dyn_o
> rts/dist/build/Interpreter.debug_dyn_o
> rts/dist/build/LdvProfile.debug_dyn_o
> rts/dist/build/Linker.debug_dyn_o rts/dist/build/Messages.debug_dyn_o
> rts/dist/build/OldARMAtomic.debug_dyn_o
> rts/dist/build/Papi.debug_dyn_o rts/dist/build/Printer.debug_dyn_o
> rts/dist/build/ProfHeap.debug_dyn_o
> rts/dist/build/Profiling.debug_dyn_o
> rts/dist/build/Proftimer.debug_dyn_o
> rts/dist/build/RaiseAsync.debug_dyn_o
> rts/dist/build/RetainerProfile.debug_dyn_o
> rts/dist/build/RetainerSet.debug_dyn_o
> rts/dist/build/RtsAPI.debug_dyn_o
> rts/dist/build/RtsDllMain.debug_dyn_o
> rts/dist/build/RtsFlags.debug_dyn_o rts/dist/build/RtsMain.debug_dyn_o
> rts/dist/build/RtsMessages.debug_dyn_o
> rts/dist/build/RtsStartup.debug_dyn_o
> rts/dist/build/RtsUtils.debug_dyn_o
> rts/dist/build/Schedule.debug_dyn_o rts/dist/build/Sparks.debug_dyn_o
> rts/dist/build/Stable.debug_dyn_o rts/dist/build/Stats.debug_dyn_o
> rts/dist/build/StgCRun.debug_dyn_o
> rts/dist/build/StgPrimFloat.debug_dyn_o rts/dist/build/STM.debug_dyn_o
> rts/dist/build/Task.debug_dyn_o
> rts/dist/build/ThreadLabels.debug_dyn_o
> rts/dist/build/ThreadPaused.debug_dyn_o
> rts/dist/build/Threads.debug_dyn_o rts/dist/build/Ticky.debug_dyn_o
> rts/dist/build/Timer.debug_dyn_o rts/dist/build/Trace.debug_dyn_o
> rts/dist/build/Weak.debug_dyn_o rts/dist/build/WSDeque.debug_dyn_o
> rts/dist/build/hooks/FlagDefaults.debug_dyn_o
> rts/dist/build/hooks/MallocFail.debug_dyn_o
> rts/dist/build/hooks/OnExit.debug_dyn_o
> rts/dist/build/hooks/OutOfHeap.debug_dyn_o
> rts/dist/build/hooks/StackOverflow.debug_dyn_o
> rts/dist/build/sm/BlockAlloc.debug_dyn_o
> rts/dist/build/sm/Compact.debug_dyn_o
> rts/dist/build/sm/Evac.debug_dyn_o rts/dist/build/sm/GCAux.debug_dyn_o
> rts/dist/build/sm/GC.debug_dyn_o rts/dist/build/sm/GCUtils.debug_dyn_o
> rts/dist/build/sm/MarkWeak.debug_dyn_o
> rts/dist/build/sm/MBlock.debug_dyn_o
> rts/dist/build/sm/Sanity.debug_dyn_o
> rts/dist/build/sm/Scav.debug_dyn_o
> rts/dist/build/sm/Storage.debug_dyn_o
> rts/dist/build/sm/Sweep.debug_dyn_o
> rts/dist/build/eventlog/EventLog.debug_dyn_o
> rts/dist/build/posix/GetEnv.debug_dyn_o
> rts/dist/build/posix/GetTime.debug_dyn_o
> rts/dist/build/posix/Itimer.debug_dyn_o
> rts/dist/build/posix/OSMem.debug_dyn_o
> rts/dist/build/posix/OSThreads.debug_dyn_o
> rts/dist/build/posix/Select.debug_dyn_o
> rts/dist/build/posix/Signals.debug_dyn_o
> rts/dist/build/posix/TTY.debug_dyn_o
> rts/dist/build/Apply.debug_dyn_o rts/dist/build/Exception.debug_dyn_o
> rts/dist/build/HeapStackCheck.debug_dyn_o
> rts/dist/build/PrimOps.debug_dyn_o
> rts/dist/build/StgMiscClosures.debug_dyn_o
> rts/dist/build/StgStartup.debug_dyn_o
> rts/dist/build/StgStdThunks.debug_dyn_o
> rts/dist/build/Updates.debug_dyn_o
> rts/dist/build/AutoApply.debug_dyn_o  -o
> rts/dist/build/libHSrts_debug-ghc7.7.20130402.so
> /usr/bin/ld: rts/dist/build/Schedule.dyn_o: relocation R_X86_64_PC32
> against `StgRun' can not be used when making a shared object;
> recompile with -fPIC
> /usr/bin/ld: final link failed: Bad value
> collect2: ld returned 1 exit status
>
> Apparently stage1 builds fine, not sure what can cause this.
>
> Any idea?
>
> Cheers,
>
>     Gabor
>
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130403/86a52e23/attachment.htm>

Reply | Threaded
Open this post in threaded view
|

Linker error in stage2

pho-2
In reply to this post by Gabor Greif-2
From: Gabor Greif <ggreif at gmail.com>
Subject: Linker error in stage2
Date: Wed, 3 Apr 2013 11:42:08 +0200

> I am getting linker errors when bootstrapping HEAD with a recent
> v7.7-20130220 GHC. This is a RHEL5 system:
>
> "inplace/bin/ghc-stage1" -package-name rts -shared -dynamic -dynload
> deploy -no-auto-link-packages -Lrts/dist/build -lffi  -optl-Wl,-rpath
> -optl-Wl,'$ORIGIN' `cat rts/libs.depend`
> <<snip>>
> rts/dist/build/AutoApply.debug_dyn_o  -o
> rts/dist/build/libHSrts_debug-ghc7.7.20130402.so
> /usr/bin/ld: rts/dist/build/Schedule.dyn_o: relocation R_X86_64_PC32
> against `StgRun' can not be used when making a shared object;
> recompile with -fPIC
> /usr/bin/ld: final link failed: Bad value
> collect2: ld returned 1 exit status

The old binutils comes with RHEL5 fails to link a shared library if
there is a reference to a hidden symbol that isn't locally
defined. See: https://gist.github.com/phonohawk/5308015

Personally I don't think this is an old binutils' fault, because the
newer one is essentially turning an otherwise global symbol to a local
one depending on its call site, which feels rather wrong to me.

The attached patch should fix the problem anyway.

_______________________________________________________
 - PHO -                         http://cielonegro.org/
OpenPGP public key: 1024D/1A86EF72
Fpr: 5F3E 5B5F 535C CE27 8254  4D1A 14E7 9CA7 1A86 EF72

Reply | Threaded
Open this post in threaded view
|

Linker error in stage2

pho-2
From: Gabor Greif <ggreif at gmail.com>
Subject: Re: Linker error in stage2
Date: Thu, 4 Apr 2013 14:42:48 +0200

> Thanks a lot! This worked, but now we have the libffi-related problem
> on install:
>
> /home/ggreif/lib/ghc-7.7.20130403/bin/ghc-pkg: error while loading
> shared libraries: libHSterminfo-0.3.2.5-ghc7.7.20130403.so: cannot
> open shared object file: No such file or directory
> make[1]: *** [install_packages] Error 127
>
> This is described in another mail thread, so I'll relax now.

I'm glad to hear that. Created a ticket:
http://hackage.haskell.org/trac/ghc/ticket/7813

_______________________________________________________
 - PHO -                         http://cielonegro.org/
OpenPGP public key: 1024D/1A86EF72
Fpr: 5F3E 5B5F 535C CE27 8254  4D1A 14E7 9CA7 1A86 EF72
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130405/6df82363/attachment.pgp>

Reply | Threaded
Open this post in threaded view
|

Linker error in stage2

Tuncer Ayaz
On Fri, Apr 5, 2013 at 9:18 AM, PHO <pho at cielonegro.org> wrote:

> From: Gabor Greif <ggreif at gmail.com>
> Subject: Re: Linker error in stage2
> Date: Thu, 4 Apr 2013 14:42:48 +0200
>
>> Thanks a lot! This worked, but now we have the libffi-related
>> problem on install:
>>
>> /home/ggreif/lib/ghc-7.7.20130403/bin/ghc-pkg: error while loading
>> shared libraries: libHSterminfo-0.3.2.5-ghc7.7.20130403.so: cannot
>> open shared object file: No such file or directory make[1]: ***
>> [install_packages] Error 127
>>
>> This is described in another mail thread, so I'll relax now.
>
> I'm glad to hear that. Created a ticket:
> http://hackage.haskell.org/trac/ghc/ticket/7813

Assuming the mail thread referred to is
http://www.haskell.org/pipermail/ghc-devs/2013-March/000835.html
, I tried the patch from #7813 and it still fails on install.

version info:
ghc 7.6.2
alex 3.0.5
happy 1.18.10
cabal 1.17.0
glibc 2.17
gcc 4.8.0
binutils 2.23.2 (with ld.gold)
autoconf 2.69
perl 5.16.3