From patchwork Sun Aug 30 01:04:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 512179 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5DA361401AF for ; Sun, 30 Aug 2015 11:05:03 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=Wwrab+Kj; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id; q=dns; s=default; b=NEx2x3tzvzmdQNO Zyc///syi+izdgjInk0MBJL4kQkZI3G88Mt9QF1sJYY3GynI2xaB+B2n8IfOIf6E fiRdjni7ctLaD8NqCduYp1N9nS4h0/KLKkn+aeOkvzO/lcKJMrr1UUP6iVcGLk86 yFTTh+lOKq5TRhHx/nFkFglyLpOA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id; s=default; bh=0uH9Yhz0QfwESHc7GFKRw eLGfS4=; b=Wwrab+Kjm31tJ70+wFKTsBSmTOl+28hwRmt7yUrLJ+PpzJ2OFFMRd 2bvqay+dC34fW0mdkrqWQmq0NhaAjzdJnLZKOB5T2zbU5bKhXTxS1N8NzU01OdV5 QHYzXgjM12Xy/vde7s1VC6z8e9hDhQFoyPEsBwdevLbBHh4aZVW06k= Received: (qmail 39326 invoked by alias); 30 Aug 2015 01:04:54 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 39316 invoked by uid 89); 30 Aug 2015 01:04:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.0 required=5.0 tests=AWL, BAYES_50, RP_MATCHES_RCVD, SPF_PASS, URIBL_BLACK autolearn=no version=3.3.2 X-HELO: smtp.gentoo.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 30 Aug 2015 01:04:50 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 6593334099A for ; Sun, 30 Aug 2015 01:04:48 +0000 (UTC) From: Mike Frysinger To: gcc-patches@gcc.gnu.org Subject: [PATCH] boehm-gc: check for execinfo.h directly Date: Sat, 29 Aug 2015 21:04:46 -0400 Message-Id: <1440896686-10729-1-git-send-email-vapier@gentoo.org> The current header depends on glibc version checks to determine whether execinfo.h exists which breaks uClibc. Instead, add an explicit configure check for it. 2015-08-29 Mike Frysinger * configure.ac: Call AC_CHECK_HEADERS([execinfo.h]). * configure: Regenerated. * include/gc.h [HAVE_EXECINFO_H]: Define GC_HAVE_BUILTIN_BACKTRACE. * include/gc_config.h.in: Regenerated. --- boehm-gc/configure | 105 +++++++++++++++++++++++++++++++++++++++- boehm-gc/configure.ac | 3 ++ boehm-gc/include/gc.h | 2 +- boehm-gc/include/gc_config.h.in | 3 ++ 4 files changed, 110 insertions(+), 3 deletions(-) diff --git a/boehm-gc/configure b/boehm-gc/configure index a8e11da..7d2b1f7 100755 --- a/boehm-gc/configure +++ b/boehm-gc/configure @@ -1945,6 +1945,93 @@ $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_member + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -11322,7 +11409,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11325 "configure" +#line 11412 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11428,7 +11515,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11431 "configure" +#line 11518 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15053,6 +15140,20 @@ fi ;; esac +# Check for various headers. +for ac_header in execinfo.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "execinfo.h" "ac_cv_header_execinfo_h" "$ac_includes_default" +if test "x$ac_cv_header_execinfo_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_EXECINFO_H 1 +_ACEOF + +fi + +done + + # extra LD Flags which are required for targets case "${host}" in *-*-darwin*) diff --git a/boehm-gc/configure.ac b/boehm-gc/configure.ac index 1ccfe37..ea90ab2 100644 --- a/boehm-gc/configure.ac +++ b/boehm-gc/configure.ac @@ -317,6 +317,9 @@ case "$host" in ;; esac +# Check for various headers. +AC_CHECK_HEADERS([execinfo.h]) + # extra LD Flags which are required for targets case "${host}" in *-*-darwin*) diff --git a/boehm-gc/include/gc.h b/boehm-gc/include/gc.h index 6b38f2d..bf50b29 100644 --- a/boehm-gc/include/gc.h +++ b/boehm-gc/include/gc.h @@ -503,7 +503,7 @@ GC_API GC_PTR GC_malloc_atomic_ignore_off_page GC_PROTO((size_t lb)); #if defined(__linux__) || defined(__GLIBC__) # include # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \ - && !defined(__ia64__) + && !defined(__ia64__) && defined(HAVE_EXECINFO_H) # ifndef GC_HAVE_BUILTIN_BACKTRACE # define GC_HAVE_BUILTIN_BACKTRACE # endif diff --git a/boehm-gc/include/gc_config.h.in b/boehm-gc/include/gc_config.h.in index 7ef9822..818ce09 100644 --- a/boehm-gc/include/gc_config.h.in +++ b/boehm-gc/include/gc_config.h.in @@ -75,6 +75,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H +/* Define to 1 if you have the header file. */ +#undef HAVE_EXECINFO_H + /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H