From e2848469adc841299c9067ba8183b3a7c0c20b57 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Tue, 14 Jan 2020 14:59:57 +0100 Subject: elfutils: upgrade 0.177 -> 0.178 Remove 0007-Fix-control-path-where-we-have-str-as-uninitialized-.patch as issue fixed upstream. Rebase other patches. Adjust ptests, pass rate is now 100% again: ====================== All 206 tests passed (6 tests were not run) ====================== (From OE-Core rev: dce25738c82335f2a92b32bd52f0c63e2dbd336e) Signed-off-by: Alexander Kanavin Signed-off-by: Richard Purdie --- meta/recipes-devtools/elfutils/elfutils_0.177.bb | 155 ------------------- meta/recipes-devtools/elfutils/elfutils_0.178.bb | 160 ++++++++++++++++++++ .../elfutils/files/0001-dso-link-change.patch | 12 +- ...0001-libasm-may-link-with-libbz2-if-found.patch | 8 +- .../elfutils/files/0001-musl-obstack-fts.patch | 127 ++++++++++++++++ .../elfutils/files/0002-musl-libs.patch | 145 ++++++++++++++++++ .../elfutils/files/0003-musl-utils.patch | 166 +++++++++++++++++++++ .../elfutils/files/0004-Fix-error-on-musl.patch | 39 +++++ ...-path-where-we-have-str-as-uninitialized-.patch | 42 ------ .../elfutils/files/debian/hppa_backend.diff | 51 +++---- .../elfutils/files/debian/mips_backend.diff | 85 ++++++----- .../elfutils/files/debian/mips_cfi.patch | 22 ++- .../elfutils/files/musl-libs.patch | 144 ------------------ .../elfutils/files/musl-obstack-fts.patch | 128 ---------------- .../elfutils/files/musl-tests.patch | 29 ---- .../elfutils/files/musl-utils.patch | 165 -------------------- 16 files changed, 727 insertions(+), 751 deletions(-) delete mode 100644 meta/recipes-devtools/elfutils/elfutils_0.177.bb create mode 100644 meta/recipes-devtools/elfutils/elfutils_0.178.bb create mode 100644 meta/recipes-devtools/elfutils/files/0001-musl-obstack-fts.patch create mode 100644 meta/recipes-devtools/elfutils/files/0002-musl-libs.patch create mode 100644 meta/recipes-devtools/elfutils/files/0003-musl-utils.patch create mode 100644 meta/recipes-devtools/elfutils/files/0004-Fix-error-on-musl.patch delete mode 100644 meta/recipes-devtools/elfutils/files/0007-Fix-control-path-where-we-have-str-as-uninitialized-.patch delete mode 100644 meta/recipes-devtools/elfutils/files/musl-libs.patch delete mode 100644 meta/recipes-devtools/elfutils/files/musl-obstack-fts.patch delete mode 100644 meta/recipes-devtools/elfutils/files/musl-tests.patch delete mode 100644 meta/recipes-devtools/elfutils/files/musl-utils.patch diff --git a/meta/recipes-devtools/elfutils/elfutils_0.177.bb b/meta/recipes-devtools/elfutils/elfutils_0.177.bb deleted file mode 100644 index e7740c7fb4..0000000000 --- a/meta/recipes-devtools/elfutils/elfutils_0.177.bb +++ /dev/null @@ -1,155 +0,0 @@ -SUMMARY = "Utilities and libraries for handling compiled object files" -HOMEPAGE = "https://sourceware.org/elfutils" -SECTION = "base" -LICENSE = "GPLv2 & LGPLv3+ & GPLv3+" -LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" -DEPENDS = "zlib virtual/libintl" -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 \ - file://0001-dso-link-change.patch \ - file://0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch \ - file://0003-fixheadercheck.patch \ - file://0004-Disable-the-test-to-convert-euc-jp.patch \ - file://0006-Fix-build-on-aarch64-musl.patch \ - file://0007-Fix-control-path-where-we-have-str-as-uninitialized-.patch \ - file://0001-libasm-may-link-with-libbz2-if-found.patch \ - file://0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch \ - file://debian/hppa_backend.diff \ - file://debian/arm_backend.diff \ - file://debian/mips_backend.diff \ - file://debian/mips_readelf_w.patch \ - file://debian/kfreebsd_path.patch \ - file://debian/0001-Ignore-differences-between-mips-machine-identifiers.patch \ - file://debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch \ - file://debian/0003-Add-mips-n64-relocation-format-hack.patch \ - file://debian/hurd_path.patch \ - file://debian/ignore_strmerge.diff \ - file://debian/disable_werror.patch \ - file://debian/testsuite-ignore-elflint.diff \ - file://debian/mips_cfi.patch \ - file://debian/0001-fix-compile-failure-with-debian-patches.patch \ - file://0001-skip-the-test-when-gcc-not-deployed.patch \ - file://0001-ppc_initreg.c-Incliude-asm-ptrace.h-for-pt_regs-defi.patch \ - file://run-ptest \ - file://ptest.patch \ - " -SRC_URI_append_libc-musl = " \ - file://musl-obstack-fts.patch \ - file://musl-libs.patch \ - file://musl-utils.patch \ - file://musl-tests.patch \ - " -SRC_URI[md5sum] = "0b583722f911e1632544718d502aab87" -SRC_URI[sha256sum] = "fa489deccbcae7d8c920f60d85906124c1989c591196d90e0fd668e3dc05042e" - -inherit autotools gettext ptest - -EXTRA_OECONF = "--program-prefix=eu-" - -DEPENDS_BZIP2 = "bzip2-replacement-native" -DEPENDS_BZIP2_class-target = "bzip2" - -PACKAGECONFIG ??= "" -PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,${DEPENDS_BZIP2}" -PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz" - -RDEPENDS_${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils" - -EXTRA_OECONF_append_class-target += "--disable-tests-rpath" - -do_install_append() { - if [ "${TARGET_ARCH}" != "x86_64" ] && [ -z `echo "${TARGET_ARCH}"|grep 'i.86'` ];then - rm -f ${D}${bindir}/eu-objdump - fi -} - -do_compile_ptest() { - cd ${B}/tests - oe_runmake buildtest-TESTS oecheck -} - -do_install_ptest() { - if [ ${PTEST_ENABLED} = "1" ]; then - # copy the files which needed by the cases - TEST_FILES="strip strip.o addr2line elfcmp objdump readelf size.o nm.o nm elflint" - install -d -m 755 ${D}${PTEST_PATH}/src - install -d -m 755 ${D}${PTEST_PATH}/libelf - install -d -m 755 ${D}${PTEST_PATH}/libdw - for test_file in ${TEST_FILES}; do - if [ -f ${B}/src/${test_file} ]; then - cp -r ${B}/src/${test_file} ${D}${PTEST_PATH}/src - fi - done - cp ${D}${libdir}/libelf-${PV}.so ${D}${PTEST_PATH}/libelf/libelf.so - cp ${D}${libdir}/libdw-${PV}.so ${D}${PTEST_PATH}/libdw/libdw.so - cp -r ${S}/tests/ ${D}${PTEST_PATH} - cp -r ${B}/tests/* ${D}${PTEST_PATH}/tests - cp -r ${B}/config.h ${D}${PTEST_PATH} - cp -r ${B}/backends ${D}${PTEST_PATH} - sed -i '/^Makefile:/c Makefile:' ${D}${PTEST_PATH}/tests/Makefile - find ${D}${PTEST_PATH} -type f -name *.[hoc] | xargs -i rm {} - fi -} - -EXTRA_OEMAKE_class-native = "" -EXTRA_OEMAKE_class-nativesdk = "" - -BBCLASSEXTEND = "native nativesdk" - -# Package utilities separately -PACKAGES =+ "${PN}-binutils libelf libasm libdw" - -# shared libraries are licensed GPLv2 or GPLv3+, binaries GPLv3+ -# according to NEWS file: -# "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+" - -FILES_${PN}-binutils = "\ - ${bindir}/eu-addr2line \ - ${bindir}/eu-ld \ - ${bindir}/eu-nm \ - ${bindir}/eu-readelf \ - ${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*" -# Some packages have the version preceeding the .so instead properly -# versioned .so., 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" - -# 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 -INHIBIT_PACKAGE_STRIP_FILES = "\ - ${PKGD}${PTEST_PATH}/tests/test-nlist \ - ${PKGD}${PTEST_PATH}/tests/elfstrmerge \ - ${PKGD}${PTEST_PATH}/tests/backtrace-child \ - ${PKGD}${PTEST_PATH}/tests/backtrace-data \ - ${PKGD}${PTEST_PATH}/tests/deleted \ - ${PKGD}${PTEST_PATH}/src/strip \ - ${PKGD}${PTEST_PATH}/src/addr2line \ - ${PKGD}${PTEST_PATH}/src/elfcmp \ - ${PKGD}${PTEST_PATH}/src/objdump \ - ${PKGD}${PTEST_PATH}/src/readelf \ - ${PKGD}${PTEST_PATH}/src/nm \ - ${PKGD}${PTEST_PATH}/src/elflint \ - ${PKGD}${PTEST_PATH}/libelf/libelf.so \ - ${PKGD}${PTEST_PATH}/libdw/libdw.so \ - ${PKGD}${PTEST_PATH}/backends/libebl_i386.so \ - ${PKGD}${PTEST_PATH}/backends/libebl_x86_64.so \ -" - -PRIVATE_LIBS_${PN}-ptest = "libdw.so.1 libelf.so.1" diff --git a/meta/recipes-devtools/elfutils/elfutils_0.178.bb b/meta/recipes-devtools/elfutils/elfutils_0.178.bb new file mode 100644 index 0000000000..9393628dd1 --- /dev/null +++ b/meta/recipes-devtools/elfutils/elfutils_0.178.bb @@ -0,0 +1,160 @@ +SUMMARY = "Utilities and libraries for handling compiled object files" +HOMEPAGE = "https://sourceware.org/elfutils" +SECTION = "base" +LICENSE = "GPLv2 & LGPLv3+ & GPLv3+" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" +DEPENDS = "zlib virtual/libintl" +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 \ + file://0001-dso-link-change.patch \ + file://0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch \ + file://0003-fixheadercheck.patch \ + file://0004-Disable-the-test-to-convert-euc-jp.patch \ + file://0006-Fix-build-on-aarch64-musl.patch \ + file://0001-libasm-may-link-with-libbz2-if-found.patch \ + file://0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch \ + file://debian/hppa_backend.diff \ + file://debian/arm_backend.diff \ + file://debian/mips_backend.diff \ + file://debian/mips_readelf_w.patch \ + file://debian/kfreebsd_path.patch \ + file://debian/0001-Ignore-differences-between-mips-machine-identifiers.patch \ + file://debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch \ + file://debian/0003-Add-mips-n64-relocation-format-hack.patch \ + file://debian/hurd_path.patch \ + file://debian/ignore_strmerge.diff \ + file://debian/disable_werror.patch \ + file://debian/testsuite-ignore-elflint.diff \ + file://debian/mips_cfi.patch \ + file://debian/0001-fix-compile-failure-with-debian-patches.patch \ + file://0001-skip-the-test-when-gcc-not-deployed.patch \ + file://0001-ppc_initreg.c-Incliude-asm-ptrace.h-for-pt_regs-defi.patch \ + file://run-ptest \ + file://ptest.patch \ + " +SRC_URI_append_libc-musl = " \ + file://0001-musl-obstack-fts.patch \ + file://0002-musl-libs.patch \ + file://0003-musl-utils.patch \ + file://0004-Fix-error-on-musl.patch \ + " +SRC_URI[md5sum] = "5480d0b7174446aba13a6adde107287f" +SRC_URI[sha256sum] = "31e7a00e96d4e9c4bda452e1f2cdac4daf8abd24f5e154dee232131899f3a0f2" + +inherit autotools gettext ptest pkgconfig + +EXTRA_OECONF = "--program-prefix=eu- --disable-debuginfod" + +DEPENDS_BZIP2 = "bzip2-replacement-native" +DEPENDS_BZIP2_class-target = "bzip2" + +PACKAGECONFIG ??= "" +PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,${DEPENDS_BZIP2}" +PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz" + +RDEPENDS_${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils" + +EXTRA_OECONF_append_class-target += "--disable-tests-rpath" + +do_install_append() { + if [ "${TARGET_ARCH}" != "x86_64" ] && [ -z `echo "${TARGET_ARCH}"|grep 'i.86'` ];then + rm -f ${D}${bindir}/eu-objdump + fi +} + +do_compile_ptest() { + cd ${B}/tests + oe_runmake buildtest-TESTS oecheck +} + +do_install_ptest() { + if [ ${PTEST_ENABLED} = "1" ]; then + # copy the files which needed by the cases + TEST_FILES="strip strip.o addr2line elfcmp objdump readelf size.o nm.o nm elflint elfcompress elfclassify stack unstrip" + install -d -m 755 ${D}${PTEST_PATH}/src + install -d -m 755 ${D}${PTEST_PATH}/libelf + install -d -m 755 ${D}${PTEST_PATH}/libdw + install -d -m 755 ${D}${PTEST_PATH}/libasm + for test_file in ${TEST_FILES}; do + if [ -f ${B}/src/${test_file} ]; then + cp -r ${B}/src/${test_file} ${D}${PTEST_PATH}/src + fi + done + cp ${D}${libdir}/libelf-${PV}.so ${D}${PTEST_PATH}/libelf/libelf.so + cp ${D}${libdir}/libdw-${PV}.so ${D}${PTEST_PATH}/libdw/libdw.so + cp ${D}${libdir}/libasm-${PV}.so ${D}${PTEST_PATH}/libasm/libasm.so + cp -r ${S}/tests/ ${D}${PTEST_PATH} + cp -r ${B}/tests/* ${D}${PTEST_PATH}/tests + cp -r ${B}/config.h ${D}${PTEST_PATH} + cp -r ${B}/backends ${D}${PTEST_PATH} + sed -i '/^Makefile:/c Makefile:' ${D}${PTEST_PATH}/tests/Makefile + find ${D}${PTEST_PATH} -type f -name *.[hoc] | xargs -i rm {} + fi +} + +EXTRA_OEMAKE_class-native = "" +EXTRA_OEMAKE_class-nativesdk = "" + +BBCLASSEXTEND = "native nativesdk" + +# Package utilities separately +PACKAGES =+ "${PN}-binutils libelf libasm libdw" + +# shared libraries are licensed GPLv2 or GPLv3+, binaries GPLv3+ +# according to NEWS file: +# "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+" + +FILES_${PN}-binutils = "\ + ${bindir}/eu-addr2line \ + ${bindir}/eu-ld \ + ${bindir}/eu-nm \ + ${bindir}/eu-readelf \ + ${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*" +# Some packages have the version preceeding the .so instead properly +# versioned .so., 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" + +# 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 +INHIBIT_PACKAGE_STRIP_FILES = "\ + ${PKGD}${PTEST_PATH}/tests/test-nlist \ + ${PKGD}${PTEST_PATH}/tests/elfstrmerge \ + ${PKGD}${PTEST_PATH}/tests/backtrace-child \ + ${PKGD}${PTEST_PATH}/tests/backtrace-data \ + ${PKGD}${PTEST_PATH}/tests/deleted \ + ${PKGD}${PTEST_PATH}/src/strip \ + ${PKGD}${PTEST_PATH}/src/addr2line \ + ${PKGD}${PTEST_PATH}/src/elfcmp \ + ${PKGD}${PTEST_PATH}/src/objdump \ + ${PKGD}${PTEST_PATH}/src/readelf \ + ${PKGD}${PTEST_PATH}/src/nm \ + ${PKGD}${PTEST_PATH}/src/elflint \ + ${PKGD}${PTEST_PATH}/src/elfclassify \ + ${PKGD}${PTEST_PATH}/src/stack \ + ${PKGD}${PTEST_PATH}/src/unstrip \ + ${PKGD}${PTEST_PATH}/libelf/libelf.so \ + ${PKGD}${PTEST_PATH}/libdw/libdw.so \ + ${PKGD}${PTEST_PATH}/libasm/libasm.so \ + ${PKGD}${PTEST_PATH}/backends/libebl_i386.so \ + ${PKGD}${PTEST_PATH}/backends/libebl_x86_64.so \ +" + +PRIVATE_LIBS_${PN}-ptest = "libdw.so.1 libelf.so.1 libasm.so.1" diff --git a/meta/recipes-devtools/elfutils/files/0001-dso-link-change.patch b/meta/recipes-devtools/elfutils/files/0001-dso-link-change.patch index af79ef496d..62031073e3 100644 --- a/meta/recipes-devtools/elfutils/files/0001-dso-link-change.patch +++ b/meta/recipes-devtools/elfutils/files/0001-dso-link-change.patch @@ -1,4 +1,4 @@ -From b99aa12cf879ce200e03d75e543c7ab2dfa5503b Mon Sep 17 00:00:00 2001 +From ec9a7742734aae5417c0ebbffce66ac353e6cae7 Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Tue, 15 Aug 2017 17:10:57 +0800 Subject: [PATCH] dso link change @@ -23,10 +23,10 @@ Signed-off-by: Hongxu Jia 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am -index 2b1c0dc..9305b84 100644 +index e462e7d..ea1215b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am -@@ -44,7 +44,7 @@ libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl +@@ -45,7 +45,7 @@ libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) -ldl -lpthread libelf = ../libelf/libelf.a -lz else libasm = ../libasm/libasm.so @@ -34,12 +34,12 @@ index 2b1c0dc..9305b84 100644 +libdw = ../libdw/libdw.so $(zip_LIBS) $(libelf) $(libebl) -ldl libelf = ../libelf/libelf.so endif - libebl = ../libebl/libebl.a + libebl = ../libebl/libebl.a ../backends/libebl_backends.a ../libcpu/libcpu.a diff --git a/tests/Makefile.am b/tests/Makefile.am -index 1b0c7d3..bced19b 100644 +index eab4ae6..f59a01f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am -@@ -476,7 +476,7 @@ libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl +@@ -516,7 +516,7 @@ libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread libelf = ../libelf/libelf.a -lz libasm = ../libasm/libasm.a else diff --git a/meta/recipes-devtools/elfutils/files/0001-libasm-may-link-with-libbz2-if-found.patch b/meta/recipes-devtools/elfutils/files/0001-libasm-may-link-with-libbz2-if-found.patch index 0d533c8f10..73ead6d412 100644 --- a/meta/recipes-devtools/elfutils/files/0001-libasm-may-link-with-libbz2-if-found.patch +++ b/meta/recipes-devtools/elfutils/files/0001-libasm-may-link-with-libbz2-if-found.patch @@ -1,4 +1,4 @@ -From d7be687c35fa42954874034c82ca9059d28196fe Mon Sep 17 00:00:00 2001 +From 8e5fff8b1d819e0870fb22b27950bb5f10c7a272 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 4 Oct 2017 22:30:46 -0700 Subject: [PATCH] libasm may link with libbz2 if found @@ -17,16 +17,16 @@ Signed-off-by: Khem Raj 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am -index 9305b84..9b7e853 100644 +index ea1215b..13d9bda 100644 --- a/src/Makefile.am +++ b/src/Makefile.am -@@ -39,11 +39,11 @@ EXTRA_DIST += make-debug-archive.in +@@ -40,11 +40,11 @@ EXTRA_DIST += make-debug-archive.in CLEANFILES += make-debug-archive if BUILD_STATIC -libasm = ../libasm/libasm.a +libasm = ../libasm/libasm.a $(zip_LIBS) - libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl + libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) -ldl -lpthread libelf = ../libelf/libelf.a -lz else -libasm = ../libasm/libasm.so diff --git a/meta/recipes-devtools/elfutils/files/0001-musl-obstack-fts.patch b/meta/recipes-devtools/elfutils/files/0001-musl-obstack-fts.patch new file mode 100644 index 0000000000..f751a2ecdb --- /dev/null +++ b/meta/recipes-devtools/elfutils/files/0001-musl-obstack-fts.patch @@ -0,0 +1,127 @@ +From 8ccf3d92b8766b53f203df7e01b489604ef851f3 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Fri, 23 Aug 2019 10:17:25 +0800 +Subject: [PATCH 1/4] musl-obstack-fts + +Look for libfts and libobstack during configure, these +libraries are external to libc when using musl, whereas +on glibc these libraries are provided in libc itself. + +Signed-off-by: Khem Raj +Upstream-Status: Inappropriate [workaround for musl] + +Rebase to 0.177 +Signed-off-by: Hongxu Jia + +--- + configure.ac | 54 +++++++++++++++++++++++++++++++++++++++++++++++ + libdw/Makefile.am | 2 +- + src/Makefile.am | 6 +++--- + 3 files changed, 58 insertions(+), 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index cad7b2b..6d4229b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -529,6 +529,60 @@ else + fi + AC_SUBST([argp_LDADD]) + ++dnl Check if we have fts available from our libc ++AC_LINK_IFELSE( ++ [AC_LANG_PROGRAM( ++ [#if !defined(__x86_64__) ++ #undef _FILE_OFFSET_BITS ++ #define _FILE_OFFSET_BITS 32 ++ #endif ++ #include ], ++ [FTS* fts = 0; return fts_close(fts); return 0;] ++ )], ++ [libc_has_fts="true"], ++ [libc_has_fts="false"] ++) ++ ++dnl If our libc doesn't provide fts, then test for libfts ++if test "$libc_has_fts" = "false" ; then ++ AC_MSG_WARN("libc does not have fts") ++ AC_CHECK_LIB([fts], [fts_close], [have_fts="true"], [have_fts="false"]) ++ ++ if test "$have_fts" = "false"; then ++ AC_MSG_ERROR("no libfts found") ++ else ++ fts_LDADD="-lfts" ++ fi ++else ++ fts_LDADD="" ++fi ++AC_SUBST([fts_LDADD]) ++ ++dnl Check if we have obstack available from our libc ++AC_LINK_IFELSE( ++ [AC_LANG_PROGRAM( ++ [#include ], ++ [_obstack_begin(0, 0, 0, NULL, NULL); return 0;] ++ )], ++ [libc_has_obstack="true"], ++ [libc_has_obstack="false"] ++) ++ ++dnl If our libc doesn't provide obstack, then test for libobstack ++if test "$libc_has_obstack" = "false" ; then ++ AC_MSG_WARN("libc does not have obstack") ++ AC_CHECK_LIB([obstack], [_obstack_begin], [have_obstack="true"], [have_obstack="false"]) ++ ++ if test "$have_obstack" = "false"; then ++ AC_MSG_ERROR("no libobstack found") ++ else ++ obstack_LDADD="-lobstack" ++ fi ++else ++ obstack_LDADD="" ++fi ++AC_SUBST([obstack_LDADD]) ++ + dnl The directories with content. + + dnl Documentation. +diff --git a/libdw/Makefile.am b/libdw/Makefile.am +index 33b5838..ff92e02 100644 +--- a/libdw/Makefile.am ++++ b/libdw/Makefile.am +@@ -109,7 +109,7 @@ libdw_so_LIBS = ../libebl/libebl_pic.a ../backends/libebl_backends_pic.a \ + ../libcpu/libcpu_pic.a libdw_pic.a ../libdwelf/libdwelf_pic.a \ + ../libdwfl/libdwfl_pic.a + libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so +-libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(zip_LIBS) -pthread ++libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(fts_LDADD) $(zip_LIBS) -pthread + libdw_so_SOURCES = + libdw.so$(EXEEXT): $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS) + $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \ +diff --git a/src/Makefile.am b/src/Makefile.am +index 13d9bda..d5a4f7d 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -69,7 +69,7 @@ ar_no_Wstack_usage = yes + unstrip_no_Wstack_usage = yes + + readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) +-nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) \ ++nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) $(obstack_LDADD) \ + $(demanglelib) + size_LDADD = $(libelf) $(libeu) $(argp_LDADD) + strip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) +@@ -78,9 +78,9 @@ findtextrel_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) + addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(demanglelib) + elfcmp_LDADD = $(libebl) $(libdw) $(libelf) $(libeu) $(argp_LDADD) + objdump_LDADD = $(libasm) $(libebl) $(libdw) $(libelf) $(libeu) $(argp_LDADD) +-ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) ++ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LDADD) + strings_LDADD = $(libelf) $(libeu) $(argp_LDADD) +-ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) ++ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LDADD) + unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) + stack_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) $(demanglelib) + elfcompress_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) +-- +2.17.1 + diff --git a/meta/recipes-devtools/elfutils/files/0002-musl-libs.patch b/meta/recipes-devtools/elfutils/files/0002-musl-libs.patch new file mode 100644 index 0000000000..cf14683864 --- /dev/null +++ b/meta/recipes-devtools/elfutils/files/0002-musl-libs.patch @@ -0,0 +1,145 @@ +From ea908c7009de5a208383abf4bec4c6b3d9519ca3 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Fri, 23 Aug 2019 10:18:47 +0800 +Subject: [PATCH 2/4] musl-libs + +Collection of fixes needed to compile libelf and other libraries +provided by elfutils for musl targets + +error is glibc specific API, so this patch will mostly not accepted +upstream given that elfutils has been closely tied to glibc + +Signed-off-by: Khem Raj +Upstream-Status: Inappropriate [workaround for musl] + +Rebase to 0.177 +Signed-off-by: Hongxu Jia + +--- + lib/error.h | 27 +++++++++++++++++++++++++++ + lib/fixedsizehash.h | 1 - + lib/libeu.h | 1 + + libdwfl/dwfl_error.c | 9 +++++++++ + libdwfl/linux-kernel-modules.c | 1 + + libelf/elf.h | 9 ++++++--- + 6 files changed, 44 insertions(+), 4 deletions(-) + create mode 100644 lib/error.h + +diff --git a/lib/error.h b/lib/error.h +new file mode 100644 +index 0000000..ef06827 +--- /dev/null ++++ b/lib/error.h +@@ -0,0 +1,27 @@ ++#ifndef _ERROR_H_ ++#define _ERROR_H_ ++ ++#include ++#include ++#include ++#include ++#include ++ ++static unsigned int error_message_count = 0; ++ ++static inline void error(int status, int errnum, const char* format, ...) ++{ ++ va_list ap; ++ fprintf(stderr, "%s: ", program_invocation_name); ++ va_start(ap, format); ++ vfprintf(stderr, format, ap); ++ va_end(ap); ++ if (errnum) ++ fprintf(stderr, ": %s", strerror(errnum)); ++ fprintf(stderr, "\n"); ++ error_message_count++; ++ if (status) ++ exit(status); ++} ++ ++#endif /* _ERROR_H_ */ +diff --git a/lib/fixedsizehash.h b/lib/fixedsizehash.h +index dac2a5f..43016fc 100644 +--- a/lib/fixedsizehash.h ++++ b/lib/fixedsizehash.h +@@ -30,7 +30,6 @@ + #include + #include + #include +-#include + + #include + +diff --git a/lib/libeu.h b/lib/libeu.h +index ecb4d01..edc85e3 100644 +--- a/lib/libeu.h ++++ b/lib/libeu.h +@@ -29,6 +29,7 @@ + #ifndef LIBEU_H + #define LIBEU_H + ++#include "system.h" + #include + #include + +diff --git a/libdwfl/dwfl_error.c b/libdwfl/dwfl_error.c +index 7bcf61c..11dcc8b 100644 +--- a/libdwfl/dwfl_error.c ++++ b/libdwfl/dwfl_error.c +@@ -154,7 +154,16 @@ dwfl_errmsg (int error) + switch (error &~ 0xffff) + { + case OTHER_ERROR (ERRNO): ++#if defined(__GLIBC__) + return strerror_r (error & 0xffff, "bad", 0); ++#else ++ { ++ static __thread char buf[128] = ""; ++ if (strerror_r (error & 0xffff, buf, sizeof(buf)) == 0) ++ return buf; ++ } ++ return "strerror_r() failed"; ++#endif + case OTHER_ERROR (LIBELF): + return elf_errmsg (error & 0xffff); + case OTHER_ERROR (LIBDW): +diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c +index d46ab5a..1c3faee 100644 +--- a/libdwfl/linux-kernel-modules.c ++++ b/libdwfl/linux-kernel-modules.c +@@ -50,6 +50,7 @@ + #include + #include + #include ++#include "system.h" + + /* If fts.h is included before config.h, its indirect inclusions may not + give us the right LFS aliases of these functions, so map them manually. */ +diff --git a/libelf/elf.h b/libelf/elf.h +index bed273d..be228e6 100644 +--- a/libelf/elf.h ++++ b/libelf/elf.h +@@ -21,7 +21,9 @@ + + #include + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + + /* Standard ELF types. */ + +@@ -4029,6 +4031,7 @@ enum + #define R_NDS32_TLS_TPOFF 102 + #define R_NDS32_TLS_DESC 119 + +-__END_DECLS +- ++#ifdef __cplusplus ++} ++#endif + #endif /* elf.h */ +-- +2.17.1 + diff --git a/meta/recipes-devtools/elfutils/files/0003-musl-utils.patch b/meta/recipes-devtools/elfutils/files/0003-musl-utils.patch new file mode 100644 index 0000000000..79c9d9ad57 --- /dev/null +++ b/meta/recipes-devtools/elfutils/files/0003-musl-utils.patch @@ -0,0 +1,166 @@ +From 94028b16e56c8eef1aa02dcc4da268a0e471b4ea Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Fri, 23 Aug 2019 10:19:48 +0800 +Subject: [PATCH 3/4] musl-utils + +Provide missing defines which otherwise are available on glibc system headers + +Alter the error API to match posix version +use qsort instead of qsort_r which is glibc specific API + +Signed-off-by: Khem Raj +Upstream-Status: Inappropriate [workaround for musl] + +Rebase to 0.177 +Signed-off-by: Hongxu Jia + +--- + src/arlib.h | 6 ++++++ + src/elfcompress.c | 7 +++++++ + src/readelf.c | 20 ++++++++++++-------- + src/strip.c | 7 +++++++ + src/unstrip.c | 9 +++++++++ + 5 files changed, 41 insertions(+), 8 deletions(-) + +diff --git a/src/arlib.h b/src/arlib.h +index e117166..8326f6c 100644 +--- a/src/arlib.h ++++ b/src/arlib.h +@@ -29,6 +29,12 @@ + #include + #include + ++#if !defined(ALLPERMS) ++# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */ ++#endif ++#if !defined(DEFFILEMODE) ++# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 0666*/ ++#endif + + /* State of -D/-U flags. */ + extern bool arlib_deterministic_output; +diff --git a/src/elfcompress.c b/src/elfcompress.c +index 6ba6af4..0c7674b 100644 +--- a/src/elfcompress.c ++++ b/src/elfcompress.c +@@ -37,6 +37,13 @@ + #include "libeu.h" + #include "printversion.h" + ++#if !defined(ALLPERMS) ++# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */ ++#endif ++#if !defined(FNM_EXTMATCH) ++# define FNM_EXTMATCH (0) ++#endif ++ + /* Name and version of program. */ + ARGP_PROGRAM_VERSION_HOOK_DEF = print_version; + +diff --git a/src/readelf.c b/src/readelf.c +index 5994615..f3cc071 100644 +--- a/src/readelf.c ++++ b/src/readelf.c +@@ -4829,10 +4829,11 @@ listptr_base (struct listptr *p) + return cudie_base (&cu); + } + ++static const char *listptr_name; ++ + static int +-compare_listptr (const void *a, const void *b, void *arg) ++compare_listptr (const void *a, const void *b) + { +- const char *name = arg; + struct listptr *p1 = (void *) a; + struct listptr *p2 = (void *) b; + +@@ -4848,21 +4849,21 @@ compare_listptr (const void *a, const void *b, void *arg) + p1->warned = p2->warned = true; + error (0, 0, + gettext ("%s %#" PRIx64 " used with different address sizes"), +- name, (uint64_t) p1->offset); ++ listptr_name, (uint64_t) p1->offset); + } + if (p1->dwarf64 != p2->dwarf64) + { + p1->warned = p2->warned = true; + error (0, 0, + gettext ("%s %#" PRIx64 " used with different offset sizes"), +- name, (uint64_t) p1->offset); ++ listptr_name, (uint64_t) p1->offset); + } + if (listptr_base (p1) != listptr_base (p2)) + { + p1->warned = p2->warned = true; + error (0, 0, + gettext ("%s %#" PRIx64 " used with different base addresses"), +- name, (uint64_t) p1->offset); ++ listptr_name, (uint64_t) p1->offset); + } + if (p1->attr != p2 ->attr) + { +@@ -4870,7 +4871,7 @@ compare_listptr (const void *a, const void *b, void *arg) + error (0, 0, + gettext ("%s %#" PRIx64 + " used with different attribute %s and %s"), +- name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr), ++ listptr_name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr), + dwarf_attr_name (p2->attr)); + } + } +@@ -4942,8 +4943,11 @@ static void + sort_listptr (struct listptr_table *table, const char *name) + { + if (table->n > 0) +- qsort_r (table->table, table->n, sizeof table->table[0], +- &compare_listptr, (void *) name); ++ { ++ listptr_name = name; ++ qsort (table->table, table->n, sizeof table->table[0], ++ &compare_listptr); ++ } + } + + static bool +diff --git a/src/strip.c b/src/strip.c +index 4054c2a..d2d2176 100644 +--- a/src/strip.c ++++ b/src/strip.c +@@ -46,6 +46,13 @@ + #include + #include + ++#if !defined(ACCESSPERMS) ++# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */ ++#endif ++#if !defined(FNM_EXTMATCH) ++# define FNM_EXTMATCH (0) ++#endif ++ + typedef uint8_t GElf_Byte; + + /* Name and version of program. */ +diff --git a/src/unstrip.c b/src/unstrip.c +index 9b8c09a..1fb5063 100644 +--- a/src/unstrip.c ++++ b/src/unstrip.c +@@ -56,6 +56,15 @@ + # define _(str) gettext (str) + #endif + ++#ifndef strndupa ++#define strndupa(s, n) \ ++ ({const char *__in = (s); \ ++ size_t __len = strnlen (__in, (n)) + 1; \ ++ char *__out = (char *) alloca (__len); \ ++ __out[__len-1] = '\0'; \ ++ (char *) memcpy (__out, __in, __len-1);}) ++#endif ++ + /* Name and version of program. */ + ARGP_PROGRAM_VERSION_HOOK_DEF = print_version; + +-- +2.17.1 + diff --git a/meta/recipes-devtools/elfutils/files/0004-Fix-error-on-musl.patch b/meta/recipes-devtools/elfutils/files/0004-Fix-error-on-musl.patch new file mode 100644 index 0000000000..1b2f9ed98b --- /dev/null +++ b/meta/recipes-devtools/elfutils/files/0004-Fix-error-on-musl.patch @@ -0,0 +1,39 @@ +From 7ff8cbecde7455b530fa7894a78d2326799f2556 Mon Sep 17 00:00:00 2001 +From: Richard Purdie +Date: Wed, 1 May 2019 22:15:03 +0100 +Subject: [PATCH 4/4] Fix error on musl: + +| ../../elfutils-0.176/tests/elfstrmerge.c: In function 'main': +| ../../elfutils-0.176/tests/elfstrmerge.c:370:60: error: 'ALLPERMS' undeclared (first use in this function); did you mean 'EPERM'? +| fdnew = open (fnew, O_WRONLY | O_CREAT, st.st_mode & ALLPERMS); +| ^~~~~~~~ +| EPERM +| ../../elfutils-0.176/tests/elfstrmerge.c:370:60: note: each undeclared identifier is reported only once for each function it appears in + +Upstream-Status: Inappropriate [workaround in musl] + +Signed-off-by: Richard Purdie + +--- + tests/elfstrmerge.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/tests/elfstrmerge.c b/tests/elfstrmerge.c +index ba0d68d..1d2447f 100644 +--- a/tests/elfstrmerge.c ++++ b/tests/elfstrmerge.c +@@ -33,6 +33,11 @@ + #include ELFUTILS_HEADER(dwelf) + #include "elf-knowledge.h" + ++/* for musl */ ++#ifndef ALLPERMS ++# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */ ++#endif ++ + /* The original ELF file. */ + static int fd = -1; + static Elf *elf = NULL; +-- +2.17.1 + diff --git a/meta/recipes-devtools/elfutils/files/0007-Fix-control-path-where-we-have-str-as-uninitialized-.patch b/meta/recipes-devtools/elfutils/files/0007-Fix-control-path-where-we-have-str-as-uninitialized-.patch deleted file mode 100644 index 611a24c0f5..0000000000 --- a/meta/recipes-devtools/elfutils/files/0007-Fix-control-path-where-we-have-str-as-uninitialized-.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 112d1645bab7922c7796fe32ddea8fa6e1bbded1 Mon Sep 17 00:00:00 2001 -From: Hongxu Jia -Date: Fri, 29 Jun 2018 15:14:28 +0800 -Subject: [PATCH] Fix control path where we have str as uninitialized string - -| -/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/work/i586-oe-linux-musl/elfutils/0.164-r0/elfutils-0.164/libcpu/i386_disasm.c: -In function 'i386_disasm': -| -/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/work/i586-oe-linux-musl/elfutils/0.164-r0/elfutils-0.164/libcpu/i386_disasm.c:310:5: -error: 'str' may be used uninitialized in this function -[-Werror=maybe-uninitialized] -| memcpy (buf + bufcnt, _str, _len); \ -| ^ -| -/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/work/i586-oe-linux-musl/elfutils/0.164-r0/elfutils-0.164/libcpu/i386_disasm.c:709:17: -note: 'str' was declared here -| const char *str; - -Signed-off-by: Khem Raj -Upstream-Status: Pending - -Rebase to 0.172 - -Signed-off-by: Hongxu Jia - ---- - libcpu/i386_disasm.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c -index a7e03f9..837a3a8 100644 ---- a/libcpu/i386_disasm.c -+++ b/libcpu/i386_disasm.c -@@ -821,6 +821,7 @@ i386_disasm (Ebl *ebl __attribute__((unused)), - } - FALLTHROUGH; - default: -+ str = ""; - assert (! "INVALID not handled"); - } - } diff --git a/meta/recipes-devtools/elfutils/files/debian/hppa_backend.diff b/meta/recipes-devtools/elfutils/files/debian/hppa_backend.diff index 4460d582c7..53fa2f435b 100644 --- a/meta/recipes-devtools/elfutils/files/debian/hppa_backend.diff +++ b/meta/recipes-devtools/elfutils/files/debian/hppa_backend.diff @@ -1,4 +1,4 @@ -From 8efad9105b38985bea373416ae8fcacf21d1d129 Mon Sep 17 00:00:00 2001 +From ffb811e18d7046d5bbe54ede5b1b7e14eaac0146 Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Wed, 21 Aug 2019 15:44:18 +0800 Subject: [PATCH] hppa backend @@ -6,15 +6,16 @@ Subject: [PATCH] hppa backend Rebase to 0.177 Upstream-Status: Pending [from debian] Signed-off-by: Hongxu Jia + --- backends/Makefile.am | 7 +- backends/libebl_parisc.h | 9 ++ - backends/parisc_init.c | 73 ++++++++++++++++ - backends/parisc_regs.c | 159 ++++++++++++++++++++++++++++++++++ - backends/parisc_reloc.def | 128 ++++++++++++++++++++++++++++ - backends/parisc_retval.c | 213 ++++++++++++++++++++++++++++++++++++++++++++++ - backends/parisc_symbol.c | 113 ++++++++++++++++++++++++ - libelf/elf.h | 11 +++ + backends/parisc_init.c | 73 +++++++++++++ + backends/parisc_regs.c | 159 ++++++++++++++++++++++++++++ + backends/parisc_reloc.def | 128 +++++++++++++++++++++++ + backends/parisc_retval.c | 213 ++++++++++++++++++++++++++++++++++++++ + backends/parisc_symbol.c | 113 ++++++++++++++++++++ + libelf/elf.h | 11 ++ 8 files changed, 711 insertions(+), 2 deletions(-) create mode 100644 backends/libebl_parisc.h create mode 100644 backends/parisc_init.c @@ -24,31 +25,30 @@ Signed-off-by: Hongxu Jia create mode 100644 backends/parisc_symbol.c diff --git a/backends/Makefile.am b/backends/Makefile.am -index 175468f..91a38e2 100644 +index f405212..4755f61 100644 --- a/backends/Makefile.am +++ b/backends/Makefile.am -@@ -33,16 +33,19 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \ - +@@ -37,7 +37,9 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \ + noinst_LIBRARIES = libebl_backends.a libebl_backends_pic.a modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \ - tilegx m68k bpf riscv csky + tilegx m68k bpf riscv csky parisc - libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \ - libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \ - libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \ - libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \ - libebl_m68k_pic.a libebl_bpf_pic.a libebl_riscv_pic.a \ -- libebl_csky_pic.a -+ libebl_csky_pic.a libebl_parisc_pic.a - noinst_LIBRARIES = $(libebl_pic) - noinst_DATA = $(libebl_pic:_pic.a=.so) - ++ +parisc_SRCS = parisc_init.c parisc_symbol.c parisc_regs.c parisc_retval.c -+libebl_parisc_pic_a_SOURCES = $(parisc_SRCS) -+am_libebl_parisc_pic_a_OBJECTS = $(parisc_SRCS:.c=.os) - libelf = ../libelf/libelf.so - libdw = ../libdw/libdw.so + i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c i386_cfi.c \ + i386_retval.c i386_regs.c i386_auxv.c i386_syscall.c \ +@@ -102,7 +104,8 @@ libebl_backends_a_SOURCES = $(i386_SRCS) $(sh_SRCS) $(x86_64_SRCS) \ + $(ia64_SRCS) $(alpha_SRCS) $(arm_SRCS) \ + $(aarch64_SRCS) $(sparc_SRCS) $(ppc_SRCS) \ + $(ppc64_SRCS) $(s390_SRCS) $(tilegx_SRCS) \ +- $(m68k_SRCS) $(bpf_SRCS) $(riscv_SRCS) $(csky_SRCS) ++ $(m68k_SRCS) $(bpf_SRCS) $(riscv_SRCS) $(csky_SRCS) \ ++ $(parisc_SRCS) + + libebl_backends_pic_a_SOURCES = + am_libebl_backends_pic_a_OBJECTS = $(libebl_backends_a_SOURCES:.c=.os) diff --git a/backends/libebl_parisc.h b/backends/libebl_parisc.h new file mode 100644 index 0000000..f473b79 @@ -826,6 +826,3 @@ index 01648bd..218ceb2 100644 #define R_PARISC_SEGREL64 112 /* 64 bits segment rel. address. */ #define R_PARISC_PLTOFF14WR 115 /* PLT-rel. address, right 14 bits. */ #define R_PARISC_PLTOFF14DR 116 /* PLT-rel. address, right 14 bits. */ --- -2.7.4 - diff --git a/meta/recipes-devtools/elfutils/files/debian/mips_backend.diff b/meta/recipes-devtools/elfutils/files/debian/mips_backend.diff index 1097b0ec6f..749faa403f 100644 --- a/meta/recipes-devtools/elfutils/files/debian/mips_backend.diff +++ b/meta/recipes-devtools/elfutils/files/debian/mips_backend.diff @@ -1,4 +1,4 @@ -From 68b497668cde5171880d073a7ea50d11c3bddbfc Mon Sep 17 00:00:00 2001 +From 7e0b036d087dfff7f5e306f52fc78745f99454c3 Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Wed, 21 Aug 2019 15:49:52 +0800 Subject: [PATCH] mips backend @@ -7,15 +7,16 @@ Rebase to 0.177 Upstream-Status: Pending [from debian] Signed-off-by: Hongxu Jia + --- - backends/Makefile.am | 8 +- - backends/mips_init.c | 59 +++++++++ - backends/mips_regs.c | 104 ++++++++++++++++ - backends/mips_reloc.def | 79 ++++++++++++ - backends/mips_retval.c | 321 ++++++++++++++++++++++++++++++++++++++++++++++++ - backends/mips_symbol.c | 53 ++++++++ - libebl/eblopenbackend.c | 2 + - 7 files changed, 624 insertions(+), 2 deletions(-) + backends/Makefile.am | 6 +- + backends/mips_init.c | 59 ++++++++ + backends/mips_regs.c | 104 +++++++++++++ + backends/mips_reloc.def | 79 ++++++++++ + backends/mips_retval.c | 321 ++++++++++++++++++++++++++++++++++++++++ + backends/mips_symbol.c | 53 +++++++ + libebl/eblopenbackend.c | 3 + + 7 files changed, 623 insertions(+), 2 deletions(-) create mode 100644 backends/mips_init.c create mode 100644 backends/mips_regs.c create mode 100644 backends/mips_reloc.def @@ -23,36 +24,34 @@ Signed-off-by: Hongxu Jia create mode 100644 backends/mips_symbol.c diff --git a/backends/Makefile.am b/backends/Makefile.am -index 91a38e2..aba8a4a 100644 +index 4755f61..07d45d7 100644 --- a/backends/Makefile.am +++ b/backends/Makefile.am -@@ -33,13 +33,13 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \ - +@@ -37,7 +37,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \ + noinst_LIBRARIES = libebl_backends.a libebl_backends_pic.a modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \ - tilegx m68k bpf riscv csky parisc + tilegx m68k bpf riscv csky parisc mips - libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \ - libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \ - libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \ - libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \ - libebl_m68k_pic.a libebl_bpf_pic.a libebl_riscv_pic.a \ -- libebl_csky_pic.a libebl_parisc_pic.a -+ libebl_csky_pic.a libebl_parisc_pic.a libebl_mips_pic.a - noinst_LIBRARIES = $(libebl_pic) - noinst_DATA = $(libebl_pic:_pic.a=.so) -@@ -145,6 +145,10 @@ csky_SRCS = csky_attrs.c csky_init.c csky_symbol.c csky_cfi.c \ - libebl_csky_pic_a_SOURCES = $(csky_SRCS) - am_libebl_csky_pic_a_OBJECTS = $(csky_SRCS:.c=.os) + parisc_SRCS = parisc_init.c parisc_symbol.c parisc_regs.c parisc_retval.c + +@@ -100,12 +100,14 @@ riscv_SRCS = riscv_init.c riscv_symbol.c riscv_cfi.c riscv_regs.c \ + csky_SRCS = csky_attrs.c csky_init.c csky_symbol.c csky_cfi.c \ + csky_regs.c csky_initreg.c csky_corenote.c +mips_SRCS = mips_init.c mips_symbol.c mips_regs.c mips_retval.c -+libebl_mips_pic_a_SOURCES = $(mips_SRCS) -+am_libebl_mips_pic_a_OBJECTS = $(mips_SRCS:.c=.os) + - libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw) $(libeu) - @rm -f $(@:.so=.map) - $(AM_V_at)echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \ + libebl_backends_a_SOURCES = $(i386_SRCS) $(sh_SRCS) $(x86_64_SRCS) \ + $(ia64_SRCS) $(alpha_SRCS) $(arm_SRCS) \ + $(aarch64_SRCS) $(sparc_SRCS) $(ppc_SRCS) \ + $(ppc64_SRCS) $(s390_SRCS) $(tilegx_SRCS) \ + $(m68k_SRCS) $(bpf_SRCS) $(riscv_SRCS) $(csky_SRCS) \ +- $(parisc_SRCS) ++ $(parisc_SRCS) $(mips_SRCS) + + libebl_backends_pic_a_SOURCES = + am_libebl_backends_pic_a_OBJECTS = $(libebl_backends_a_SOURCES:.c=.os) diff --git a/backends/mips_init.c b/backends/mips_init.c new file mode 100644 index 0000000..975c04e @@ -700,18 +699,26 @@ index 0000000..261b05d + } +} diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c -index 01711f5..d0c3589 100644 +index 210b47e..1feac13 100644 --- a/libebl/eblopenbackend.c +++ b/libebl/eblopenbackend.c -@@ -71,6 +71,8 @@ static const struct - { "sparc", "elf_sparc", "sparc", 5, EM_SPARC, 0, 0 }, - { "sparc", "elf_sparcv8plus", "sparc", 5, EM_SPARC32PLUS, 0, 0 }, - { "s390", "ebl_s390", "s390", 4, EM_S390, 0, 0 }, -+ { "mips", "elf_mips", "mips", 4, EM_MIPS, 0, 0 }, -+ { "mips", "elf_mipsel", "mipsel", 4, EM_MIPS_RS3_LE, 0, 0 }, +@@ -57,6 +57,7 @@ const char *m68k_init (Elf *, GElf_Half, Ebl *, size_t); + const char *bpf_init (Elf *, GElf_Half, Ebl *, size_t); + const char *riscv_init (Elf *, GElf_Half, Ebl *, size_t); + const char *csky_init (Elf *, GElf_Half, Ebl *, size_t); ++const char *mips_init (Elf *, GElf_Half, Ebl *, size_t); + + /* This table should contain the complete list of architectures as far + as the ELF specification is concerned. */ +@@ -87,6 +88,8 @@ static const struct + { sparc_init, "elf_sparc", "sparc", 5, EM_SPARC, 0, 0 }, + { sparc_init, "elf_sparcv8plus", "sparc", 5, EM_SPARC32PLUS, 0, 0 }, + { s390_init, "ebl_s390", "s390", 4, EM_S390, 0, 0 }, ++ { mips_init, "elf_mips", "mips", 4, EM_MIPS, 0, 0 }, ++ { mips_init, "elf_mipsel", "mipsel", 4, EM_MIPS_RS3_LE, 0, 0 }, - { "m32", "elf_m32", "m32", 3, EM_M32, 0, 0 }, - { "m68k", "elf_m68k", "m68k", 4, EM_68K, ELFCLASS32, ELFDATA2MSB }, + { NULL, "elf_m32", "m32", 3, EM_M32, 0, 0 }, + { m68k_init, "elf_m68k", "m68k", 4, EM_68K, ELFCLASS32, ELFDATA2MSB }, -- -2.7.4 +2.17.1 diff --git a/meta/recipes-devtools/elfutils/files/debian/mips_cfi.patch b/meta/recipes-devtools/elfutils/files/debian/mips_cfi.patch index fda4f68059..dd8f88a454 100644 --- a/meta/recipes-devtools/elfutils/files/debian/mips_cfi.patch +++ b/meta/recipes-devtools/elfutils/files/debian/mips_cfi.patch @@ -1,33 +1,34 @@ -From 96e38289f2887ddb8e6d2fb91ea04bdbdf034ab5 Mon Sep 17 00:00:00 2001 +From 5bf6117a6eaf9007ce80adbb8b66a95ca98047a4 Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Wed, 21 Aug 2019 17:00:30 +0800 -Subject: [PATCH 2/2] mips_cfi +Subject: [PATCH] mips_cfi Upstream-Status: Pending [from debian] Rebase to 0.177 Signed-off-by: Hongxu Jia + --- backends/Makefile.am | 2 +- - backends/mips_cfi.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++ + backends/mips_cfi.c | 80 ++++++++++++++++++++++++++++++++++++++++++++ backends/mips_init.c | 1 + 3 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 backends/mips_cfi.c diff --git a/backends/Makefile.am b/backends/Makefile.am -index aba8a4a..6ac0eec 100644 +index 07d45d7..dec3080 100644 --- a/backends/Makefile.am +++ b/backends/Makefile.am -@@ -145,7 +145,7 @@ csky_SRCS = csky_attrs.c csky_init.c csky_symbol.c csky_cfi.c \ - libebl_csky_pic_a_SOURCES = $(csky_SRCS) - am_libebl_csky_pic_a_OBJECTS = $(csky_SRCS:.c=.os) +@@ -100,7 +100,7 @@ riscv_SRCS = riscv_init.c riscv_symbol.c riscv_cfi.c riscv_regs.c \ + csky_SRCS = csky_attrs.c csky_init.c csky_symbol.c csky_cfi.c \ + csky_regs.c csky_initreg.c csky_corenote.c -mips_SRCS = mips_init.c mips_symbol.c mips_regs.c mips_retval.c +mips_SRCS = mips_init.c mips_symbol.c mips_regs.c mips_retval.c mips_cfi.c - libebl_mips_pic_a_SOURCES = $(mips_SRCS) - am_libebl_mips_pic_a_OBJECTS = $(mips_SRCS:.c=.os) + libebl_backends_a_SOURCES = $(i386_SRCS) $(sh_SRCS) $(x86_64_SRCS) \ + $(ia64_SRCS) $(alpha_SRCS) $(arm_SRCS) \ diff --git a/backends/mips_cfi.c b/backends/mips_cfi.c new file mode 100644 index 0000000..9ffdab5 @@ -126,6 +127,3 @@ index 8482e7f..bce5abe 100644 return MODVERSION; } --- -2.7.4 - diff --git a/meta/recipes-devtools/elfutils/files/musl-libs.patch b/meta/recipes-devtools/elfutils/files/musl-libs.patch deleted file mode 100644 index b9b9f120df..0000000000 --- a/meta/recipes-devtools/elfutils/files/musl-libs.patch +++ /dev/null @@ -1,144 +0,0 @@ -From d5a1651df9884fcf57ed320bc2f866538af2f420 Mon Sep 17 00:00:00 2001 -From: Hongxu Jia -Date: Fri, 23 Aug 2019 10:18:47 +0800 -Subject: [PATCH 2/3] musl-libs - -Collection of fixes needed to compile libelf and other libraries -provided by elfutils for musl targets - -error is glibc specific API, so this patch will mostly not accepted -upstream given that elfutils has been closely tied to glibc - -Signed-off-by: Khem Raj -Upstream-Status: Inappropriate [workaround for musl] - -Rebase to 0.177 -Signed-off-by: Hongxu Jia ---- - lib/error.h | 27 +++++++++++++++++++++++++++ - lib/fixedsizehash.h | 1 - - lib/libeu.h | 1 + - libdwfl/dwfl_error.c | 9 +++++++++ - libdwfl/linux-kernel-modules.c | 1 + - libelf/elf.h | 9 ++++++--- - 6 files changed, 44 insertions(+), 4 deletions(-) - create mode 100644 lib/error.h - -diff --git a/lib/error.h b/lib/error.h -new file mode 100644 -index 0000000..ef06827 ---- /dev/null -+++ b/lib/error.h -@@ -0,0 +1,27 @@ -+#ifndef _ERROR_H_ -+#define _ERROR_H_ -+ -+#include -+#include -+#include -+#include -+#include -+ -+static unsigned int error_message_count = 0; -+ -+static inline void error(int status, int errnum, const char* format, ...) -+{ -+ va_list ap; -+ fprintf(stderr, "%s: ", program_invocation_name); -+ va_start(ap, format); -+ vfprintf(stderr, format, ap); -+ va_end(ap); -+ if (errnum) -+ fprintf(stderr, ": %s", strerror(errnum)); -+ fprintf(stderr, "\n"); -+ error_message_count++; -+ if (status) -+ exit(status); -+} -+ -+#endif /* _ERROR_H_ */ -diff --git a/lib/fixedsizehash.h b/lib/fixedsizehash.h -index dac2a5f..43016fc 100644 ---- a/lib/fixedsizehash.h -+++ b/lib/fixedsizehash.h -@@ -30,7 +30,6 @@ - #include - #include - #include --#include - - #include - -diff --git a/lib/libeu.h b/lib/libeu.h -index ecb4d01..edc85e3 100644 ---- a/lib/libeu.h -+++ b/lib/libeu.h -@@ -29,6 +29,7 @@ - #ifndef LIBEU_H - #define LIBEU_H - -+#include "system.h" - #include - #include - -diff --git a/libdwfl/dwfl_error.c b/libdwfl/dwfl_error.c -index 7bcf61c..11dcc8b 100644 ---- a/libdwfl/dwfl_error.c -+++ b/libdwfl/dwfl_error.c -@@ -154,7 +154,16 @@ dwfl_errmsg (int error) - switch (error &~ 0xffff) - { - case OTHER_ERROR (ERRNO): -+#if defined(__GLIBC__) - return strerror_r (error & 0xffff, "bad", 0); -+#else -+ { -+ static __thread char buf[128] = ""; -+ if (strerror_r (error & 0xffff, buf, sizeof(buf)) == 0) -+ return buf; -+ } -+ return "strerror_r() failed"; -+#endif - case OTHER_ERROR (LIBELF): - return elf_errmsg (error & 0xffff); - case OTHER_ERROR (LIBDW): -diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c -index d46ab5a..1c3faee 100644 ---- a/libdwfl/linux-kernel-modules.c -+++ b/libdwfl/linux-kernel-modules.c -@@ -50,6 +50,7 @@ - #include - #include - #include -+#include "system.h" - - /* If fts.h is included before config.h, its indirect inclusions may not - give us the right LFS aliases of these functions, so map them manually. */ -diff --git a/libelf/elf.h b/libelf/elf.h -index bed273d..be228e6 100644 ---- a/libelf/elf.h -+++ b/libelf/elf.h -@@ -21,7 +21,9 @@ - - #include - --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - - /* Standard ELF types. */ - -@@ -4029,6 +4031,7 @@ enum - #define R_NDS32_TLS_TPOFF 102 - #define R_NDS32_TLS_DESC 119 - --__END_DECLS -- -+#ifdef __cplusplus -+} -+#endif - #endif /* elf.h */ --- -2.7.4 - diff --git a/meta/recipes-devtools/elfutils/files/musl-obstack-fts.patch b/meta/recipes-devtools/elfutils/files/musl-obstack-fts.patch deleted file mode 100644 index 40f2b69cf4..0000000000 --- a/meta/recipes-devtools/elfutils/files/musl-obstack-fts.patch +++ /dev/null @@ -1,128 +0,0 @@ -From 77b89dbc9f9f965ad0ef2e341d7d46bce5f07549 Mon Sep 17 00:00:00 2001 -From: Hongxu Jia -Date: Fri, 23 Aug 2019 10:17:25 +0800 -Subject: [PATCH 1/3] musl-obstack-fts - -Look for libfts and libobstack during configure, these -libraries are external to libc when using musl, whereas -on glibc these libraries are provided in libc itself. - -Signed-off-by: Khem Raj -Upstream-Status: Inappropriate [workaround for musl] - -Rebase to 0.177 -Signed-off-by: Hongxu Jia ---- - configure.ac | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ - libdw/Makefile.am | 2 +- - src/Makefile.am | 8 ++++---- - 3 files changed, 59 insertions(+), 5 deletions(-) - -diff --git a/configure.ac b/configure.ac -index f93964c..b87b762 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -494,6 +494,60 @@ else - fi - AC_SUBST([argp_LDADD]) - -+dnl Check if we have fts available from our libc -+AC_LINK_IFELSE( -+ [AC_LANG_PROGRAM( -+ [#if !defined(__x86_64__) -+ #undef _FILE_OFFSET_BITS -+ #define _FILE_OFFSET_BITS 32 -+ #endif -+ #include ], -+ [FTS* fts = 0; return fts_close(fts); return 0;] -+ )], -+ [libc_has_fts="true"], -+ [libc_has_fts="false"] -+) -+ -+dnl If our libc doesn't provide fts, then test for libfts -+if test "$libc_has_fts" = "false" ; then -+ AC_MSG_WARN("libc does not have fts") -+ AC_CHECK_LIB([fts], [fts_close], [have_fts="true"], [have_fts="false"]) -+ -+ if test "$have_fts" = "false"; then -+ AC_MSG_ERROR("no libfts found") -+ else -+ fts_LDADD="-lfts" -+ fi -+else -+ fts_LDADD="" -+fi -+AC_SUBST([fts_LDADD]) -+ -+dnl Check if we have obstack available from our libc -+AC_LINK_IFELSE( -+ [AC_LANG_PROGRAM( -+ [#include ], -+ [_obstack_begin(0, 0, 0, NULL, NULL); return 0;] -+ )], -+ [libc_has_obstack="true"], -+ [libc_has_obstack="false"] -+) -+ -+dnl If our libc doesn't provide obstack, then test for libobstack -+if test "$libc_has_obstack" = "false" ; then -+ AC_MSG_WARN("libc does not have obstack") -+ AC_CHECK_LIB([obstack], [_obstack_begin], [have_obstack="true"], [have_obstack="false"]) -+ -+ if test "$have_obstack" = "false"; then -+ AC_MSG_ERROR("no libobstack found") -+ else -+ obstack_LDADD="-lobstack" -+ fi -+else -+ obstack_LDADD="" -+fi -+AC_SUBST([obstack_LDADD]) -+ - dnl The directories with content. - - dnl Documentation. -diff --git a/libdw/Makefile.am b/libdw/Makefile.am -index 7a3d532..a541fa3 100644 ---- a/libdw/Makefile.am -+++ b/libdw/Makefile.am -@@ -108,7 +108,7 @@ am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os) - libdw_so_LIBS = libdw_pic.a ../libdwelf/libdwelf_pic.a \ - ../libdwfl/libdwfl_pic.a ../libebl/libebl.a - libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so --libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(zip_LIBS) -+libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(fts_LDADD) $(zip_LIBS) - libdw_so_SOURCES = - libdw.so$(EXEEXT): $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS) - # The rpath is necessary for libebl because its $ORIGIN use will -diff --git a/src/Makefile.am b/src/Makefile.am -index b72f853..2f3dfce 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -69,8 +69,8 @@ ar_no_Wstack_usage = yes - unstrip_no_Wstack_usage = yes - - readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl --nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl \ -- $(demanglelib) -+nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) \ -+ $(obstack_LDADD) -ldl $(demanglelib) - size_LDADD = $(libelf) $(libeu) $(argp_LDADD) - strip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) -ldl - elflint_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl -@@ -78,9 +78,9 @@ findtextrel_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) - addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(demanglelib) - elfcmp_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl - objdump_LDADD = $(libasm) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl --ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) -+ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LDADD) - strings_LDADD = $(libelf) $(libeu) $(argp_LDADD) --ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) -+ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LDADD) - unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) -ldl - stack_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) -ldl $(demanglelib) - elfcompress_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) --- -2.7.4 - diff --git a/meta/recipes-devtools/elfutils/files/musl-tests.patch b/meta/recipes-devtools/elfutils/files/musl-tests.patch deleted file mode 100644 index be35791b1a..0000000000 --- a/meta/recipes-devtools/elfutils/files/musl-tests.patch +++ /dev/null @@ -1,29 +0,0 @@ -Fix error on musl: - -| ../../elfutils-0.176/tests/elfstrmerge.c: In function 'main': -| ../../elfutils-0.176/tests/elfstrmerge.c:370:60: error: 'ALLPERMS' undeclared (first use in this function); did you mean 'EPERM'? -| fdnew = open (fnew, O_WRONLY | O_CREAT, st.st_mode & ALLPERMS); -| ^~~~~~~~ -| EPERM -| ../../elfutils-0.176/tests/elfstrmerge.c:370:60: note: each undeclared identifier is reported only once for each function it appears in - -Upstream-Status: Inappropriate [workaround in musl] - -Signed-off-by: Richard Purdie - -Index: elfutils-0.176/tests/elfstrmerge.c -=================================================================== ---- elfutils-0.176.orig/tests/elfstrmerge.c -+++ elfutils-0.176/tests/elfstrmerge.c -@@ -33,6 +33,11 @@ - #include ELFUTILS_HEADER(dwelf) - #include "elf-knowledge.h" - -+/* for musl */ -+#ifndef ALLPERMS -+# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */ -+#endif -+ - /* The original ELF file. */ - static int fd = -1; - static Elf *elf = NULL; diff --git a/meta/recipes-devtools/elfutils/files/musl-utils.patch b/meta/recipes-devtools/elfutils/files/musl-utils.patch deleted file mode 100644 index a8ad931236..0000000000 --- a/meta/recipes-devtools/elfutils/files/musl-utils.patch +++ /dev/null @@ -1,165 +0,0 @@ -From 7f5e2fd86d54e0a4d195ec65afb9b411829dff9f Mon Sep 17 00:00:00 2001 -From: Hongxu Jia -Date: Fri, 23 Aug 2019 10:19:48 +0800 -Subject: [PATCH 3/3] musl-utils - -Provide missing defines which otherwise are available on glibc system headers - -Alter the error API to match posix version -use qsort instead of qsort_r which is glibc specific API - -Signed-off-by: Khem Raj -Upstream-Status: Inappropriate [workaround for musl] - -Rebase to 0.177 -Signed-off-by: Hongxu Jia ---- - src/arlib.h | 6 ++++++ - src/elfcompress.c | 7 +++++++ - src/readelf.c | 20 ++++++++++++-------- - src/strip.c | 7 +++++++ - src/unstrip.c | 9 +++++++++ - 5 files changed, 41 insertions(+), 8 deletions(-) - -diff --git a/src/arlib.h b/src/arlib.h -index e117166..8326f6c 100644 ---- a/src/arlib.h -+++ b/src/arlib.h -@@ -29,6 +29,12 @@ - #include - #include - -+#if !defined(ALLPERMS) -+# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */ -+#endif -+#if !defined(DEFFILEMODE) -+# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 0666*/ -+#endif - - /* State of -D/-U flags. */ - extern bool arlib_deterministic_output; -diff --git a/src/elfcompress.c b/src/elfcompress.c -index 6ba6af4..0c7674b 100644 ---- a/src/elfcompress.c -+++ b/src/elfcompress.c -@@ -37,6 +37,13 @@ - #include "libeu.h" - #include "printversion.h" - -+#if !defined(ALLPERMS) -+# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */ -+#endif -+#if !defined(FNM_EXTMATCH) -+# define FNM_EXTMATCH (0) -+#endif -+ - /* Name and version of program. */ - ARGP_PROGRAM_VERSION_HOOK_DEF = print_version; - -diff --git a/src/readelf.c b/src/readelf.c -index 5c02a9b..817562d 100644 ---- a/src/readelf.c -+++ b/src/readelf.c -@@ -4813,10 +4813,11 @@ listptr_base (struct listptr *p) - return cudie_base (&cu); - } - -+static const char *listptr_name; -+ - static int --compare_listptr (const void *a, const void *b, void *arg) -+compare_listptr (const void *a, const void *b) - { -- const char *name = arg; - struct listptr *p1 = (void *) a; - struct listptr *p2 = (void *) b; - -@@ -4832,21 +4833,21 @@ compare_listptr (const void *a, const void *b, void *arg) - p1->warned = p2->warned = true; - error (0, 0, - gettext ("%s %#" PRIx64 " used with different address sizes"), -- name, (uint64_t) p1->offset); -+ listptr_name, (uint64_t) p1->offset); - } - if (p1->dwarf64 != p2->dwarf64) - { - p1->warned = p2->warned = true; - error (0, 0, - gettext ("%s %#" PRIx64 " used with different offset sizes"), -- name, (uint64_t) p1->offset); -+ listptr_name, (uint64_t) p1->offset); - } - if (listptr_base (p1) != listptr_base (p2)) - { - p1->warned = p2->warned = true; - error (0, 0, - gettext ("%s %#" PRIx64 " used with different base addresses"), -- name, (uint64_t) p1->offset); -+ listptr_name, (uint64_t) p1->offset); - } - if (p1->attr != p2 ->attr) - { -@@ -4854,7 +4855,7 @@ compare_listptr (const void *a, const void *b, void *arg) - error (0, 0, - gettext ("%s %#" PRIx64 - " used with different attribute %s and %s"), -- name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr), -+ listptr_name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr), - dwarf_attr_name (p2->attr)); - } - } -@@ -4926,8 +4927,11 @@ static void - sort_listptr (struct listptr_table *table, const char *name) - { - if (table->n > 0) -- qsort_r (table->table, table->n, sizeof table->table[0], -- &compare_listptr, (void *) name); -+ { -+ listptr_name = name; -+ qsort (table->table, table->n, sizeof table->table[0], -+ &compare_listptr); -+ } - } - - static bool -diff --git a/src/strip.c b/src/strip.c -index 4054c2a..d2d2176 100644 ---- a/src/strip.c -+++ b/src/strip.c -@@ -46,6 +46,13 @@ - #include - #include - -+#if !defined(ACCESSPERMS) -+# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */ -+#endif -+#if !defined(FNM_EXTMATCH) -+# define FNM_EXTMATCH (0) -+#endif -+ - typedef uint8_t GElf_Byte; - - /* Name and version of program. */ -diff --git a/src/unstrip.c b/src/unstrip.c -index fc87832..21ea6b3 100644 ---- a/src/unstrip.c -+++ b/src/unstrip.c -@@ -56,6 +56,15 @@ - # define _(str) gettext (str) - #endif - -+#ifndef strndupa -+#define strndupa(s, n) \ -+ ({const char *__in = (s); \ -+ size_t __len = strnlen (__in, (n)) + 1; \ -+ char *__out = (char *) alloca (__len); \ -+ __out[__len-1] = '\0'; \ -+ (char *) memcpy (__out, __in, __len-1);}) -+#endif -+ - /* Name and version of program. */ - ARGP_PROGRAM_VERSION_HOOK_DEF = print_version; - --- -2.7.4 - -- cgit v1.2.3-54-g00ecf