From 3902c43070a5f8019b8411318a46dc2f70e7a4e4 Mon Sep 17 00:00:00 2001 From: Serge Semin Date: Wed, 4 Apr 2018 01:45:28 +0500 Subject: [PATCH 1/6] meta-environment{,-extsdk}: don't include -B${gcc_bindir} in emitted TUNE_CC_ARCH Don't dump the -B${gcc_bindir} appended to TUNE_CCARGS and subsequently to TARGET_CC_ARCH, since it consists of local machine toolchain paths. Signed-off-by: Christopher Larson --- core/recipes-core/meta/meta-environment-extsdk.bbappend | 4 ++++ core/recipes-core/meta/meta-environment.bbappend | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 core/recipes-core/meta/meta-environment-extsdk.bbappend create mode 100644 core/recipes-core/meta/meta-environment.bbappend diff --git a/core/recipes-core/meta/meta-environment-extsdk.bbappend b/core/recipes-core/meta/meta-environment-extsdk.bbappend new file mode 100644 index 0000000..dabfa15 --- /dev/null +++ b/core/recipes-core/meta/meta-environment-extsdk.bbappend @@ -0,0 +1,4 @@ + +# Don't dump the -B${gcc_bindir} appended to TUNE_CCARGS and subsequently +# to TARGET_CC_ARCH, since it consists of local machine toolchain paths. +TUNE_CCARGS_remove = "-B${gcc_bindir}" diff --git a/core/recipes-core/meta/meta-environment.bbappend b/core/recipes-core/meta/meta-environment.bbappend new file mode 100644 index 0000000..dabfa15 --- /dev/null +++ b/core/recipes-core/meta/meta-environment.bbappend @@ -0,0 +1,4 @@ + +# Don't dump the -B${gcc_bindir} appended to TUNE_CCARGS and subsequently +# to TARGET_CC_ARCH, since it consists of local machine toolchain paths. +TUNE_CCARGS_remove = "-B${gcc_bindir}" From d53aba601e3d1e845f1f28b51e11087ec75f6541 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Wed, 6 Feb 2019 22:11:39 +0000 Subject: [PATCH 2/6] {glibc,gcc-runtime}: fix warnings about libssp for builds with security flags This can be dropped if and when the toolchain gets built without libssp, which is the default in oe-core. We don't need gcc's libssp anyway, since glibc provides it already, and musl has the separate libssp_nonshared lib to supplement, which is in oe-core. JIRA: SB-12465 Signed-off-by: Christopher Larson --- recipes-external/gcc/gcc-runtime-external.bb | 15 ++++++++++++++- recipes-external/glibc/glibc-external.bb | 3 +++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/recipes-external/gcc/gcc-runtime-external.bb b/recipes-external/gcc/gcc-runtime-external.bb index ec1c04a..1d9062f 100644 --- a/recipes-external/gcc/gcc-runtime-external.bb +++ b/recipes-external/gcc/gcc-runtime-external.bb @@ -59,4 +59,17 @@ FILES_libgomp-dev += "\ " BBCLASSEXTEND = "" -do_package[depends] += "virtual/${MLPREFIX}libc:do_packagedata" +# gcc-runtime needs libc, but glibc's utilities need libssp in some cases, so +# short-circuit the interdependency here by manually specifying it rather than +# depending on the libc packagedata. +libc_rdep = "${@'${PREFERRED_PROVIDER_virtual/libc}' if '${PREFERRED_PROVIDER_virtual/libc}' else '${TCLIBC}'}" +RDEPENDS_libgomp += "${libc_rdep}" +RDEPENDS_libssp += "${libc_rdep}" +RDEPENDS_libstdc++ += "${libc_rdep}" +RDEPENDS_libatomic += "${libc_rdep}" +RDEPENDS_libquadmath += "${libc_rdep}" +RDEPENDS_libmpx += "${libc_rdep}" + +do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata" +do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata" +do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata" diff --git a/recipes-external/glibc/glibc-external.bb b/recipes-external/glibc/glibc-external.bb index 344fb07..22e417f 100644 --- a/recipes-external/glibc/glibc-external.bb +++ b/recipes-external/glibc/glibc-external.bb @@ -225,5 +225,8 @@ do_package_write_ipk[depends] += "${MLPREFIX}libgcc:do_packagedata" do_package_write_deb[depends] += "${MLPREFIX}libgcc:do_packagedata" do_package_write_rpm[depends] += "${MLPREFIX}libgcc:do_packagedata" +# glibc may need libssp for -fstack-protector builds +do_packagedata[depends] += "gcc-runtime:do_packagedata" + FILES_${PN}-dev_remove = "${base_libdir}/*_nonshared.a ${libdir}/*_nonshared.a" FILES_${PN}-dev += "${libdir}/libc_nonshared.a ${libdir}/libpthread_nonshared.a ${libdir}/libmvec_nonshared.a" From 074bea89db6ce3ccca717999bd11c79fe9be7f79 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Tue, 23 Apr 2019 17:13:07 +0000 Subject: [PATCH 3/6] gdbserver-external: add missing MLPREFIX in dep on compilerlibs DEPENDS/PROVIDES & PREFERRED_PROVIDER get mapped for mlprefix automatically, but 'depends' flags do not, so the MLPREFIX has to be explicit in such flags. This fixes the ability to build multilib images, i.e. lib32-core-image-base. Signed-off-by: Christopher Larson --- recipes-external/gdb/gdbserver-external.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-external/gdb/gdbserver-external.bb b/recipes-external/gdb/gdbserver-external.bb index 301800a..e4b8e1a 100644 --- a/recipes-external/gdb/gdbserver-external.bb +++ b/recipes-external/gdb/gdbserver-external.bb @@ -24,5 +24,5 @@ FILES_${PN}-doc = "${mandir}/man1/gdbserver.1" # Ensure that our rdeps are able to be set by shlibs processing do_package[depends] += "\ virtual/libc:do_packagedata \ - virtual/${TARGET_PREFIX}compilerlibs:do_packagedata \ + virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata \ " From e90fb8fd9a1a04ac70fd0f5f59e16a4ae4ad8ce2 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Tue, 23 Apr 2019 18:46:04 +0000 Subject: [PATCH 4/6] tcmode: work around mlprefix preference bug wrt gdbserver There's a bug where the implicitly created `PREFERRED_PROVIDER_${MLPREFIX}` isn't being obeyed for runtime package installation in a multilib image, so work around it by explicitly specifying mlprefix. Signed-off-by: Christopher Larson --- conf/distro/include/tcmode-external.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/conf/distro/include/tcmode-external.inc b/conf/distro/include/tcmode-external.inc index 8f0727e..339d911 100644 --- a/conf/distro/include/tcmode-external.inc +++ b/conf/distro/include/tcmode-external.inc @@ -16,8 +16,10 @@ PREFERRED_PROVIDER_glibc ?= "glibc-external" PREFERRED_PROVIDER_virtual/libc ?= "glibc-external" PREFERRED_PROVIDER_virtual/libintl ?= "glibc-external" PREFERRED_PROVIDER_virtual/libiconv ?= "glibc-external" -PREFERRED_PROVIDER_gdbserver ??= "gdb" PREFERRED_PROVIDER_oprofile ??= "oprofile" +# Work around bug where the implicitly created mlprefix preference isn't being +# obeyed for the runtime package installation. +PREFERRED_PROVIDER_${MLPREFIX}gdbserver ??= "${MLPREFIX}gdb" # This is defined in default-providers.inc, which is parsed before the tcmode, # so we can't use ?= From 60667c36c28f655fd1ccca37fcfdf88508ebeb00 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Thu, 9 May 2019 19:43:52 +0000 Subject: [PATCH 5/6] gdb: fix missing mlprefix for gdbserver pref Signed-off-by: Christopher Larson --- core/recipes-devtools/gdb/gdb_%.bbappend | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/recipes-devtools/gdb/gdb_%.bbappend b/core/recipes-devtools/gdb/gdb_%.bbappend index 227cd75..65c5299 100644 --- a/core/recipes-devtools/gdb/gdb_%.bbappend +++ b/core/recipes-devtools/gdb/gdb_%.bbappend @@ -1,7 +1,7 @@ -PREFERRED_PROVIDER_gdbserver ?= "gdb" -PROVIDES_append_tcmode-external = " ${@'gdbserver' if '${PREFERRED_PROVIDER_gdbserver}' == '${PN}' else ''}" +PREFERRED_PROVIDER_${MLPREFIX}gdbserver ?= "${MLPREFIX}gdb" +PROVIDES_append_tcmode-external = " ${@'gdbserver' if '${PREFERRED_PROVIDER_${MLPREFIX}gdbserver}' == '${PN}' else ''}" # Disable build of gdbserver if is provided by external-sourcery-toolchain -PACKAGES_remove_tcmode-external = "${@'gdbserver' if '${PREFERRED_PROVIDER_gdbserver}' != '${PN}' else ''}" -DISABLE_GDBSERVER = "${@'--disable-gdbserver' if '${PREFERRED_PROVIDER_gdbserver}' != '${PN}' else ''}" +PACKAGES_remove_tcmode-external = "${@'gdbserver' if '${PREFERRED_PROVIDER_${MLPREFIX}gdbserver}' != '${PN}' else ''}" +DISABLE_GDBSERVER = "${@'--disable-gdbserver' if '${PREFERRED_PROVIDER_${MLPREFIX}gdbserver}' != '${PN}' else ''}" EXTRA_OECONF_append_tcmode-external = " ${DISABLE_GDBSERVER}" From 8964172347fbbea517cb81eb7bd8e540f37fc73b Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Fri, 10 May 2019 16:32:06 +0000 Subject: [PATCH 6/6] Silence gdbserver preference warnings in multilib builds Signed-off-by: Christopher Larson --- conf/distro/include/tcmode-external.inc | 2 +- core/recipes-devtools/gdb/gdb_%.bbappend | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/conf/distro/include/tcmode-external.inc b/conf/distro/include/tcmode-external.inc index 339d911..f7aeeba 100644 --- a/conf/distro/include/tcmode-external.inc +++ b/conf/distro/include/tcmode-external.inc @@ -19,7 +19,7 @@ PREFERRED_PROVIDER_virtual/libiconv ?= "glibc-external" PREFERRED_PROVIDER_oprofile ??= "oprofile" # Work around bug where the implicitly created mlprefix preference isn't being # obeyed for the runtime package installation. -PREFERRED_PROVIDER_${MLPREFIX}gdbserver ??= "${MLPREFIX}gdb" +PREFERRED_PROVIDER_${MLPREFIX}gdbserver ?= "${MLPREFIX}gdb" # This is defined in default-providers.inc, which is parsed before the tcmode, # so we can't use ?= diff --git a/core/recipes-devtools/gdb/gdb_%.bbappend b/core/recipes-devtools/gdb/gdb_%.bbappend index 65c5299..b457f74 100644 --- a/core/recipes-devtools/gdb/gdb_%.bbappend +++ b/core/recipes-devtools/gdb/gdb_%.bbappend @@ -1,4 +1,3 @@ -PREFERRED_PROVIDER_${MLPREFIX}gdbserver ?= "${MLPREFIX}gdb" PROVIDES_append_tcmode-external = " ${@'gdbserver' if '${PREFERRED_PROVIDER_${MLPREFIX}gdbserver}' == '${PN}' else ''}" # Disable build of gdbserver if is provided by external-sourcery-toolchain