public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Bootstrap of ARM Cortex-M3 cross-compiler with LTO broken
       [not found] <2000384715.1095815.1640197249468.ref@mail.yahoo.com>
@ 2021-12-22 18:20 ` R. Diez
  0 siblings, 0 replies; only message in thread
From: R. Diez @ 2021-12-22 18:20 UTC (permalink / raw)
  To: gcc-help

Hi all:

I have been building ARM Cortex-M3 cross-compiler toolchains for years with makefiles similar to this one:

https://github.com/rdiez/JtagDue/blob/master/Toolchain/Makefile

I am trying to upgrade that makefile from GCC 10.2 to GCC 11.2 (search for "VersionSet9" in that makefile), and I am getting this error from ld:

/usr/bin/ld: /tmp/g++-mapper-server.98PJcy.ltrans0.ltrans.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:94: g++-mapper-server] Error 1
make[2]: *** [Makefile:10549: all-c++tools] Error 2

This is very similar to the following bug:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98324

I checked, and the fix linked from this bug is included in version GCC 11.2 . But I am still getting that error.

The way I am building the toolchain is not the same as described in that bug. I have never used option "--enable-default-pie" in the past, and I have never used option "-with-build-config=bootstrap-lto-lean", and I still was able build cross-toolchains with many GCC versions for years.

The target is actually an embedded ARM Cortex-M3 microcontroller with fixed memory addresses (a "bare metal" firmware without OS), so I guess that I do not really need PIE. It may even cost some performance, if I understand correctly what PIE does.

I am guessing that bootstrapping a cross-compiler GCC with LTO is still broken with its default PIE setting.

I already added Comment 7 about it to that bug, but got no reply yet.

Can anybody here help?

Thanks in advance,
  rdiez

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-22 18:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <2000384715.1095815.1640197249468.ref@mail.yahoo.com>
2021-12-22 18:20 ` Bootstrap of ARM Cortex-M3 cross-compiler with LTO broken R. Diez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).