From 4ed6505a18ac76c0aa148deabb143214ac0c4552 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 16 Aug 2021 23:23:05 +0100 Subject: [PATCH] gcc: Fix nativesdk builds and multilib fixes with gcc 11 In newer gcc versions the headers changed locations and our multiconfig and nativesdk tweaks to loader paths wasn't working. The broke buildtools-extended-tarball, particularly on arm. Update to fix this. Ultimately we should dump the gcc specs and check for hardcoded paths. This isn't possible quite yet as this patch doesn't fix the musl ones as we don't use that in mutlilib or nativesdk scenarios at present. Signed-off-by: Richard Purdie --- .../gcc/gcc-multilib-config.inc | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/meta/recipes-devtools/gcc/gcc-multilib-config.inc b/meta/recipes-devtools/gcc/gcc-multilib-config.inc index e90580d1cd..33bcbbfa24 100644 --- a/meta/recipes-devtools/gcc/gcc-multilib-config.inc +++ b/meta/recipes-devtools/gcc/gcc-multilib-config.inc @@ -31,7 +31,9 @@ python gcc_multilib_setup() { '%s/*/linux64.h' % src_conf_dir, '%s/aarch64/t-aarch64' % src_conf_dir, '%s/aarch64/aarch64.h' % src_conf_dir, + '%s/aarch64/aarch64-linux.h' % src_conf_dir, '%s/aarch64/aarch64-cores.def' % src_conf_dir, + '%s/arm/linux-eabi.h' % src_conf_dir, '%s/*/linux.h' % src_conf_dir, '%s/linux.h' % src_conf_dir) @@ -102,6 +104,8 @@ python gcc_multilib_setup() { r'\1' + wrap_libdir(libdir64) + r'\3'), (r'^(#define\s*GLIBC_DYNAMIC_LINKER64\s*\"\S+\"\s*)(\S+)(\s*\"\S+\"\s*)(\S+)(\s*\".*\")$', r'\1' + wrap_libdir(libdir64) + r'\3' + wrap_libdir(libdir64) + r'\5'), + (r'^(#define\s*GLIBC_DYNAMIC_LINKER\b\s*)(\S+)(\s*\".*\")$', + r'\1' + wrap_libdir(libdir32) + r'\3'), (r'^(#define\s*GLIBC_DYNAMIC_LINKERX32\s*)(\S+)(\s*\".*\")$', r'\1' + wrap_libdir(libdirx32) + r'\3'), (r'^(#define\s*GLIBC_DYNAMIC_LINKERN32\s*)(\S+)(\s*\".*\")$', @@ -112,6 +116,8 @@ python gcc_multilib_setup() { r'\1' + wrap_libdir(libdir64) + r'\3'), (r'^(#define\s*UCLIBC_DYNAMIC_LINKERN32\s*)(\S+)(\s*\".*\")$', r'\1' + wrap_libdir(libdirn32) + r'\3'), + (r'^(#define\s*UCLIBC_DYNAMIC_LINKERX32\s*)(\S+)(\s*\".*\")$', + r'\1' + wrap_libdir(libdirx32) + r'\3'), (r'^(#define\s*UCLIBC_DYNAMIC_LINKER\b\s*)(\S+)(\s*\".*\")$', r'\1' + wrap_libdir(libdir32) + r'\3'), ] @@ -138,15 +144,15 @@ python gcc_multilib_setup() { } gcc_header_config_files = { - 'x86_64' : ['gcc/config/i386/linux64.h'], - 'i586' : ['gcc/config/i386/linux64.h'], - 'i686' : ['gcc/config/i386/linux64.h'], - 'mips' : ['gcc/config/mips/linux.h', 'gcc/config/mips/linux64.h'], - 'mips64' : ['gcc/config/mips/linux.h', 'gcc/config/mips/linux64.h'], - 'powerpc' : ['gcc/config/rs6000/linux64.h'], - 'powerpc64' : ['gcc/config/rs6000/linux64.h'], - 'aarch64' : ['gcc/config/aarch64/aarch64.h'], - 'arm' : ['gcc/config/aarch64/aarch64.h'], + 'x86_64' : ['gcc/config/linux.h', 'gcc/config/i386/linux.h', 'gcc/config/i386/linux64.h'], + 'i586' : ['gcc/config/linux.h', 'gcc/config/i386/linux.h', 'gcc/config/i386/linux64.h'], + 'i686' : ['gcc/config/linux.h', 'gcc/config/i386/linux64.h'], + 'mips' : ['gcc/config/linux.h', 'gcc/config/mips/linux.h', 'gcc/config/mips/linux64.h'], + 'mips64' : ['gcc/config/linux.h', 'gcc/config/mips/linux.h', 'gcc/config/mips/linux64.h'], + 'powerpc' : ['gcc/config/linux.h', 'gcc/config/rs6000/linux64.h'], + 'powerpc64' : ['gcc/config/linux.h', 'gcc/config/rs6000/linux64.h'], + 'aarch64' : ['gcc/config/linux.h', 'gcc/config/aarch64/aarch64-linux.h', 'gcc/config/arm/linux-eabi.h'], + 'arm' : ['gcc/config/linux.h', 'gcc/config/aarch64/aarch64-linux.h', 'gcc/config/arm/linux-eabi.h'], } libdir32 = 'SYSTEMLIBS_DIR' -- 2.40.1