From: Kai Kang <[email protected]>

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 <[email protected]>
---
 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

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#199202): 
https://lists.openembedded.org/g/openembedded-core/message/199202
Mute This Topic: https://lists.openembedded.org/mt/106033238/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to