Linker trouble - position independent code(??)

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

Linker trouble - position independent code(??)

Volker Wysk
Hi!

All of a sudden, I can't link my programs any longer. This affects all
my programs, which I build with a shared Makefile. But I haven't
changed the Makefile...

I get messages like this (indentation by me):

cc build/sicherung.o build/Hsskripte.o build/Sicherung.o
   build/SicherungAktionen.o build/Text.o build/Wahl.o build/Zeit.o  
   build/hssk.o   -o build/sicherung
/usr/bin/ld: build/sicherung.o: relocation R_X86_64_32S against
   undefined symbol `stg_upd_frame_info' can not be used when making a
   PIE object; recompile with -fPIC
/usr/bin/ld: build/Hsskripte.o: relocation R_X86_64_32S against
   `.text' can not be used when making a PIE object; recompile with
   -fPIC
... more like this ...
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o:
In function `_start':
(.text+0x20): undefined reference to `main'
/usr/bin/ld: final link failed: Invalid operation
collect2: error: ld returned 1 exit status

I've attached the complete build messages.

I've never dealt with position independent code. I've tried that "-
fPIC" switch, but this produces lots of new error messages.

Any idea of what's wrong?

Bye,
V.W.

_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users

problem (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Linker trouble - position independent code(??)

Volker Wysk
Hi!

I've found out how to do it: Use an explicit make rule:

build/% :
        ghc -o $@ $^ -package hsshellscript

But I have no idea why it stopped working...

Happy Hacking,
V.W.

_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: Linker trouble - position independent code(??)

Brandon Allbery
Generally because n OS update switched to PIE-by-default (LInux dustributions have been doing this) and ghc needs to be updated or reconfigured to match.

On Wed, Sep 25, 2019 at 10:06 PM Volker Wysk <[hidden email]> wrote:
Hi!

I've found out how to do it: Use an explicit make rule:

build/% :
        ghc -o $@ $^ -package hsshellscript

But I have no idea why it stopped working...

Happy Hacking,
V.W.

_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


--
brandon s allbery kf8nh

_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users