($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
From: <kai.kang@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: [PATCH v2] glibc: fix multilib headers conflict for arm
Date: Sat, 11 May 2024 09:49:53 +0800	[thread overview]
Message-ID: <20240511014953.5360-1-kai.kang@windriver.com> (raw)

From: Kai Kang <kai.kang@windriver.com>

The header files conflic when multilib enabled for arm:

| Error: Transaction test error:
|   file /usr/include/finclude/math-vector-fortran.h conflicts between attempted installs of
    lib32-libc6-dev-2.39+git0+312e159626-r0.armv7at2hf_neon and libc6-dev-2.39+git0+312e159626-r0.cortexa72

Invoke function oe_multilib_header to resolve it.

But gfortran-cross can NOT recognize macros such as `#ifdef` as
expected, so pass option `-nostdinc` to gfortran-cross-aarch64 that not
preinclude multilib specific math-vector-fortran.h [1].

[1]: https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/config/gnu-user.h;h=f7eefdafe8b330787c412ad950675d7a2d595e61;hb=HEAD#l158

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 meta/conf/bitbake.conf                    | 5 ++++-
 meta/recipes-core/glibc/glibc-package.inc | 2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index b2c500d873..262c3e32ee 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -555,11 +555,14 @@ HOSTTOOLS_NONFATAL += "git-lfs"
 
 CCACHE ??= ""
 
+FC_OPTIONS ??= ""
+FC_OPTIONS:append:aarch64 = " -nostdinc"
+
 TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TARGET}"
 
 export CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
 export CXX = "${CCACHE}${HOST_PREFIX}g++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
-export FC = "${HOST_PREFIX}gfortran ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
+export FC = "${HOST_PREFIX}gfortran ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}${FC_OPTIONS}"
 export CPP = "${HOST_PREFIX}gcc -E${TOOLCHAIN_OPTIONS} ${HOST_CC_ARCH}"
 export LD = "${HOST_PREFIX}ld${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH}"
 export CCLD = "${CC}"
diff --git a/meta/recipes-core/glibc/glibc-package.inc b/meta/recipes-core/glibc/glibc-package.inc
index 0c5e3b4c3d..3a2ebfff75 100644
--- a/meta/recipes-core/glibc/glibc-package.inc
+++ b/meta/recipes-core/glibc/glibc-package.inc
@@ -167,6 +167,8 @@ do_install_armmultilib () {
 	oe_multilib_header fpu_control.h gnu/lib-names.h gnu/stubs.h ieee754.h
 
 	oe_multilib_header sys/elf.h sys/procfs.h sys/ptrace.h sys/ucontext.h sys/user.h
+
+	oe_multilib_header finclude/math-vector-fortran.h
 }
 
 
-- 
2.34.1



             reply	other threads:[~2024-05-11  1:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-11  1:49 kai.kang [this message]
2024-05-11 10:49 ` [OE-core] [PATCH v2] glibc: fix multilib headers conflict for arm Richard Purdie

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=20240511014953.5360-1-kai.kang@windriver.com \
    --to=kai.kang@windriver.com \
    --cc=openembedded-core@lists.openembedded.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).