blob: 01a4d1fdab4899d9f4925fce5b69260d209a5ce5 [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001From 7b40212ed6c0c9fe4efe51f31bccd3d9f892f238 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:20:50 +0400
4Subject: [PATCH 19/46] libgcc-sjlj-check
5
6ac_fn_c_try_compile doesnt seem to keep the intermediate files
7which are needed for sjlj test to pass since it greps into the
8generated file. So we run the compiler command using AC_TRY_COMMAND
9which then generates the needed .s file
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12
13Upstream-Status: Pending
14---
15 libgcc/configure | 10 ++++++----
16 libgcc/configure.ac | 10 ++++------
17 2 files changed, 10 insertions(+), 10 deletions(-)
18
19diff --git a/libgcc/configure b/libgcc/configure
20index 203d384..6aef3e7 100644
21--- a/libgcc/configure
22+++ b/libgcc/configure
23@@ -4570,17 +4570,19 @@ void foo ()
24 }
25
26 _ACEOF
27-CFLAGS_hold=$CFLAGS
28-CFLAGS="--save-temps -fexceptions"
29 libgcc_cv_lib_sjlj_exceptions=unknown
30-if ac_fn_c_try_compile; then :
31+if { ac_try='${CC-cc} -fexceptions -S conftest.c -o conftest.s 1>&5'
32+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
33+ (eval $ac_try) 2>&5
34+ ac_status=$?
35+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
36+ test $ac_status = 0; }; }; then
37 if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
38 libgcc_cv_lib_sjlj_exceptions=yes
39 elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
40 libgcc_cv_lib_sjlj_exceptions=no
41 fi
42 fi
43-CFLAGS=$CFLAGS_hold
44 rm -f conftest*
45
46 fi
47diff --git a/libgcc/configure.ac b/libgcc/configure.ac
48index a10a952..cc324f3 100644
49--- a/libgcc/configure.ac
50+++ b/libgcc/configure.ac
51@@ -255,16 +255,14 @@ void foo ()
52 bar();
53 }
54 ])])
55-CFLAGS_hold=$CFLAGS
56-CFLAGS="--save-temps -fexceptions"
57 libgcc_cv_lib_sjlj_exceptions=unknown
58-AS_IF([ac_fn_c_try_compile],
59- [if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
60+if AC_TRY_COMMAND(${CC-cc} -fexceptions -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
61+ if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
62 libgcc_cv_lib_sjlj_exceptions=yes
63 elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
64 libgcc_cv_lib_sjlj_exceptions=no
65- fi])
66-CFLAGS=$CFLAGS_hold
67+ fi
68+fi
69 rm -f conftest*
70 ])
71
72--
732.6.3
74