diff options
Diffstat (limited to 'poky/meta/recipes-devtools/elfutils')
-rw-r--r-- | poky/meta/recipes-devtools/elfutils/elfutils_0.185.bb | 47 | ||||
-rw-r--r-- | poky/meta/recipes-devtools/elfutils/files/glibc-2.34-fix.patch | 138 |
2 files changed, 162 insertions, 23 deletions
diff --git a/poky/meta/recipes-devtools/elfutils/elfutils_0.185.bb b/poky/meta/recipes-devtools/elfutils/elfutils_0.185.bb index b1ffbc18b..5031ab97e 100644 --- a/poky/meta/recipes-devtools/elfutils/elfutils_0.185.bb +++ b/poky/meta/recipes-devtools/elfutils/elfutils_0.185.bb @@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ file://debuginfod/debuginfod-client.c;endline=27;md5=f8e9d171c401c493ec45a0b2992ea2ed \ " DEPENDS = "zlib virtual/libintl" -DEPENDS_append_libc-musl = " argp-standalone fts musl-obstack " +DEPENDS:append:libc-musl = " argp-standalone fts musl-obstack " # The Debian patches below are from: # http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.176-1.debian.tar.xz SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \ @@ -22,8 +22,9 @@ SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \ file://ptest.patch \ file://0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch \ file://0001-debuginfod-debuginfod-client.c-correct-string-format.patch \ + file://glibc-2.34-fix.patch \ " -SRC_URI_append_libc-musl = " \ +SRC_URI:append:libc-musl = " \ file://0002-musl-libs.patch \ file://0003-musl-utils.patch \ file://0004-Fix-error-on-musl.patch \ @@ -36,7 +37,7 @@ inherit autotools gettext ptest pkgconfig EXTRA_OECONF = "--program-prefix=eu-" DEPENDS_BZIP2 = "bzip2-replacement-native" -DEPENDS_BZIP2_class-target = "bzip2" +DEPENDS_BZIP2:class-target = "bzip2" PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'debuginfod', 'debuginfod libdebuginfod', '', d)}" PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,${DEPENDS_BZIP2}" @@ -44,11 +45,11 @@ PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz" 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" -EXTRA_OECONF_append_class-target = " --disable-tests-rpath" +EXTRA_OECONF:append:class-target = " --disable-tests-rpath" -RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils" +RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils" do_compile_ptest() { cd ${B}/tests @@ -92,8 +93,8 @@ do_install_ptest() { fi } -EXTRA_OEMAKE_class-native = "" -EXTRA_OEMAKE_class-nativesdk = "" +EXTRA_OEMAKE:class-native = "" +EXTRA_OEMAKE:class-nativesdk = "" BBCLASSEXTEND = "native nativesdk" @@ -105,14 +106,14 @@ PACKAGES =+ "${PN}-binutils libelf libasm libdw libdebuginfod" # "The license is now GPLv2/LGPLv3+ for the libraries and GPLv3+ for stand-alone # programs. There is now also a formal CONTRIBUTING document describing how to # submit patches." -LICENSE_${PN}-binutils = "GPLv3+" -LICENSE_${PN} = "GPLv3+" -LICENSE_libelf = "GPLv2 | LGPLv3+" -LICENSE_libasm = "GPLv2 | LGPLv3+" -LICENSE_libdw = "GPLv2 | LGPLv3+" -LICENSE_libdebuginfod = "GPLv2+ | LGPLv3+" - -FILES_${PN}-binutils = "\ +LICENSE:${PN}-binutils = "GPLv3+" +LICENSE:${PN} = "GPLv3+" +LICENSE:libelf = "GPLv2 | LGPLv3+" +LICENSE:libasm = "GPLv2 | LGPLv3+" +LICENSE:libdw = "GPLv2 | LGPLv3+" +LICENSE:libdebuginfod = "GPLv2+ | LGPLv3+" + +FILES:${PN}-binutils = "\ ${bindir}/eu-addr2line \ ${bindir}/eu-ld \ ${bindir}/eu-nm \ @@ -120,19 +121,19 @@ FILES_${PN}-binutils = "\ ${bindir}/eu-size \ ${bindir}/eu-strip" -FILES_libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*" -FILES_libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*" -FILES_libdw = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils/lib*" -FILES_libdebuginfod = "${libdir}/libdebuginfod-${PV}.so ${libdir}/libdebuginfod.so.*" +FILES:libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*" +FILES:libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*" +FILES:libdw = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils/lib*" +FILES:libdebuginfod = "${libdir}/libdebuginfod-${PV}.so ${libdir}/libdebuginfod.so.*" # Some packages have the version preceeding the .so instead properly # versioned .so.<version>, so we need to reorder and repackage. #FILES_${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so" #FILES_SOLIBSDEV = "${libdir}/libasm.so ${libdir}/libdw.so ${libdir}/libelf.so" # The package contains symlinks that trip up insane -INSANE_SKIP_${MLPREFIX}libdw = "dev-so" +INSANE_SKIP:${MLPREFIX}libdw = "dev-so" # The nlist binary in the tests uses explicitly minimal compiler flags -INSANE_SKIP_${PN}-ptest += "ldflags" +INSANE_SKIP:${PN}-ptest += "ldflags" # avoid stripping some generated binaries otherwise some of the tests such as test-nlist, # run-strip-reloc.sh, run-strip-strmerge.sh and so on will fail @@ -161,4 +162,4 @@ INHIBIT_PACKAGE_STRIP_FILES = "\ ${PKGD}${PTEST_PATH}/backends/libebl_x86_64.so \ " -PRIVATE_LIBS_${PN}-ptest = "libdw.so.1 libelf.so.1 libasm.so.1 libdebuginfod.so.1" +PRIVATE_LIBS:${PN}-ptest = "libdw.so.1 libelf.so.1 libasm.so.1 libdebuginfod.so.1" diff --git a/poky/meta/recipes-devtools/elfutils/files/glibc-2.34-fix.patch b/poky/meta/recipes-devtools/elfutils/files/glibc-2.34-fix.patch new file mode 100644 index 000000000..9509fb4e7 --- /dev/null +++ b/poky/meta/recipes-devtools/elfutils/files/glibc-2.34-fix.patch @@ -0,0 +1,138 @@ +glibc 2.34 calls pthread_kill from the raise function. Before raise +directly called the (tg)kill syscall. So allow pthread_kill to be the +first frame in a backtrace where raise is expected. Also change some +asserts to fprintf plus abort to make it more clear why the testcase +fails. + +https://sourceware.org/bugzilla/show_bug.cgi?id=28190 + +Signed-off-by: Mark Wielaard <mark@klomp.org> +Upstream-Status: Submitted [https://sourceware.org/pipermail/elfutils-devel/2021q3/004019.html] +--- + tests/ChangeLog | 6 +++++ + tests/backtrace.c | 62 +++++++++++++++++++++++++++++++++++++++++------ + 2 files changed, 61 insertions(+), 7 deletions(-) + +Index: elfutils-0.185/tests/ChangeLog +=================================================================== +--- elfutils-0.185.orig/tests/ChangeLog ++++ elfutils-0.185/tests/ChangeLog +@@ -1,3 +1,9 @@ ++2021-08-04 Mark Wielaard <mark@klomp.org> ++ ++ PR28190 ++ * backtrace.c (callback_verify): Check for pthread_kill as first ++ frame. Change asserts to fprintf plus abort. ++ + 2021-05-14 Frank Ch. Eigler <fche@redhat.com> + + PR27859 +Index: elfutils-0.185/tests/backtrace.c +=================================================================== +--- elfutils-0.185.orig/tests/backtrace.c ++++ elfutils-0.185/tests/backtrace.c +@@ -97,6 +97,9 @@ callback_verify (pid_t tid, unsigned fra + static bool reduce_frameno = false; + if (reduce_frameno) + frameno--; ++ static bool pthread_kill_seen = false; ++ if (pthread_kill_seen) ++ frameno--; + if (! use_raise_jmp_patching && frameno >= 2) + frameno += 2; + const char *symname2 = NULL; +@@ -107,11 +110,26 @@ callback_verify (pid_t tid, unsigned fra + && (strcmp (symname, "__kernel_vsyscall") == 0 + || strcmp (symname, "__libc_do_syscall") == 0)) + reduce_frameno = true; ++ else if (! pthread_kill_seen && symname ++ && strstr (symname, "pthread_kill") != NULL) ++ pthread_kill_seen = true; + else +- assert (symname && strcmp (symname, "raise") == 0); ++ { ++ if (!symname || strcmp (symname, "raise") != 0) ++ { ++ fprintf (stderr, ++ "case 0: expected symname 'raise' got '%s'\n", symname); ++ abort (); ++ } ++ } + break; + case 1: +- assert (symname != NULL && strcmp (symname, "sigusr2") == 0); ++ if (symname == NULL || strcmp (symname, "sigusr2") != 0) ++ { ++ fprintf (stderr, ++ "case 1: expected symname 'sigusr2' got '%s'\n", symname); ++ abort (); ++ } + break; + case 2: // x86_64 only + /* __restore_rt - glibc maybe does not have to have this symbol. */ +@@ -120,11 +138,21 @@ callback_verify (pid_t tid, unsigned fra + if (use_raise_jmp_patching) + { + /* Verify we trapped on the very first instruction of jmp. */ +- assert (symname != NULL && strcmp (symname, "jmp") == 0); ++ if (symname == NULL || strcmp (symname, "jmp") != 0) ++ { ++ fprintf (stderr, ++ "case 3: expected symname 'raise' got '%s'\n", symname); ++ abort (); ++ } + mod = dwfl_addrmodule (dwfl, pc - 1); + if (mod) + symname2 = dwfl_module_addrname (mod, pc - 1); +- assert (symname2 == NULL || strcmp (symname2, "jmp") != 0); ++ if (symname2 == NULL || strcmp (symname2, "jmp") != 0) ++ { ++ fprintf (stderr, ++ "case 3: expected symname2 'jmp' got '%s'\n", symname2); ++ abort (); ++ } + break; + } + FALLTHROUGH; +@@ -137,11 +165,22 @@ callback_verify (pid_t tid, unsigned fra + duplicate_sigusr2 = true; + break; + } +- assert (symname != NULL && strcmp (symname, "stdarg") == 0); ++ if (symname == NULL || strcmp (symname, "stdarg") != 0) ++ { ++ fprintf (stderr, ++ "case 4: expected symname 'stdarg' got '%s'\n", symname); ++ abort (); ++ } + break; + case 5: + /* Verify we trapped on the very last instruction of child. */ +- assert (symname != NULL && strcmp (symname, "backtracegen") == 0); ++ if (symname == NULL || strcmp (symname, "backtracegen") != 0) ++ { ++ fprintf (stderr, ++ "case 5: expected symname 'backtracegen' got '%s'\n", ++ symname); ++ abort (); ++ } + mod = dwfl_addrmodule (dwfl, pc); + if (mod) + symname2 = dwfl_module_addrname (mod, pc); +@@ -151,7 +190,15 @@ callback_verify (pid_t tid, unsigned fra + // instructions or even inserts some padding instructions at the end + // (which apparently happens on ppc64). + if (use_raise_jmp_patching) +- assert (symname2 == NULL || strcmp (symname2, "backtracegen") != 0); ++ { ++ if (symname2 != NULL && strcmp (symname2, "backtracegen") == 0) ++ { ++ fprintf (stderr, ++ "use_raise_jmp_patching didn't expect symname2 " ++ "'backtracegen'\n"); ++ abort (); ++ } ++ } + break; + } + } |