From 4411fbe25e9625ca4dd7c94aebc7ffd70b0e5beb Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Mon, 28 Jun 2010 18:25:51 +0000 Subject: [PATCH] Pull in the libCrashReporterClient.a information with a warning comment. Remove library check and regenerate configure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107028 91177308-0d34-0410-b5e6-96231b3b80d8 --- autoconf/configure.ac | 4 -- configure | 88 -------------------------------- include/llvm/Config/config.h.in | 4 -- lib/Support/PrettyStackTrace.cpp | 11 +++- 4 files changed, 9 insertions(+), 98 deletions(-) diff --git a/autoconf/configure.ac b/autoconf/configure.ac index 9977f3f53ab..be320cf3981 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -1248,10 +1248,6 @@ AC_ARG_WITH(oprofile, AC_DEFINE_UNQUOTED([USE_OPROFILE],$USE_OPROFILE, [Define if we have the oprofile JIT-support library]) -dnl gCRAnnotations isn't the function we care about, but it's the only -dnl thing exported. -AC_CHECK_LIB(CrashReporterClient, gCRAnnotations) - dnl===-----------------------------------------------------------------------=== dnl=== dnl=== SECTION 6: Check for header files diff --git a/configure b/configure index 5b67891dd81..dc1b5b3fbe3 100755 --- a/configure +++ b/configure @@ -14775,94 +14775,6 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for gCRAnnotations in -lCrashReporterClient" >&5 -echo $ECHO_N "checking for gCRAnnotations in -lCrashReporterClient... $ECHO_C" >&6; } -if test "${ac_cv_lib_CrashReporterClient_gCRAnnotations+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lCrashReporterClient $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gCRAnnotations (); -int -main () -{ -return gCRAnnotations (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_CrashReporterClient_gCRAnnotations=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_CrashReporterClient_gCRAnnotations=no -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_CrashReporterClient_gCRAnnotations" >&5 -echo "${ECHO_T}$ac_cv_lib_CrashReporterClient_gCRAnnotations" >&6; } -if test $ac_cv_lib_CrashReporterClient_gCRAnnotations = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBCRASHREPORTERCLIENT 1 -_ACEOF - - LIBS="-lCrashReporterClient $LIBS" - -fi - - - diff --git a/include/llvm/Config/config.h.in b/include/llvm/Config/config.h.in index 74d361f8daf..d12f82a9012 100644 --- a/include/llvm/Config/config.h.in +++ b/include/llvm/Config/config.h.in @@ -178,10 +178,6 @@ /* Set to 1 if the isnan function is found in */ #undef HAVE_ISNAN_IN_MATH_H -/* Define to 1 if you have the `CrashReporterClient' library - (-lCrashReporterClient). */ -#undef HAVE_LIBCRASHREPORTERCLIENT - /* Define if you have the libdl library or equivalent. */ #undef HAVE_LIBDL diff --git a/lib/Support/PrettyStackTrace.cpp b/lib/Support/PrettyStackTrace.cpp index e01c491fb3a..2fecce38453 100644 --- a/lib/Support/PrettyStackTrace.cpp +++ b/lib/Support/PrettyStackTrace.cpp @@ -54,8 +54,15 @@ static void PrintCurStackTrace(raw_ostream &OS) { OS.flush(); } -// Integrate with crash reporter. -#if defined (__APPLE__) && !defined (HAVE_CRASHREPORTERCLIENT_H) +// Integrate with crash reporter libraries. +#if defined (__APPLE__) && defined (HAVE_CRASHREPORTERCLIENT_H) +// If any clients of llvm try to link to libCrashReporterClient.a themselves, +// only one crash info struct will be used. +CRASH_REPORTER_CLIENT_HIDDEN +struct crashreporter_annotations_t gCRAnnotations + __attribute__((section("__DATA," CRASHREPORTER_ANNOTATIONS_SECTION))) + = { CRASHREPORTER_ANNOTATIONS_VERSION, 0, 0, 0 }; +#else if defined (__APPLE__) static const char *__crashreporter_info__ = 0; asm(".desc ___crashreporter_info__, 0x10"); #endif -- 2.34.1