Port upstream LLVM commits to fix bb #8723.

commit 481d402ab03e163e180d2650fae13704858f8d81
Author: Eric Christopher <echristo@apple.com>
Date:   Fri Dec 3 07:45:22 2010 +0000

    Apparently OS X 10.4 doesn't have __crashreporter_info__.

    Try to fix building on the wayback machine.

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120801 91177308-0d34-0410-b5e6-96231b3b80d8

commit 51e57139b3fdcf6b25453fa987463b33ff8f9adc
Author: Eric Christopher <echristo@apple.com>
Date:   Tue Dec 7 02:05:42 2010 +0000

    Two things: Fix testcase to use extern - otherwise the link will always
    succeed. Also make the testcase clearer as to what we're doing and
    emit a checking notification to the log.

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121101 91177308-0d34-0410-b5e6-96231b3b80d8
remotes/push_mirror/vc9-vt-dnd
Török Edvin 15 years ago
parent 5007986ffd
commit 7d0f0d41af
  1. 4
      ChangeLog
  2. 18
      libclamav/c++/llvm/autoconf/configure.ac
  3. 27
      libclamav/c++/llvm/configure
  4. 3
      libclamav/c++/llvm/include/llvm/Config/config.h.in
  5. 10
      libclamav/c++/llvm/lib/Support/PrettyStackTrace.cpp

@ -1,3 +1,7 @@
Thu Jan 20 10:11:32 EET 2011 (edwin)
------------------------------------
* libclamav/c++/llvm: port 2 upstream commits to fix bb#8723.
Thu Jan 20 10:02:24 EET 2011 (edwin)
------------------------------------
* unit_tests/check_bytecode.c: fix build on etch (bb #2399),

@ -1272,9 +1272,25 @@ if test "$llvm_cv_enable_libffi" = "yes" ; then
AC_CHECK_HEADERS([ffi.h ffi/ffi.h])
fi
dnl Try to find Darwin specific crash reporting library.
dnl Try to find Darwin specific crash reporting libraries.
AC_CHECK_HEADERS([CrashReporterClient.h])
dnl Try to find Darwin specific crash reporting global.
AC_MSG_CHECKING([__crashreporter_info__])
AC_LINK_IFELSE(
AC_LANG_SOURCE(
[[extern const char *__crashreporter_info__;
int main() {
__crashreporter_info__ = "test";
return 0;
}
]]),
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_CRASHREPORTER_INFO, 1, Can use __crashreporter_info__),
AC_MSG_RESULT(no)
AC_DEFINE(HAVE_CRASHREPORTER_INFO, 0,
Define if __crashreporter_info__ exists.))
dnl===-----------------------------------------------------------------------===
dnl===
dnl=== SECTION 7: Check for types and structures

@ -11631,6 +11631,33 @@ fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking __crashreporter_info__" >&5
$as_echo_n "checking __crashreporter_info__... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
extern const char *__crashreporter_info__;
int main() {
__crashreporter_info__ = "test";
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
$as_echo "#define HAVE_CRASHREPORTER_INFO 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
$as_echo "#define HAVE_CRASHREPORTER_INFO 0" >>confdefs.h
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext

@ -72,6 +72,9 @@
/* Define to 1 if you have the <CrashReporterClient.h> header file. */
#undef HAVE_CRASHREPORTERCLIENT_H
/* Define if __crashreporter_info__ exists. */
#undef HAVE_CRASHREPORTER_INFO
/* Define to 1 if you have the <ctype.h> header file. */
#undef HAVE_CTYPE_H

@ -55,7 +55,7 @@ static void PrintCurStackTrace(raw_ostream &OS) {
}
// Integrate with crash reporter libraries.
#if defined (__APPLE__) && defined (HAVE_CRASHREPORTERCLIENT_H)
#if defined (__APPLE__) && HAVE_CRASHREPORTERCLIENT_H
// If any clients of llvm try to link to libCrashReporterClient.a themselves,
// only one crash info struct will be used.
extern "C" {
@ -64,7 +64,7 @@ struct crashreporter_annotations_t gCRAnnotations
__attribute__((section("__DATA," CRASHREPORTER_ANNOTATIONS_SECTION)))
= { CRASHREPORTER_ANNOTATIONS_VERSION, 0, 0, 0, 0 };
}
#elif defined (__APPLE__)
#elif defined (__APPLE__) && HAVE_CRASHREPORTER_INFO
static const char *__crashreporter_info__ = 0;
asm(".desc ___crashreporter_info__, 0x10");
#endif
@ -86,11 +86,11 @@ static void CrashHandler(void *) {
}
if (!TmpStr.empty()) {
#ifndef HAVE_CRASHREPORTERCLIENT_H
__crashreporter_info__ = strdup(std::string(TmpStr.str()).c_str());
#else
#ifdef HAVE_CRASHREPORTERCLIENT_H
// Cast to void to avoid warning.
(void)CRSetCrashLogMessage(std::string(TmpStr.str()).c_str());
#elif HAVE_CRASHREPORTER_INFO
__crashreporter_info__ = strdup(std::string(TmpStr.str()).c_str());
#endif
errs() << TmpStr.str();
}

Loading…
Cancel
Save