From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: James Hilliard <james.hilliard1@gmail.com>
Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>,
Romain Naour <romain.naour@gmail.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] package/gcc: ensure __register_frame is optimized out for glibc
Date: Sun, 30 Oct 2022 09:30:33 +0100 [thread overview]
Message-ID: <20221030083033.GC1058960@scaer> (raw)
In-Reply-To: <20221028223844.1180418-1-james.hilliard1@gmail.com>
James, All,
On 2022-10-28 16:38 -0600, James Hilliard spake thusly:
> On some architectures when building with -O0 the __register_frame
> symbol fails to get optimized out which can cause linking failures
> when building glibc.
>
> To fix this set -O1 for GCC target libs when building with glibc
> and BR2_OPTIMIZE_0 on the problematic target architectures.
>
> Fixes:
> - http://autobuild.buildroot.net/results/89b/89b6c6924240b7cf82035a844f3573673e91b364
> - http://autobuild.buildroot.net/results/46f/46f4ec99d2b23d354a4bb5e92123d64f0da6ed27
> - http://autobuild.buildroot.net/results/839/839f929f700cf181ebdf34389c7806a96f55813e
> - http://autobuild.buildroot.net/results/0e2/0e202bf53a683930f3cad6edef2a4dea629eaecb
> - http://autobuild.buildroot.net/results/8a8/8a8c917f597fdcca744e696e19e9300b64004335
> - http://autobuild.buildroot.net/results/c05/c058b27ed2834dfa633b63ec6c3639ab1e8bf412
> - http://autobuild.buildroot.net/results/8ba/8ba8882a861cf7df359c23969c09b2be0725b2e5
>
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> ---
> package/gcc/gcc.mk | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
> index ec6f3b550a..a339f77970 100644
> --- a/package/gcc/gcc.mk
> +++ b/package/gcc/gcc.mk
> @@ -103,6 +103,15 @@ GCC_COMMON_TARGET_CFLAGS += -matomic
> GCC_COMMON_TARGET_CXXFLAGS += -matomic
> endif
>
> +# Enable GCC target libs optimizations to optimize out __register_frame
> +# when needed for some architectures when building with glibc.
> +ifeq ($(BR2_TOOLCHAIN_USES_GLIBC)$(BR2_OPTIMIZE_0),yy)
> +ifeq ($(BR2_microblazebe)$(BR2_microblazeel)$(BR2_mips)$(BR2_mipsel)$(BR2_nios2)$(BR2_or1k)$(BR2_sh),y)
> +GCC_COMMON_TARGET_CFLAGS += -O1
> +GCC_COMMON_TARGET_CXXFLAGS += -O1
> +endif
> +endif
Should this not be limitied to the intial compiler only? Otherwise, why
would we need it for the final compiler?
Regards,
Yann E. MORIN.
> # Propagate options used for target software building to GCC target libs
> HOST_GCC_COMMON_CONF_ENV += CFLAGS_FOR_TARGET="$(GCC_COMMON_TARGET_CFLAGS)"
> HOST_GCC_COMMON_CONF_ENV += CXXFLAGS_FOR_TARGET="$(GCC_COMMON_TARGET_CXXFLAGS)"
> --
> 2.34.1
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2022-10-30 8:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-28 22:38 [Buildroot] [PATCH 1/1] package/gcc: ensure __register_frame is optimized out for glibc James Hilliard
2022-10-30 8:30 ` Yann E. MORIN [this message]
2022-11-17 7:53 ` Thomas Petazzoni via buildroot
2022-11-25 14:06 ` Arnout Vandecappelle
2022-11-25 14:15 ` Thomas Petazzoni via buildroot
2022-12-06 22:03 ` Peter Korsgaard
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=20221030083033.GC1058960@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@buildroot.org \
--cc=giulio.benetti@benettiengineering.com \
--cc=james.hilliard1@gmail.com \
--cc=romain.naour@gmail.com \
--cc=thomas.petazzoni@bootlin.com \
/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