summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.9/0026-libgcc-sjlj-check.patch
blob: d4efab956a03ab5f65f4d312a88900b9fa3f915e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
From 08c2398445e6cac282488f64ae6bf29cbcd8db23 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 29 Mar 2013 09:20:50 +0400
Subject: [PATCH 26/35] libgcc-sjlj-check

ac_fn_c_try_compile doesnt seem to keep the intermediate files
which are needed for sjlj test to pass since it greps into the
generated file. So we run the compiler command using AC_TRY_COMMAND
which then generates the needed .s file

Signed-off-by: Khem Raj <raj.khem@gmail.com>

Upstream-Status: Pending
---
 libgcc/configure    |   10 ++++++----
 libgcc/configure.ac |   10 ++++------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/libgcc/configure b/libgcc/configure
index 1425df6..d18e3cb 100644
--- a/libgcc/configure
+++ b/libgcc/configure
@@ -4208,17 +4208,19 @@ void foo ()
 }
 
 _ACEOF
-CFLAGS_hold=$CFLAGS
-CFLAGS="--save-temps -fexceptions"
 libgcc_cv_lib_sjlj_exceptions=unknown
-if ac_fn_c_try_compile; then :
+if { ac_try='${CC-cc} -fexceptions -S conftest.c -o conftest.s 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
   if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
     libgcc_cv_lib_sjlj_exceptions=yes
   elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
     libgcc_cv_lib_sjlj_exceptions=no
   fi
 fi
-CFLAGS=$CFLAGS_hold
 rm -f conftest*
 
 fi
diff --git a/libgcc/configure.ac b/libgcc/configure.ac
index 8b7aba5..c7c9644 100644
--- a/libgcc/configure.ac
+++ b/libgcc/configure.ac
@@ -216,16 +216,14 @@ void foo ()
   bar();
 }
 ])])
-CFLAGS_hold=$CFLAGS
-CFLAGS="--save-temps -fexceptions"
 libgcc_cv_lib_sjlj_exceptions=unknown
-AS_IF([ac_fn_c_try_compile],
-  [if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
+if AC_TRY_COMMAND(${CC-cc} -fexceptions -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
+  if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
     libgcc_cv_lib_sjlj_exceptions=yes
   elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
     libgcc_cv_lib_sjlj_exceptions=no
-  fi])
-CFLAGS=$CFLAGS_hold
+  fi
+fi
 rm -f conftest*
 ])
 
-- 
1.7.10.4