From: "Steve Sakoman" <steve@sakoman.com>
To: openembedded-core@lists.openembedded.org
Subject: [OE-core][dunfell 08/28] binutils: Detect proper static-libstdc++ support when using clang
Date: Mon, 4 May 2020 17:19:03 -1000 [thread overview]
Message-ID: <7e90a36e62ebddf287c2ef19e28f88426e061897.1588638879.git.steve@sakoman.com> (raw)
In-Reply-To: <cover.1588638879.git.steve@sakoman.com>
From: Khem Raj <raj.khem@gmail.com>
Fixes configure time tests to ensure static-libstdc++ is enabled when
using clang
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
.../binutils/binutils-2.34.inc | 1 +
...or-clang-before-checking-gcc-version.patch | 48 +++++++++++++++++++
2 files changed, 49 insertions(+)
create mode 100644 meta/recipes-devtools/binutils/binutils/0016-Check-for-clang-before-checking-gcc-version.patch
diff --git a/meta/recipes-devtools/binutils/binutils-2.34.inc b/meta/recipes-devtools/binutils/binutils-2.34.inc
index 4b085b6fe0..66a3850ef2 100644
--- a/meta/recipes-devtools/binutils/binutils-2.34.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.34.inc
@@ -40,6 +40,7 @@ SRC_URI = "\
file://0013-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch \
file://0014-Detect-64-bit-MIPS-targets.patch \
file://0015-sync-with-OE-libtool-changes.patch \
+ file://0016-Check-for-clang-before-checking-gcc-version.patch \
file://CVE-2020-0551.patch \
"
S = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/0016-Check-for-clang-before-checking-gcc-version.patch b/meta/recipes-devtools/binutils/binutils/0016-Check-for-clang-before-checking-gcc-version.patch
new file mode 100644
index 0000000000..c694b42dc3
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0016-Check-for-clang-before-checking-gcc-version.patch
@@ -0,0 +1,48 @@
+From 67590a44c1256491fa674426f0170d5d05377d05 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 15 Apr 2020 14:17:20 -0700
+Subject: [PATCH 16/16] Check for clang before checking gcc version
+
+Clang advertises itself to be gcc 4.2.1, so when compiling this test
+here fails since gcc < 4.4.5 did not support -static-libstdc++ but thats
+not true for clang, so its better to make an additional check for clang
+before resorting to gcc version check. This should let clang enable
+static libstdc++ linking
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure | 2 +-
+ configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index 590b03c2da0..46f116fdb54 100755
+--- a/configure
++++ b/configure
+@@ -5140,7 +5140,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+-#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
++#if !defined(__clang__) && ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5))
+ #error -static-libstdc++ not implemented
+ #endif
+ int main() {}
+diff --git a/configure.ac b/configure.ac
+index d3f85e6f5d5..c0eb1343121 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1309,7 +1309,7 @@ if test "$GCC" = yes; then
+ AC_MSG_CHECKING([whether g++ accepts -static-libstdc++ -static-libgcc])
+ AC_LANG_PUSH(C++)
+ AC_LINK_IFELSE([AC_LANG_SOURCE([
+-#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
++#if !defined(__clang__) && ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5))
+ #error -static-libstdc++ not implemented
+ #endif
+ int main() {}])],
+--
+2.26.1
+
--
2.17.1
next prev parent reply other threads:[~2020-05-05 3:20 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-05 3:18 [OE-core][dunfell 00/28] Patch review Steve Sakoman
2020-05-05 3:18 ` [OE-core][dunfell 01/28] bzip2/pbzip2: Correct license information Steve Sakoman
2020-05-05 3:18 ` [OE-core][dunfell 02/28] busybox: Correct the name of the bzip2 license Steve Sakoman
2020-05-05 3:18 ` [OE-core][dunfell 03/28] pbzip2: Fix license warning Steve Sakoman
2020-05-05 3:18 ` [OE-core][dunfell 04/28] packagegroup-go-sdk-target: Enable on rv64 Steve Sakoman
2020-05-05 3:19 ` [OE-core][dunfell 05/28] go: Rely on go-runtime to provide needed modules Steve Sakoman
2020-05-05 3:19 ` [OE-core][dunfell 06/28] packagegroup-go-sdk-target: Add go to packagegroup Steve Sakoman
2020-05-05 3:19 ` [OE-core][dunfell 07/28] gcc: Configure all gccs with --disable-install-libiberty Steve Sakoman
2020-05-05 3:19 ` Steve Sakoman [this message]
2020-05-05 3:19 ` [OE-core][dunfell 09/28] binutils: Install PIC version of libiberty.a Steve Sakoman
2020-05-05 3:19 ` [OE-core][dunfell 10/28] insane.bbclass: Add test for shebang line length Steve Sakoman
2020-05-05 3:19 ` [OE-core][dunfell 11/28] vim: do not adjust script paths building for target Steve Sakoman
2020-05-05 3:19 ` [OE-core][dunfell 12/28] boost: revert 1.72.0 regression Steve Sakoman
2020-05-05 3:19 ` [OE-core][dunfell 13/28] perl: Add missing dependency for tie-hash on carp Steve Sakoman
2020-05-05 3:19 ` [OE-core][dunfell 14/28] testimage.bbclass: correctly process SIGTERM Steve Sakoman
2020-05-05 3:19 ` [OE-core][dunfell 15/28] run-postinsts: Set RemainAfterExit on systemd unit Steve Sakoman
2020-05-05 3:19 ` [OE-core][dunfell 16/28] scripts/install-buildtools: bump to 3.1 release by default Steve Sakoman
2020-05-05 3:19 ` [OE-core][dunfell 17/28] oeqa/selftest: Add test for conflicting sysroot provider Steve Sakoman
2020-05-05 3:19 ` [OE-core][dunfell 18/28] staging: Fix overlapping file failures Steve Sakoman
2020-05-05 3:19 ` [OE-core][dunfell 19/28] python3: fix CVE-2020-8492 Steve Sakoman
2020-05-05 3:19 ` [OE-core][dunfell 20/28] targetcontrol: Fix leaking log handler Steve Sakoman
2020-05-05 3:19 ` [OE-core][dunfell 21/28] oeqa/qemurunner: Clean up failure handling Steve Sakoman
2020-05-05 3:19 ` [OE-core][dunfell 22/28] buildtools-extended-tarball: add libgomp-dev Steve Sakoman
2020-05-05 3:19 ` [OE-core][dunfell 23/28] libffi: fix v3.3 compile on ppc64le Steve Sakoman
2020-05-05 3:19 ` [OE-core][dunfell 24/28] pseudo: add macro guard for seccomp Steve Sakoman
2020-05-05 3:19 ` [OE-core][dunfell 25/28] gcc-target: Ensure buildtools-extended-tarball doesn't use arch=native Steve Sakoman
2020-05-05 3:19 ` [OE-core][dunfell 26/28] iputils: Initialize libgcrypt Steve Sakoman
2020-05-05 3:19 ` [OE-core][dunfell 27/28] openssl: upgrade 1.1.1f -> 1.1.1g Steve Sakoman
2020-05-05 3:19 ` [OE-core][dunfell 28/28] icu: CVE-2020-10531 Steve Sakoman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7e90a36e62ebddf287c2ef19e28f88426e061897.1588638879.git.steve@sakoman.com \
--to=steve@sakoman.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox