Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
Cc: Romain Naour <romain.naour@gmail.com>,
	Giulio Benetti <giulio.benetti@benettiengineering.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [Buildroot] [PATCH] package/gcc: add patch to fix glibc header conflict
Date: Wed, 26 Oct 2022 13:36:26 +0200	[thread overview]
Message-ID: <20221026133626.45a9cdb7@windsurf> (raw)
In-Reply-To: <20221025201400.3816183-1-thomas.petazzoni@bootlin.com>

On Tue, 25 Oct 2022 22:13:59 +0200
Thomas Petazzoni via buildroot <buildroot@buildroot.org> wrote:

> This commit backports the patch "fixinc: don't "fix" machine names in
> __has_include(...)" from upstream GCC, which is needed to resolve a
> header conflict between glibc headers and kernel headers, which has
> appeared since we bumped glibc to version 2.36 in commit
> 80c8c15c8534a24382b900a07082a289a368f736.
> 
> The problem comes from the "fixinc" logic used by gcc to fixup some
> headers files, generated inside an include-fixed/ folder. This logic
> ended up replacing "linux/mount.h" by "__linux__/mount.h" in
> __has_include() invocation, like this:
> 
>  #ifdef __has_include
>  # if __has_include ("__linux__/mount.h")
>  #  include "linux/mount.h"
>  # endif
>  #endif
> 
> in
> build/host-gcc-final-11.3.0/build/gcc/include-fixed/sys/mount.h. With
> this fix in place, this "include-fixed" header is no longer generated,
> avoiding the problem.
> 
> This issue was visible in two different ways in glibc configurations:
> 
>  - As a build failure during the gcc build itself, for architectures
>    that support libsanitizer, as libsanitizer includes mount.h, and
>    would therefore encounter the header conflict.
> 
>  - As a build failure during another user-space package (such as
>    sysvinit for example), on architectures when libsanitizer isn't
>    used, and therefore for which the gcc build was successful, but the
>    header conflict shows up when building some "random" user-space
>    package.
> 
> The problem is already fixed in GCC 12.2.0, so no patch is
> required. The problem did not exist back in GCC 8.4.0, so this version
> does not need patching. Consequently, the patch is only needed for GCC
> 10.4.0, GCC 11.3.0 and the special ARC 2020.09-release version.
> 
> Fixes:
> 
>   (gcc build issue, on architecture that supports libsanitizer)
>   http://autobuild.buildroot.net/results/90fe4c3b8b72a2c28555674383de9bbd9e8ae09a/
> 
>   (sysvinit build issue, on architecture that does not support libsanitizer)
>   http://autobuild.buildroot.net/results/d7bf5795b7621a92be32f18794e3e67944fb96db/
> 
>   (crun)
>   http://autobuild.buildroot.net/results/e3e8da4f797dced48aedf8c636db983d36849850/
> 
>   (libarchive)
>   http://autobuild.buildroot.net/results/9fcbf0c036a97b2e9a4fcc6e173bcfa09e1b3dac/
> 
> Thanks a lot to Peter Seiderer for pointing the relevant GCC commit.
> 
> Fixes:
> 
>   https://bugs.busybox.net/show_bug.cgi?id=15021
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
>  ...-machine-names-in-__has_include-.-PR.patch | 124 ++++++++++++++++++
>  ...-machine-names-in-__has_include-.-PR.patch | 124 ++++++++++++++++++
>  ...-machine-names-in-__has_include-.-PR.patch | 124 ++++++++++++++++++
>  3 files changed, 372 insertions(+)
>  create mode 100644 package/gcc/10.4.0/0006-fixinc-don-t-fix-machine-names-in-__has_include-.-PR.patch
>  create mode 100644 package/gcc/11.3.0/0007-fixinc-don-t-fix-machine-names-in-__has_include-.-PR.patch
>  create mode 100644 package/gcc/arc-2020.09-release/0003-fixinc-don-t-fix-machine-names-in-__has_include-.-PR.patch

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      parent reply	other threads:[~2022-10-26 11:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-25 20:13 [Buildroot] [PATCH] package/gcc: add patch to fix glibc header conflict Thomas Petazzoni via buildroot
2022-10-26  8:48 ` Romain Naour
2022-10-26  9:49 ` Arnout Vandecappelle
2022-10-26 11:36 ` Thomas Petazzoni via buildroot [this message]

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=20221026133626.45a9cdb7@windsurf \
    --to=buildroot@buildroot.org \
    --cc=giulio.benetti@benettiengineering.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