From: "R. Diez" <rdiezmail-gcc@yahoo.de>
To: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: Bootstrap of ARM Cortex-M3 cross-compiler with LTO broken
Date: Wed, 22 Dec 2021 18:20:49 +0000 (UTC) [thread overview]
Message-ID: <2000384715.1095815.1640197249468@mail.yahoo.com> (raw)
In-Reply-To: <2000384715.1095815.1640197249468.ref@mail.yahoo.com>
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
parent reply other threads:[~2021-12-22 18:21 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <2000384715.1095815.1640197249468.ref@mail.yahoo.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2000384715.1095815.1640197249468@mail.yahoo.com \
--to=rdiezmail-gcc@yahoo.de \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).