glibc-package.inc: Fix builds of pseudo with glibc 2.34
PATCH 1/5 glibc-package.inc: Fix builds of pseudo with glibc 2.34
Use the same dynamic link tweak for libdl as without this, we have issues building/using pseudo in mixed glibc/libdl environments.
--- meta/recipes-core/glibc/glibc-package.inc | 1 + 1 file changed, 1 insertion(+)
meta/recipes-core/glibc/glibc-package.inc +1 -0
@@ -122,6 +122,7 @@ do_install() { fi lnr ${D}${base_libdir}/libpthread.so.0 ${D}${libdir}/libpthread.so lnr ${D}${base_libdir}/librt.so.1 ${D}${libdir}/librt.so + lnr ${D}${base_libdir}/libdl.so.2 ${D}${libdir}/libdl.so } def get_libc_fpu_setting(bb, d):
Signature · 1 line
2.30.2
PATCH 2/5 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.
--- .../gcc/gcc-multilib-config.inc | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-)
meta/recipes-devtools/gcc/gcc-multilib-config.inc +15 -9
@@ -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'
Signature · 1 line
2.30.2
PATCH 3/5 gcc: also relocate the musl loader
In reply to Richard PurdieFrom: Ross Burton <[email protected]>
Alongside GLIBC and UCLIBC, also relocate the musl loader.
--- meta/recipes-devtools/gcc/gcc-multilib-config.inc | 8 ++++++++ 1 file changed, 8 insertions(+)
meta/recipes-devtools/gcc/gcc-multilib-config.inc +8 -0
@@ -120,6 +120,14 @@ python gcc_multilib_setup() { r'\1' + wrap_libdir(libdirx32) + r'\3'), (r'^(#define\s*UCLIBC_DYNAMIC_LINKER\b\s*)(\S+)(\s*\".*\")$', r'\1' + wrap_libdir(libdir32) + r'\3'), + (r'^(#define\s*MUSL_DYNAMIC_LINKER32\s*)(\S+)(\s*\".*\")$', + r'\1' + wrap_libdir(libdir32) + r'\3'), + (r'^(#define\s*MUSL_DYNAMIC_LINKER64\s*)(\S+)(\s*\".*\")$', + r'\1' + wrap_libdir(libdir64) + r'\3'), + (r'^(#define\s*MUSL_DYNAMIC_LINKERX32\s*)(\S+)(\s*\".*\")$', + r'\1' + wrap_libdir(libdirx32) + r'\3'), + (r'^(#define\s*MUSL_DYNAMIC_LINKER\b\s*)(\S+)(\s*\".*\")$', + r'\1' + wrap_libdir(libdir32) + r'\3'), ] for (i, line) in enumerate(filelines):
Signature · 1 line
2.30.2
PATCH 4/5 pseudo: Fix to work with glibc 2.34 systems
In reply to Richard PurdieThe merge of libdl into libc in glibc 2.34 causes problems for pseudo. Add a fix that works around this issue.
--- .../pseudo/files/glibc234.patch | 86 +++++++++++++++++++ meta/recipes-devtools/pseudo/pseudo_git.bb | 1 + 2 files changed, 87 insertions(+) create mode 100644 meta/recipes-devtools/pseudo/files/glibc234.patch
meta/recipes-devtools/pseudo/files/glibc234.patch new file +86 -0
@@ -0,0 +1,86 @@ +pseudo_wrappers/pseudo_util: Add versioning to dl* symbols to work with glibc 2.34 + +From glibc 2.34 onwards, libdl is merged into libc. We need to work with libaries +linked with older libc and newer ones without requiring glibc 2.34 to be linked +in. To do this, use an older verison of the symbols. Sadly this is highly arch +specific. + +Upstream-Status: Pending +Signed-off-by: Richard Purdie <[email protected]> + +Index: git/pseudo_util.c +=================================================================== +--- git.orig/pseudo_util.c ++++ git/pseudo_util.c +@@ -28,6 +28,11 @@ + #include "pseudo.h" + #include "pseudo_ipc.h" + #include "pseudo_db.h" ++#include "pseudo_dlsymvers.h" ++ ++#if defined(__GLIBC__) ++__asm__(".symver dlsym,dlsym@GLIBC_" DLSYMVER); ++#endif + + struct pseudo_variables { + char *key; +Index: git/pseudo_wrappers.c +=================================================================== +--- git.orig/pseudo_wrappers.c ++++ git/pseudo_wrappers.c +@@ -28,6 +28,7 @@ + + /* include this to get PSEUDO_PORT_* definitions */ + #include "pseudo.h" ++#include "pseudo_dlsymvers.h" + + /* used for various specific function arguments */ + #include <dirent.h> +@@ -122,6 +123,12 @@ pseudo_reinit_libpseudo(void) { + _libpseudo_init(); + } + ++#if defined(__GLIBC__) ++__asm__(".symver dlerror,dlerror@GLIBC_" DLSYMVER); ++__asm__(".symver dlvsym,dlvsym@GLIBC_" DLVSYMVER); ++__asm__(".symver dlsym,dlsym@GLIBC_" DLSYMVER); ++#endif ++ + static void + pseudo_init_one_wrapper(pseudo_function *func) { + int (*f)(void) = (int (*)(void)) NULL; +Index: git/pseudo_dlsymvers.h +=================================================================== +--- /dev/null ++++ git/pseudo_dlsymvers.h +@@ -0,0 +1,30 @@ ++/* ++ * Copyright (c) 2021 Richard Purdie ++ * ++ * SPDX-License-Identifier: LGPL-2.1-only ++ * ++ */ ++ ++/* We need to use the older symbols in libdl.so rather than the newer ones ++ merged into libc.so in glibc 2.34 onwards since libpseudo needs to link/work ++ with newer libcs and bianries compiles with older ones */ ++ ++#if defined(__GLIBC__) ++#if defined(__aarch64__) ++#define DLSYMVER "2.17" ++#define DLVSYMVER "2.17" ++#elif defined(__x86_64__) ++#define DLSYMVER "2.2.5" ++#define DLVSYMVER "2.2.5" ++#elif defined(__arm__) ++#define DLSYMVER "2.4" ++#define DLVSYMVER "2.4" ++#elif defined(__mips__) ++#define DLSYMVER "2.0" ++#define DLVSYMVER "2.2" ++#else ++#define DLSYMVER "2.0" ++#define DLVSYMVER "2.1" ++#endif ++#endif ++
meta/recipes-devtools/pseudo/pseudo_git.bb +1 -0
@@ -2,6 +2,7 @@ require pseudo.inc SRC_URI = "git://git.yoctoproject.org/pseudo;branch=oe-core \ file://0001-configure-Prune-PIE-flags.patch \ + file://glibc234.patch \ file://fallback-passwd \ file://fallback-group \ "
Signature · 1 line
2.30.2
Re: [OE-core] [PATCH 4/5] pseudo: Fix to work with glibc 2.34 systems
Quoted 3 lines · Richard Purdie
The merge of libdl into libc in glibc 2.34 causes problems for pseudo. Add a fix
that works around this issue.
I have made an incremental change which fixes the build failures on rv32/rv64
Quoted 127 lines
Signed-off-by Richard Purdie <[email protected]>--- .../pseudo/files/glibc234.patch | 86 +++++++++++++++++++ meta/recipes-devtools/pseudo/pseudo_git.bb | 1 + 2 files changed, 87 insertions(+) create mode 100644 meta/recipes-devtools/pseudo/files/glibc234.patchmeta/recipes-devtools/pseudo/files/glibc234.patch new file +1
-0@@ -0,0 +1,86 @@ +pseudo_wrappers/pseudo_util: Add versioning to dl* symbols to work withglibc 2.34
meta/recipes-devtools/pseudo/files/glibc234.patch new file +2
-0+ +From glibc 2.34 onwards, libdl is merged into libc. We need to work withlibaries
+linked with older libc and newer ones without requiring glibc 2.34 to be linked
+in. To do this, use an older verison of the symbols. Sadly this is highly archmeta/recipes-devtools/pseudo/files/glibc234.patch new file +59
-0+specific. + +Upstream-Status: Pending +Signed-off-by: Richard Purdie <[email protected]> + +Index: git/pseudo_util.c +=================================================================== +--- git.orig/pseudo_util.c ++++ git/pseudo_util.c +@@ -28,6 +28,11 @@ + #include "pseudo.h" + #include "pseudo_ipc.h" + #include "pseudo_db.h" ++#include "pseudo_dlsymvers.h" ++ ++#if defined(__GLIBC__) ++__asm__(".symver dlsym,dlsym@GLIBC_" DLSYMVER); ++#endif + + struct pseudo_variables { + char *key; +Index: git/pseudo_wrappers.c +=================================================================== +--- git.orig/pseudo_wrappers.c ++++ git/pseudo_wrappers.c +@@ -28,6 +28,7 @@ + + /* include this to get PSEUDO_PORT_* definitions */ + #include "pseudo.h" ++#include "pseudo_dlsymvers.h" + + /* used for various specific function arguments */ + #include <dirent.h> +@@ -122,6 +123,12 @@ pseudo_reinit_libpseudo(void) { + _libpseudo_init(); + } + ++#if defined(__GLIBC__) ++__asm__(".symver dlerror,dlerror@GLIBC_" DLSYMVER); ++__asm__(".symver dlvsym,dlvsym@GLIBC_" DLVSYMVER); ++__asm__(".symver dlsym,dlsym@GLIBC_" DLSYMVER); ++#endif ++ + static void + pseudo_init_one_wrapper(pseudo_function *func) { + int (*f)(void) = (int (*)(void)) NULL; +Index: git/pseudo_dlsymvers.h +=================================================================== +--- /dev/null ++++ git/pseudo_dlsymvers.h +@@ -0,0 +1,30 @@ ++/* ++ * Copyright (c) 2021 Richard Purdie ++ * ++ * SPDX-License-Identifier: LGPL-2.1-only ++ * ++ */ ++ ++/* We need to use the older symbols in libdl.so rather than the newerones
++ merged into libc.so in glibc 2.34 onwards since libpseudo needs to
link/work
++ with newer libcs and bianries compiles with older ones */
++
++#ifdefined(__GLIBC__)
++#ifdefined(__aarch64__)
++#define DLSYMVER "2.17"
++#define DLVSYMVER "2.17"
++#elifdefined(__x86_64__)
++#define DLSYMVER "2.2.5"
++#define DLVSYMVER "2.2.5"
++#elifdefined(__arm__)
++#define DLSYMVER "2.4"
++#define DLVSYMVER "2.4"
++#elifdefined(__mips__)
++#define DLSYMVER "2.0"
++#define DLVSYMVER "2.2"
++#else
++#define DLSYMVER "2.0"
++#define DLVSYMVER "2.1"
++#endif
++#endif
++meta/recipes-devtools/pseudo/pseudo_git.bb +1
-1@@ -2,6 +2,7 @@ require pseudo.inc SRC_URI = "git://git.yoctoproject.org/pseudo;branch=oe-core \ file://0001-configure-Prune-PIE-flags.patch \ + file://glibc234.patch \ file://fallback-passwd \ file://fallback-group \ " --2.30.2
PATCH 5/5 elfutils: Fix ptest dependencies
In reply to Richard PurdieThe elfutils ptests require debug symbols for the libc to be available, else we see failures such as those on the autobuilder for the fast ptest image on arm (the dbg symbols are pulled in by other recipes in other images).
Also fix various test skips/error messages due to missing gcc/ld and development headers.
--- meta/recipes-devtools/elfutils/elfutils_0.185.bb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
meta/recipes-devtools/elfutils/elfutils_0.185.bb +3 -2
@@ -50,11 +50,12 @@ PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd" PACKAGECONFIG[libdebuginfod] = "--enable-libdebuginfod,--disable-libdebuginfod,curl" PACKAGECONFIG[debuginfod] = "--enable-debuginfod,--disable-debuginfod,libarchive sqlite3 libmicrohttpd" -RDEPENDS:${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils iproute2-ss bsdtar" +RDEPENDS:${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils iproute2-ss bsdtar gcc-symlinks binutils-symlinks libgcc-dev" EXTRA_OECONF:append:class-target = " --disable-tests-rpath" -RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils" +RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils glibc-dbg glibc-dev" +INSANE_SKIP:${PN}-ptest = "debug-deps dev-deps" do_compile_ptest() { cd ${B}/tests
Signature · 1 line
2.30.2
Re: [OE-core] [PATCH 5/5] elfutils: Fix ptest dependencies
I think this is breaking meta-gpl2 somehow?
https://autobuilder.yoctoproject.org/typhoon/#/builders/75/builds/3855
Alex
Quoted 45 lines · Richard Purdie
The elfutils ptests require debug symbols for the libc to be available, else
we see failures such as those on the autobuilder for the fast ptest image on arm (the dbg symbols are pulled in by other recipes in other images).Also fix various test skips/error messages due to missing gcc/ld and development headers.
Signed-off-by Richard Purdie <[email protected]>--- meta/recipes-devtools/elfutils/elfutils_0.185.bb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)meta/recipes-devtools/elfutils/elfutils_0.185.bb +0
-0@@ -50,11 +50,12 @@ PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd" PACKAGECONFIG[libdebuginfod] ="--enable-libdebuginfod,--disable-libdebuginfod,curl"
PACKAGECONFIG[debuginfod] =
"--enable-debuginfod,--disable-debuginfod,libarchive sqlite3 libmicrohttpd"-RDEPENDS:${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils iproute2-ss bsdtar"
+RDEPENDS:${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils iproute2-ss bsdtar gcc-symlinks binutils-symlinks libgcc-dev"EXTRA_OECONF:append:class-target = " --disable-tests-rpath"
meta/recipes-devtools/elfutils/elfutils_0.185.bb +1
-1-RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils" +RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils glibc-dbgglibc-dev"
+INSANE_SKIP:${PN}-ptest = "debug-deps dev-deps"do_compile_ptest() { cd ${B}/tests--
2.30.2
Re: [OE-core] [PATCH 5/5] elfutils: Fix ptest dependencies
Quoted 3 lines · Alexander Kanavin
I think this is breaking meta-gpl2 somehow?
https://autobuilder.yoctoproject.org/typhoon/#/builders/75/builds/3855
Yes, there are also fixes pending for it which have now merged.
I'm getting more than a little jaded fixing that layer as I really dislike what it is doing and believe it does need to be dropped. The biggest problem is the bash shell, if we had a solution for that I think the rest can be managed.
Cheers,
Richard
Re: [OE-core] [PATCH 5/5] elfutils: Fix ptest dependencies
Then let’s just go for it. I think there are enough examples on how to make gpl3 free images without it, and mbition has a full infotainment build based on recent master with no gpl3 and no meta-gpl2. It’s doable and highly overdue.
Ale
Quoted 18 lines · Richard Purdie
Quoted 3 lines · Alexander Kanavin
I think this is breaking meta-gpl2 somehow?
https://autobuilder.yoctoproject.org/typhoon/#/builders/75/builds/3855
Yes, there are also fixes pending for it which have now merged.
I'm getting more than a little jaded fixing that layer as I really dislike what
it is doing and believe it does need to be dropped. The biggest problem is the
bash shell, if we had a solution for that I think the rest can be managed.Cheers,
Richard
Re: [OE-core] [PATCH 5/5] elfutils: Fix ptest dependencies
Quoted 1 line · Alexander Kanavin
Then let’s just go for it.
It isn't that simple. There are member organisations who care about this and would not be happy at that approach. We're probably talking a load of meetings and discussion and a need to provide documentation/solutions and debug issues. There will be a request to do this with a notice period, probably a couple of years. I suspect a chunk will fall to me as I'm the only person officially able to have tasks assigned and nobody else will want to do it. I guess that is why I end up fixing it as there are other things that need the time more urgently.
Quoted 3 lines
I think there are enough examples on how to make gpl3 free images without it, and mbition has a full infotainment build based on recent master with no gpl3 and no meta-gpl2. It’s doable and highly overdue.
That doesn't solve the bash issue. Yes, it works if you can remove any bash script from your target image.
Cheers,
Richard
Re: [OE-core] [PATCH 5/5] elfutils: Fix ptest dependencies
Quoted 10 lines
Quoted 2 lines
I think there are enough examples on how to make gpl3 free images
without it,
Quoted 1 line
and mbition has a full infotainment build based on recent master with no
gpl3
Quoted 1 line
and no meta-gpl2. It’s doable and highly overdue.
That doesn't solve the bash issue. Yes, it works if you can remove any bash script from your target image.
FWIW in LGE we're using busybox/defconfig:CONFIG_BASH_IS_ASH=y and then replacing runtime dependency on bash (as /bin/bash rprovider) with busybox, this is a bit PITA with many bbappends, but works.
https://github.com/webosose/meta-webosose/commit/d0b237b70264e269f75303a11c43b2eea25de991
Re: [OE-core] [PATCH 5/5] elfutils: Fix ptest dependencies
In reply to Richard PurdieQuoted 18 lines · Richard Purdie
Quoted 1 line · Alexander Kanavin
Then let’s just go for it.
It isn't that simple. There are member organisations who care about this and
would not be happy at that approach. We're probably talking a load of meetings
and discussion and a need to provide documentation/solutions and debug issues.
There will be a request to do this with a notice period, probably a couple of
years. I suspect a chunk will fall to me as I'm the only person officially able
to have tasks assigned and nobody else will want to do it. I guess that is why I
end up fixing it as there are other things that need the time more urgently.
Is the following realistic?
- meta-gpl2 is maintained in master builds until the next LTS is out in April 2022
- thereafter it is maintained only in that LTS release, until (at least) April 2024
- if, at that point, someone still has products where the bash problem is not resolved,
it is not unreasonable to ask that they copy the old bash recipe to their private layer
and maintain it there for themselves.
Quoted 9 lines
Quoted 1 line
I think there are enough examples on how to make gpl3 free images
without it,
Quoted 1 line
and mbition has a full infotainment build based on recent master with no
gpl3
Quoted 1 line
and no meta-gpl2. It’s doable and highly overdue.
That doesn't solve the bash issue. Yes, it works if you can remove any bash script from your target image.
I suspect the problem becomes easier once member organizations enforce no-gpl
only for the images that ship to customers with the HW. Test and developer images that never leave
the organization or its subcontractors (that can reflash the target HW) can do as they please.
Alex