Re: [OE-core] [kirkstone][PATCH 1/1] gcc: Refactor linker patches and fix linker on arm with usrmerge
On Mon, Jan 16, 2023 at 7:32 AM Khem Raj wrote: > > > > On Sun, Jan 15, 2023 at 11:56 PM Pavel Zhukov wrote: >> >> Backport fix from master to allow gcc to use proper linker path for >> musl [Yocto #14977]. > > > Lgtm Of the two, I think this seems to be closer to master and perhaps easier to maintain in long run. So lets use this one. > >> >> >> Fixes: >> | qemu-arm: Could not open '/lib/ld-musl-armhf.so.1': No such file or >> directory >> >> Signed-off-by: Pavel Zhukov >> --- >> meta/recipes-devtools/gcc/gcc-11.3.inc| 1 - >> ...rm-add-armv9-a-architecture-to-march.patch | 89 +++--- >> ...AMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch | 269 +- >> ...s-fix-v4bx-to-linker-to-support-EABI.patch | 10 +- >> ...019-nios2-Define-MUSL_DYNAMIC_LINKER.patch | 25 -- >> 5 files changed, 245 insertions(+), 149 deletions(-) >> delete mode 100644 >> meta/recipes-devtools/gcc/gcc/0019-nios2-Define-MUSL_DYNAMIC_LINKER.patch >> >> diff --git a/meta/recipes-devtools/gcc/gcc-11.3.inc >> b/meta/recipes-devtools/gcc/gcc-11.3.inc >> index 27074a06ae..ab2ece3cce 100644 >> --- a/meta/recipes-devtools/gcc/gcc-11.3.inc >> +++ b/meta/recipes-devtools/gcc/gcc-11.3.inc >> @@ -48,7 +48,6 @@ SRC_URI = "\ >> >> file://0016-If-CXXFLAGS-contains-something-unsupported-by-the-bu.patch \ >> file://0017-handle-sysroot-support-for-nativesdk-gcc.patch \ >> >> file://0018-Search-target-sysroot-gcc-version-specific-dirs-with.patch \ >> - file://0019-nios2-Define-MUSL_DYNAMIC_LINKER.patch \ >> >> file://0020-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch \ >> >> file://0021-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch \ >> file://0022-sync-gcc-stddef.h-with-musl.patch \ >> diff --git >> a/meta/recipes-devtools/gcc/gcc/0004-arm-add-armv9-a-architecture-to-march.patch >> >> b/meta/recipes-devtools/gcc/gcc/0004-arm-add-armv9-a-architecture-to-march.patch >> index c38d1b9119..864c8b3017 100644 >> --- >> a/meta/recipes-devtools/gcc/gcc/0004-arm-add-armv9-a-architecture-to-march.patch >> +++ >> b/meta/recipes-devtools/gcc/gcc/0004-arm-add-armv9-a-architecture-to-march.patch >> @@ -43,10 +43,10 @@ Signed-off-by: Ruiqiang Hao >> gcc/testsuite/lib/target-supports.exp | 3 ++- >> 9 files changed, 79 insertions(+), 8 deletions(-) >> >> -diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in >> -index bcc9ebe9f..58d83829c 100644 >> a/gcc/config/arm/arm-cpus.in >> -+++ b/gcc/config/arm/arm-cpus.in >> +Index: gcc-11.3.0/gcc/config/arm/arm-cpus.in >> +=== >> +--- gcc-11.3.0.orig/gcc/config/arm/arm-cpus.in >> gcc-11.3.0/gcc/config/arm/arm-cpus.in >> @@ -132,6 +132,9 @@ define feature cmse >> # Architecture rel 8.1-M. >> define feature armv8_1m_main >> @@ -57,7 +57,7 @@ index bcc9ebe9f..58d83829c 100644 >> # Floating point and Neon extensions. >> # VFPv1 is not supported in GCC. >> >> -@@ -293,6 +296,7 @@ define fgroup ARMv8m_base ARMv6m armv8 cmse tdiv >> +@@ -293,6 +296,7 @@ define fgroup ARMv8m_base ARMv6m armv8 c >> define fgroup ARMv8m_main ARMv7m armv8 cmse >> define fgroup ARMv8r ARMv8a >> define fgroup ARMv8_1m_main ARMv8m_main armv8_1m_main >> @@ -87,10 +87,10 @@ index bcc9ebe9f..58d83829c 100644 >> begin arch iwmmxt >>tune for iwmmxt >>tune flags LDSCHED STRONG XSCALE >> -diff --git a/gcc/config/arm/arm-tables.opt b/gcc/config/arm/arm-tables.opt >> -index 5692d4fb7..ae3dd9414 100644 >> a/gcc/config/arm/arm-tables.opt >> -+++ b/gcc/config/arm/arm-tables.opt >> +Index: gcc-11.3.0/gcc/config/arm/arm-tables.opt >> +=== >> +--- gcc-11.3.0.orig/gcc/config/arm/arm-tables.opt >> gcc-11.3.0/gcc/config/arm/arm-tables.opt >> @@ -380,10 +380,13 @@ EnumValue >> Enum(arm_arch) String(armv8.1-m.main) Value(30) >> >> @@ -107,10 +107,10 @@ index 5692d4fb7..ae3dd9414 100644 >> >> Enum >> Name(arm_fpu) Type(enum fpu_type) >> -diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h >> -index 47c13a9e5..088c7725c 100644 >> a/gcc/config/arm/arm.h >> -+++ b/gcc/config/arm/arm.h >> +Index: gcc-11.3.0/gcc/config/arm/arm.h >> +=== >> +--- gcc-11.3.0.orig/gcc/config/arm/arm.h >> gcc-11.3.0/gcc/config/arm/arm.h >> @@ -456,7 +456,8 @@ enum base_architecture >> BASE_ARCH_8A = 8, >> BASE_ARCH_8M_BASE = 8, >> @@ -121,10 +121,10 @@ index 47c13a9e5..088c7725c 100644 >> }; >> >> /* The major revision number of the ARM Architecture implemented by the >> target. */ >> -diff --git a/gcc/config/arm/t-aprofile b/gcc/config/arm/t-aprofile >> -index 8574ac3e2..68e2251c7 100644 >> a/gcc/config/arm/t-aprofile >> -+++ b/gcc/config/arm/t-aprofile >> +Index: gcc-11.3.0/gcc/config/arm/t-aprofile >>
Re: [OE-core] [kirkstone][PATCH 1/1] gcc: Refactor linker patches and fix linker on arm with usrmerge
On Sun, Jan 15, 2023 at 11:56 PM Pavel Zhukov wrote: > Backport fix from master to allow gcc to use proper linker path for > musl [Yocto #14977]. Lgtm > > Fixes: > | qemu-arm: Could not open '/lib/ld-musl-armhf.so.1': No such file or > directory > > Signed-off-by: Pavel Zhukov > --- > meta/recipes-devtools/gcc/gcc-11.3.inc| 1 - > ...rm-add-armv9-a-architecture-to-march.patch | 89 +++--- > ...AMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch | 269 +- > ...s-fix-v4bx-to-linker-to-support-EABI.patch | 10 +- > ...019-nios2-Define-MUSL_DYNAMIC_LINKER.patch | 25 -- > 5 files changed, 245 insertions(+), 149 deletions(-) > delete mode 100644 > meta/recipes-devtools/gcc/gcc/0019-nios2-Define-MUSL_DYNAMIC_LINKER.patch > > diff --git a/meta/recipes-devtools/gcc/gcc-11.3.inc > b/meta/recipes-devtools/gcc/gcc-11.3.inc > index 27074a06ae..ab2ece3cce 100644 > --- a/meta/recipes-devtools/gcc/gcc-11.3.inc > +++ b/meta/recipes-devtools/gcc/gcc-11.3.inc > @@ -48,7 +48,6 @@ SRC_URI = "\ > > file://0016-If-CXXFLAGS-contains-something-unsupported-by-the-bu.patch \ > file://0017-handle-sysroot-support-for-nativesdk-gcc.patch \ > > file://0018-Search-target-sysroot-gcc-version-specific-dirs-with.patch \ > - file://0019-nios2-Define-MUSL_DYNAMIC_LINKER.patch \ > > file://0020-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch \ > > file://0021-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch \ > file://0022-sync-gcc-stddef.h-with-musl.patch \ > diff --git > a/meta/recipes-devtools/gcc/gcc/0004-arm-add-armv9-a-architecture-to-march.patch > b/meta/recipes-devtools/gcc/gcc/0004-arm-add-armv9-a-architecture-to-march.patch > index c38d1b9119..864c8b3017 100644 > --- > a/meta/recipes-devtools/gcc/gcc/0004-arm-add-armv9-a-architecture-to-march.patch > +++ > b/meta/recipes-devtools/gcc/gcc/0004-arm-add-armv9-a-architecture-to-march.patch > @@ -43,10 +43,10 @@ Signed-off-by: Ruiqiang Hao < > ruiqiang@windriver.com> > gcc/testsuite/lib/target-supports.exp | 3 ++- > 9 files changed, 79 insertions(+), 8 deletions(-) > > -diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in > -index bcc9ebe9f..58d83829c 100644 > a/gcc/config/arm/arm-cpus.in > -+++ b/gcc/config/arm/arm-cpus.in > +Index: gcc-11.3.0/gcc/config/arm/arm-cpus.in > +=== > +--- gcc-11.3.0.orig/gcc/config/arm/arm-cpus.in > gcc-11.3.0/gcc/config/arm/arm-cpus.in > @@ -132,6 +132,9 @@ define feature cmse > # Architecture rel 8.1-M. > define feature armv8_1m_main > @@ -57,7 +57,7 @@ index bcc9ebe9f..58d83829c 100644 > # Floating point and Neon extensions. > # VFPv1 is not supported in GCC. > > -@@ -293,6 +296,7 @@ define fgroup ARMv8m_base ARMv6m armv8 cmse tdiv > +@@ -293,6 +296,7 @@ define fgroup ARMv8m_base ARMv6m armv8 c > define fgroup ARMv8m_main ARMv7m armv8 cmse > define fgroup ARMv8r ARMv8a > define fgroup ARMv8_1m_main ARMv8m_main armv8_1m_main > @@ -87,10 +87,10 @@ index bcc9ebe9f..58d83829c 100644 > begin arch iwmmxt >tune for iwmmxt >tune flags LDSCHED STRONG XSCALE > -diff --git a/gcc/config/arm/arm-tables.opt b/gcc/config/arm/arm-tables.opt > -index 5692d4fb7..ae3dd9414 100644 > a/gcc/config/arm/arm-tables.opt > -+++ b/gcc/config/arm/arm-tables.opt > +Index: gcc-11.3.0/gcc/config/arm/arm-tables.opt > +=== > +--- gcc-11.3.0.orig/gcc/config/arm/arm-tables.opt > gcc-11.3.0/gcc/config/arm/arm-tables.opt > @@ -380,10 +380,13 @@ EnumValue > Enum(arm_arch) String(armv8.1-m.main) Value(30) > > @@ -107,10 +107,10 @@ index 5692d4fb7..ae3dd9414 100644 > > Enum > Name(arm_fpu) Type(enum fpu_type) > -diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h > -index 47c13a9e5..088c7725c 100644 > a/gcc/config/arm/arm.h > -+++ b/gcc/config/arm/arm.h > +Index: gcc-11.3.0/gcc/config/arm/arm.h > +=== > +--- gcc-11.3.0.orig/gcc/config/arm/arm.h > gcc-11.3.0/gcc/config/arm/arm.h > @@ -456,7 +456,8 @@ enum base_architecture > BASE_ARCH_8A = 8, > BASE_ARCH_8M_BASE = 8, > @@ -121,10 +121,10 @@ index 47c13a9e5..088c7725c 100644 > }; > > /* The major revision number of the ARM Architecture implemented by the > target. */ > -diff --git a/gcc/config/arm/t-aprofile b/gcc/config/arm/t-aprofile > -index 8574ac3e2..68e2251c7 100644 > a/gcc/config/arm/t-aprofile > -+++ b/gcc/config/arm/t-aprofile > +Index: gcc-11.3.0/gcc/config/arm/t-aprofile > +=== > +--- gcc-11.3.0.orig/gcc/config/arm/t-aprofile > gcc-11.3.0/gcc/config/arm/t-aprofile > @@ -26,8 +26,8 @@ > > # Arch and FPU variants to build libraries with > @@ -136,7 +136,7 @@ index 8574ac3e2..68e2251c7 100644 > > # ARMv7-A - build nofp, fp-d16 and SIMD variants > > -@@ -46,6 +46,11 @@
[OE-core] [kirkstone][PATCH 1/1] gcc: Refactor linker patches and fix linker on arm with usrmerge
Backport fix from master to allow gcc to use proper linker path for musl [Yocto #14977]. Fixes: | qemu-arm: Could not open '/lib/ld-musl-armhf.so.1': No such file or directory Signed-off-by: Pavel Zhukov --- meta/recipes-devtools/gcc/gcc-11.3.inc| 1 - ...rm-add-armv9-a-architecture-to-march.patch | 89 +++--- ...AMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch | 269 +- ...s-fix-v4bx-to-linker-to-support-EABI.patch | 10 +- ...019-nios2-Define-MUSL_DYNAMIC_LINKER.patch | 25 -- 5 files changed, 245 insertions(+), 149 deletions(-) delete mode 100644 meta/recipes-devtools/gcc/gcc/0019-nios2-Define-MUSL_DYNAMIC_LINKER.patch diff --git a/meta/recipes-devtools/gcc/gcc-11.3.inc b/meta/recipes-devtools/gcc/gcc-11.3.inc index 27074a06ae..ab2ece3cce 100644 --- a/meta/recipes-devtools/gcc/gcc-11.3.inc +++ b/meta/recipes-devtools/gcc/gcc-11.3.inc @@ -48,7 +48,6 @@ SRC_URI = "\ file://0016-If-CXXFLAGS-contains-something-unsupported-by-the-bu.patch \ file://0017-handle-sysroot-support-for-nativesdk-gcc.patch \ file://0018-Search-target-sysroot-gcc-version-specific-dirs-with.patch \ - file://0019-nios2-Define-MUSL_DYNAMIC_LINKER.patch \ file://0020-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch \ file://0021-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch \ file://0022-sync-gcc-stddef.h-with-musl.patch \ diff --git a/meta/recipes-devtools/gcc/gcc/0004-arm-add-armv9-a-architecture-to-march.patch b/meta/recipes-devtools/gcc/gcc/0004-arm-add-armv9-a-architecture-to-march.patch index c38d1b9119..864c8b3017 100644 --- a/meta/recipes-devtools/gcc/gcc/0004-arm-add-armv9-a-architecture-to-march.patch +++ b/meta/recipes-devtools/gcc/gcc/0004-arm-add-armv9-a-architecture-to-march.patch @@ -43,10 +43,10 @@ Signed-off-by: Ruiqiang Hao gcc/testsuite/lib/target-supports.exp | 3 ++- 9 files changed, 79 insertions(+), 8 deletions(-) -diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in -index bcc9ebe9f..58d83829c 100644 a/gcc/config/arm/arm-cpus.in -+++ b/gcc/config/arm/arm-cpus.in +Index: gcc-11.3.0/gcc/config/arm/arm-cpus.in +=== +--- gcc-11.3.0.orig/gcc/config/arm/arm-cpus.in gcc-11.3.0/gcc/config/arm/arm-cpus.in @@ -132,6 +132,9 @@ define feature cmse # Architecture rel 8.1-M. define feature armv8_1m_main @@ -57,7 +57,7 @@ index bcc9ebe9f..58d83829c 100644 # Floating point and Neon extensions. # VFPv1 is not supported in GCC. -@@ -293,6 +296,7 @@ define fgroup ARMv8m_base ARMv6m armv8 cmse tdiv +@@ -293,6 +296,7 @@ define fgroup ARMv8m_base ARMv6m armv8 c define fgroup ARMv8m_main ARMv7m armv8 cmse define fgroup ARMv8r ARMv8a define fgroup ARMv8_1m_main ARMv8m_main armv8_1m_main @@ -87,10 +87,10 @@ index bcc9ebe9f..58d83829c 100644 begin arch iwmmxt tune for iwmmxt tune flags LDSCHED STRONG XSCALE -diff --git a/gcc/config/arm/arm-tables.opt b/gcc/config/arm/arm-tables.opt -index 5692d4fb7..ae3dd9414 100644 a/gcc/config/arm/arm-tables.opt -+++ b/gcc/config/arm/arm-tables.opt +Index: gcc-11.3.0/gcc/config/arm/arm-tables.opt +=== +--- gcc-11.3.0.orig/gcc/config/arm/arm-tables.opt gcc-11.3.0/gcc/config/arm/arm-tables.opt @@ -380,10 +380,13 @@ EnumValue Enum(arm_arch) String(armv8.1-m.main) Value(30) @@ -107,10 +107,10 @@ index 5692d4fb7..ae3dd9414 100644 Enum Name(arm_fpu) Type(enum fpu_type) -diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h -index 47c13a9e5..088c7725c 100644 a/gcc/config/arm/arm.h -+++ b/gcc/config/arm/arm.h +Index: gcc-11.3.0/gcc/config/arm/arm.h +=== +--- gcc-11.3.0.orig/gcc/config/arm/arm.h gcc-11.3.0/gcc/config/arm/arm.h @@ -456,7 +456,8 @@ enum base_architecture BASE_ARCH_8A = 8, BASE_ARCH_8M_BASE = 8, @@ -121,10 +121,10 @@ index 47c13a9e5..088c7725c 100644 }; /* The major revision number of the ARM Architecture implemented by the target. */ -diff --git a/gcc/config/arm/t-aprofile b/gcc/config/arm/t-aprofile -index 8574ac3e2..68e2251c7 100644 a/gcc/config/arm/t-aprofile -+++ b/gcc/config/arm/t-aprofile +Index: gcc-11.3.0/gcc/config/arm/t-aprofile +=== +--- gcc-11.3.0.orig/gcc/config/arm/t-aprofile gcc-11.3.0/gcc/config/arm/t-aprofile @@ -26,8 +26,8 @@ # Arch and FPU variants to build libraries with @@ -136,7 +136,7 @@ index 8574ac3e2..68e2251c7 100644 # ARMv7-A - build nofp, fp-d16 and SIMD variants -@@ -46,6 +46,11 @@ MULTILIB_REQUIRED += mthumb/march=armv8-a/mfloat-abi=soft +@@ -46,6 +46,11 @@ MULTILIB_REQUIRED += mthumb/march=armv8- MULTILIB_REQUIRED += mthumb/march=armv8-a+simd/mfloat-abi=hard MULTILIB_REQUIRED +=