Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#54886 - compile link error with new gcc

Attached to Project: Arch Linux
Opened by pascal (yaute) - Thursday, 20 July 2017, 09:32 GMT
Last edited by Jan de Groot (JGC) - Thursday, 20 July 2017, 11:41 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To No-one
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
With the new gcc & gcc-libs package (7.1.1-4) I cannot compile my program, it cannot link with static library.
I have this errors:
...
/usr/bin/ld: /home/test/sources/trunk/linux-x86-64/libssl/lib/libcrypto.a(bio_ndef.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompilé avec -fPIC
...


Additional info:
If I downgrade gcc & gcc-libs to 7.1.1-3 as before all it's ok.

Regards
This task depends upon

Closed by  Jan de Groot (JGC)
Thursday, 20 July 2017, 11:41 GMT
Reason for closing:  Not a bug
Comment by pascal (yaute) - Thursday, 20 July 2017, 10:01 GMT
"rebuild your static librairies" it's a joke ?
I have a lot of libraries and it must run on other linux distribution and older linux
Comment by Jan de Groot (JGC) - Thursday, 20 July 2017, 10:02 GMT
No this is not a joke. gcc 7.1 on Archlinux enforces PIE for full ASLR. PIE is totally incompatible with static libraries that aren't built with PIC.
Comment by pascal (yaute) - Thursday, 20 July 2017, 10:24 GMT
My libraries are build on an old redhat because there are used by diffrent linux version.
There no other solution than rebuild the librairies ?
Comment by Jan de Groot (JGC) - Thursday, 20 July 2017, 10:34 GMT
You can rebuild your libraries on the old redhat distribution, as long as you compile them with -fPIC.
Comment by pascal (yaute) - Thursday, 20 July 2017, 10:38 GMT
ok, thanks :(
Comment by Jan de Groot (JGC) - Thursday, 20 July 2017, 10:43 GMT
You might be able to fix this by using "-no-pie" when linking your final executable.
Comment by pascal (yaute) - Thursday, 20 July 2017, 11:34 GMT
ok, thanks :(
Comment by pascal (yaute) - Thursday, 20 July 2017, 11:38 GMT
it work fine, you can close.
thanks

Loading...