llvm.org GIT mirror llvm / 654dee4
Look for and use a different darwin crash reporter library. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106576 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 9 years ago
4 changed file(s) with 283 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
12471247 AC_DEFINE_UNQUOTED([USE_OPROFILE],$USE_OPROFILE,
12481248 [Define if we have the oprofile JIT-support library])
12491249
1250 dnl gCRAnnotations isn't the function we care about, but it's the only
1251 dnl thing exported.
1252 AC_CHECK_LIB(CrashReporterClient, gCRAnnotations)
1253
12501254 dnl===-----------------------------------------------------------------------===
12511255 dnl===
12521256 dnl=== SECTION 6: Check for header files
12821286 if test "$llvm_cv_enable_libffi" = "yes" ; then
12831287 AC_CHECK_HEADERS([ffi.h ffi/ffi.h])
12841288 fi
1289
1290 dnl Try to find Darwin specific crash reporting library.
1291 AC_CHECK_HEADERS([CrashReporterClient.h])
12851292
12861293 dnl===-----------------------------------------------------------------------===
12871294 dnl===
1477414774
1477514775
1477614776
14777 { echo "$as_me:$LINENO: checking for gCRAnnotations in -lCrashReporterClient" >&5
14778 echo $ECHO_N "checking for gCRAnnotations in -lCrashReporterClient... $ECHO_C" >&6; }
14779 if test "${ac_cv_lib_CrashReporterClient_gCRAnnotations+set}" = set; then
14780 echo $ECHO_N "(cached) $ECHO_C" >&6
14781 else
14782 ac_check_lib_save_LIBS=$LIBS
14783 LIBS="-lCrashReporterClient $LIBS"
14784 cat >conftest.$ac_ext <<_ACEOF
14785 /* confdefs.h. */
14786 _ACEOF
14787 cat confdefs.h >>conftest.$ac_ext
14788 cat >>conftest.$ac_ext <<_ACEOF
14789 /* end confdefs.h. */
14790
14791 /* Override any GCC internal prototype to avoid an error.
14792 Use char because int might match the return type of a GCC
14793 builtin and then its argument prototype would still apply. */
14794 #ifdef __cplusplus
14795 extern "C"
14796 #endif
14797 char gCRAnnotations ();
14798 int
14799 main ()
14800 {
14801 return gCRAnnotations ();
14802 ;
14803 return 0;
14804 }
14805 _ACEOF
14806 rm -f conftest.$ac_objext conftest$ac_exeext
14807 if { (ac_try="$ac_link"
14808 case "(($ac_try" in
14809 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
14810 *) ac_try_echo=$ac_try;;
14811 esac
14812 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
14813 (eval "$ac_link") 2>conftest.er1
14814 ac_status=$?
14815 grep -v '^ *+' conftest.er1 >conftest.err
14816 rm -f conftest.er1
14817 cat conftest.err >&5
14818 echo "$as_me:$LINENO: \$? = $ac_status" >&5
14819 (exit $ac_status); } &&
14820 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
14821 { (case "(($ac_try" in
14822 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
14823 *) ac_try_echo=$ac_try;;
14824 esac
14825 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
14826 (eval "$ac_try") 2>&5
14827 ac_status=$?
14828 echo "$as_me:$LINENO: \$? = $ac_status" >&5
14829 (exit $ac_status); }; } &&
14830 { ac_try='test -s conftest$ac_exeext'
14831 { (case "(($ac_try" in
14832 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
14833 *) ac_try_echo=$ac_try;;
14834 esac
14835 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
14836 (eval "$ac_try") 2>&5
14837 ac_status=$?
14838 echo "$as_me:$LINENO: \$? = $ac_status" >&5
14839 (exit $ac_status); }; }; then
14840 ac_cv_lib_CrashReporterClient_gCRAnnotations=yes
14841 else
14842 echo "$as_me: failed program was:" >&5
14843 sed 's/^/| /' conftest.$ac_ext >&5
14844
14845 ac_cv_lib_CrashReporterClient_gCRAnnotations=no
14846 fi
14847
14848 rm -f core conftest.err conftest.$ac_objext \
14849 conftest$ac_exeext conftest.$ac_ext
14850 LIBS=$ac_check_lib_save_LIBS
14851 fi
14852 { echo "$as_me:$LINENO: result: $ac_cv_lib_CrashReporterClient_gCRAnnotations" >&5
14853 echo "${ECHO_T}$ac_cv_lib_CrashReporterClient_gCRAnnotations" >&6; }
14854 if test $ac_cv_lib_CrashReporterClient_gCRAnnotations = yes; then
14855 cat >>confdefs.h <<_ACEOF
14856 #define HAVE_LIBCRASHREPORTERCLIENT 1
14857 _ACEOF
14858
14859 LIBS="-lCrashReporterClient $LIBS"
14860
14861 fi
14862
14863
14864
1477714865
1477814866
1477914867
1694717035 done
1694817036
1694917037 fi
17038
17039
17040 for ac_header in CrashReporterClient.h
17041 do
17042 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17043 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
17044 { echo "$as_me:$LINENO: checking for $ac_header" >&5
17045 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
17046 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
17047 echo $ECHO_N "(cached) $ECHO_C" >&6
17048 fi
17049 ac_res=`eval echo '${'$as_ac_Header'}'`
17050 { echo "$as_me:$LINENO: result: $ac_res" >&5
17051 echo "${ECHO_T}$ac_res" >&6; }
17052 else
17053 # Is the header compilable?
17054 { echo "$as_me:$LINENO: checking $ac_header usability" >&5
17055 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
17056 cat >conftest.$ac_ext <<_ACEOF
17057 /* confdefs.h. */
17058 _ACEOF
17059 cat confdefs.h >>conftest.$ac_ext
17060 cat >>conftest.$ac_ext <<_ACEOF
17061 /* end confdefs.h. */
17062 $ac_includes_default
17063 #include <$ac_header>
17064 _ACEOF
17065 rm -f conftest.$ac_objext
17066 if { (ac_try="$ac_compile"
17067 case "(($ac_try" in
17068 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17069 *) ac_try_echo=$ac_try;;
17070 esac
17071 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17072 (eval "$ac_compile") 2>conftest.er1
17073 ac_status=$?
17074 grep -v '^ *+' conftest.er1 >conftest.err
17075 rm -f conftest.er1
17076 cat conftest.err >&5
17077 echo "$as_me:$LINENO: \$? = $ac_status" >&5
17078 (exit $ac_status); } &&
17079 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
17080 { (case "(($ac_try" in
17081 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17082 *) ac_try_echo=$ac_try;;
17083 esac
17084 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17085 (eval "$ac_try") 2>&5
17086 ac_status=$?
17087 echo "$as_me:$LINENO: \$? = $ac_status" >&5
17088 (exit $ac_status); }; } &&
17089 { ac_try='test -s conftest.$ac_objext'
17090 { (case "(($ac_try" in
17091 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17092 *) ac_try_echo=$ac_try;;
17093 esac
17094 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17095 (eval "$ac_try") 2>&5
17096 ac_status=$?
17097 echo "$as_me:$LINENO: \$? = $ac_status" >&5
17098 (exit $ac_status); }; }; then
17099 ac_header_compiler=yes
17100 else
17101 echo "$as_me: failed program was:" >&5
17102 sed 's/^/| /' conftest.$ac_ext >&5
17103
17104 ac_header_compiler=no
17105 fi
17106
17107 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17108 { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
17109 echo "${ECHO_T}$ac_header_compiler" >&6; }
17110
17111 # Is the header present?
17112 { echo "$as_me:$LINENO: checking $ac_header presence" >&5
17113 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
17114 cat >conftest.$ac_ext <<_ACEOF
17115 /* confdefs.h. */
17116 _ACEOF
17117 cat confdefs.h >>conftest.$ac_ext
17118 cat >>conftest.$ac_ext <<_ACEOF
17119 /* end confdefs.h. */
17120 #include <$ac_header>
17121 _ACEOF
17122 if { (ac_try="$ac_cpp conftest.$ac_ext"
17123 case "(($ac_try" in
17124 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17125 *) ac_try_echo=$ac_try;;
17126 esac
17127 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17128 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
17129 ac_status=$?
17130 grep -v '^ *+' conftest.er1 >conftest.err
17131 rm -f conftest.er1
17132 cat conftest.err >&5
17133 echo "$as_me:$LINENO: \$? = $ac_status" >&5
17134 (exit $ac_status); } >/dev/null; then
17135 if test -s conftest.err; then
17136 ac_cpp_err=$ac_c_preproc_warn_flag
17137 ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
17138 else
17139 ac_cpp_err=
17140 fi
17141 else
17142 ac_cpp_err=yes
17143 fi
17144 if test -z "$ac_cpp_err"; then
17145 ac_header_preproc=yes
17146 else
17147 echo "$as_me: failed program was:" >&5
17148 sed 's/^/| /' conftest.$ac_ext >&5
17149
17150 ac_header_preproc=no
17151 fi
17152
17153 rm -f conftest.err conftest.$ac_ext
17154 { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
17155 echo "${ECHO_T}$ac_header_preproc" >&6; }
17156
17157 # So? What about this header?
17158 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
17159 yes:no: )
17160 { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
17161 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
17162 { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
17163 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
17164 ac_header_preproc=yes
17165 ;;
17166 no:yes:* )
17167 { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
17168 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
17169 { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
17170 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
17171 { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
17172 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
17173 { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
17174 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
17175 { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
17176 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
17177 { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
17178 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
17179 ( cat <<\_ASBOX
17180 ## ----------------------------------- ##
17181 ## Report this to llvmbugs@cs.uiuc.edu ##
17182 ## ----------------------------------- ##
17183 _ASBOX
17184 ) | sed "s/^/$as_me: WARNING: /" >&2
17185 ;;
17186 esac
17187 { echo "$as_me:$LINENO: checking for $ac_header" >&5
17188 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
17189 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
17190 echo $ECHO_N "(cached) $ECHO_C" >&6
17191 else
17192 eval "$as_ac_Header=\$ac_header_preproc"
17193 fi
17194 ac_res=`eval echo '${'$as_ac_Header'}'`
17195 { echo "$as_me:$LINENO: result: $ac_res" >&5
17196 echo "${ECHO_T}$ac_res" >&6; }
17197
17198 fi
17199 if test `eval echo '${'$as_ac_Header'}'` = yes; then
17200 cat >>confdefs.h <<_ACEOF
17201 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17202 _ACEOF
17203
17204 fi
17205
17206 done
17207
1695017208
1695117209
1695217210
6161
6262 /* Define to 1 if you have the `closedir' function. */
6363 #undef HAVE_CLOSEDIR
64
65 /* Define to 1 if you have the header file. */
66 #undef HAVE_CRASHREPORTERCLIENT_H
6467
6568 /* Define to 1 if you have the header file. */
6669 #undef HAVE_CTYPE_H
174177 /* Set to 1 if the isnan function is found in */
175178 #undef HAVE_ISNAN_IN_MATH_H
176179
180 /* Define to 1 if you have the `CrashReporterClient' library
181 (-lCrashReporterClient). */
182 #undef HAVE_LIBCRASHREPORTERCLIENT
183
177184 /* Define if you have the libdl library or equivalent. */
178185 #undef HAVE_LIBDL
179186
1111 //
1212 //===----------------------------------------------------------------------===//
1313
14 #include "llvm/Config/config.h" // Get autoconf configuration settings
1415 #include "llvm/Support/PrettyStackTrace.h"
1516 #include "llvm/Support/raw_ostream.h"
1617 #include "llvm/System/Signals.h"
1718 #include "llvm/System/ThreadLocal.h"
1819 #include "llvm/ADT/SmallString.h"
20
21 #ifdef HAVE_CRASHREPORTERCLIENT_H
22 #include
23 #endif
24
1925 using namespace llvm;
2026
2127 namespace llvm {
4854 }
4955
5056 // Integrate with crash reporter.
51 #ifdef __APPLE__
57 #if defined (__APPLE__) && !defined (HAVE_CRASHREPORTERCLIENT_H)
5258 static const char *__crashreporter_info__ = 0;
5359 asm(".desc ___crashreporter_info__, 0x10");
5460 #endif
7076 }
7177
7278 if (!TmpStr.empty()) {
79 #ifndef HAVE_CRASHREPORTERCLIENT_H
7380 __crashreporter_info__ = strdup(std::string(TmpStr.str()).c_str());
81 #else
82 CRSetCrashLogMessage(std::string(TmpStr.str()).c_str());
83 #endif
7484 errs() << TmpStr.str();
7585 }
7686