FS#68489 - [aarch64-linux-gnu-gcc] Align with gcc

Attached to Project: Community Packages
Opened by Christer Solskogen (solskogen) - Sunday, 01 November 2020, 07:41 GMT
Last edited by Andreas Radke (AndyRTR) - Tuesday, 30 March 2021, 11:42 GMT
Task Type Feature Request
Category Packages
Status Closed
Assigned To Anatol Pomozov (anatolik)
Eli Schwartz (eschwartz)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

gcc is configured with --enable-default-pie, while aarch64-linux-gnu-gcc is not.
This breaks cross compiling with distcc is some cases.
This task depends upon

Closed by  Andreas Radke (AndyRTR)
Tuesday, 30 March 2021, 11:42 GMT
Reason for closing:  Fixed
Comment by Anatol Pomozov (anatolik) - Friday, 20 November 2020, 21:12 GMT
Could you please add a bit more information about the cross-compiling issue with distcc? How to reproduce it?

Do all *-linux-gnu-gcc packages need to be aligned? for example riscv64-linux-gnu-gcc neither has this flag.
Comment by Christer Solskogen (solskogen) - Friday, 20 November 2020, 21:25 GMT
I use aarch64-linux-gnu-gcc on Arch Linux to cross compile (using distcc) on Arch Linux ARM. The main problem is that when you link, you link using the linker on the target, the target linker thinks it can use -fPIE/-FPIC because that's what the native compiler uses, so in effect the linker will fail.

(native) gcc for Arch Linux *is* compiled with --enable-default-pie. It's just that the aarch64 cross compiler isn't. The same goes for the native gcc on Arch Linux ARM.
The missing --enable-default-pie is the only GCC configure flag that I know causes linker problems, as I've edited the PKGBUILD for aarch64-linux-gnu-gcc myself with that flag added and haven't seen any other issues.

I can't say for sure about other archs, since I haven't tested them.
Comment by Anatol Pomozov (anatolik) - Sunday, 29 November 2020, 17:07 GMT
Thank you for the information. Enabling --enable-default-pie for the cross compiling toolset makes sense as the native one does it already.

The change got merged to SVN and it will be available with the next package rebuild (10.2.1).

Loading...