summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-04-15 16:18:28 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-05-07 13:03:30 +0100
commitf21e3abbaca517377f7492298b2781b3f38db483 (patch)
tree95724f77496d8bc5a5cebe5251e0f73d8e951d40 /meta/recipes-devtools
parent426be0f2aecb00533d7edde1191c5d33636a730c (diff)
downloadpoky-f21e3abbaca517377f7492298b2781b3f38db483.tar.gz
binutils: Detect proper static-libstdc++ support when using clang
Fixes configure time tests to ensure static-libstdc++ is enabled when using clang (From OE-Core rev: 7e90a36e62ebddf287c2ef19e28f88426e061897) 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> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/binutils/binutils-2.34.inc1
-rw-r--r--meta/recipes-devtools/binutils/binutils/0016-Check-for-clang-before-checking-gcc-version.patch48
2 files changed, 49 insertions, 0 deletions
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 = "\
40 file://0013-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch \ 40 file://0013-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch \
41 file://0014-Detect-64-bit-MIPS-targets.patch \ 41 file://0014-Detect-64-bit-MIPS-targets.patch \
42 file://0015-sync-with-OE-libtool-changes.patch \ 42 file://0015-sync-with-OE-libtool-changes.patch \
43 file://0016-Check-for-clang-before-checking-gcc-version.patch \
43 file://CVE-2020-0551.patch \ 44 file://CVE-2020-0551.patch \
44" 45"
45S = "${WORKDIR}/git" 46S = "${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 @@
1From 67590a44c1256491fa674426f0170d5d05377d05 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 15 Apr 2020 14:17:20 -0700
4Subject: [PATCH 16/16] Check for clang before checking gcc version
5
6Clang advertises itself to be gcc 4.2.1, so when compiling this test
7here fails since gcc < 4.4.5 did not support -static-libstdc++ but thats
8not true for clang, so its better to make an additional check for clang
9before resorting to gcc version check. This should let clang enable
10static libstdc++ linking
11
12Upstream-Status: Pending
13
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 configure | 2 +-
17 configure.ac | 2 +-
18 2 files changed, 2 insertions(+), 2 deletions(-)
19
20diff --git a/configure b/configure
21index 590b03c2da0..46f116fdb54 100755
22--- a/configure
23+++ b/configure
24@@ -5140,7 +5140,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
25 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26 /* end confdefs.h. */
27
28-#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
29+#if !defined(__clang__) && ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5))
30 #error -static-libstdc++ not implemented
31 #endif
32 int main() {}
33diff --git a/configure.ac b/configure.ac
34index d3f85e6f5d5..c0eb1343121 100644
35--- a/configure.ac
36+++ b/configure.ac
37@@ -1309,7 +1309,7 @@ if test "$GCC" = yes; then
38 AC_MSG_CHECKING([whether g++ accepts -static-libstdc++ -static-libgcc])
39 AC_LANG_PUSH(C++)
40 AC_LINK_IFELSE([AC_LANG_SOURCE([
41-#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
42+#if !defined(__clang__) && ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5))
43 #error -static-libstdc++ not implemented
44 #endif
45 int main() {}])],
46--
472.26.1
48