From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21195 invoked by alias); 18 Dec 2012 15:00:17 -0000 Received: (qmail 21175 invoked by uid 22791); 18 Dec 2012 15:00:14 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from eu1sys200aog114.obsmtp.com (HELO eu1sys200aog114.obsmtp.com) (207.126.144.137) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 18 Dec 2012 14:59:43 +0000 Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob114.postini.com ([207.126.147.11]) with SMTP ID DSNKUNCE2yxxiDKO0ClDqwT+jSboRWZ98WyF@postini.com; Tue, 18 Dec 2012 14:59:42 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A109D15B; Tue, 18 Dec 2012 14:59:24 +0000 (GMT) Received: from Webmail-eu.st.com (safex1hubcas1.st.com [10.75.90.14]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 0B61C4982; Tue, 18 Dec 2012 14:59:22 +0000 (GMT) Received: from [164.129.122.89] (164.129.122.89) by webmail-eu.st.com (10.75.90.13) with Microsoft SMTP Server (TLS) id 8.3.245.1; Tue, 18 Dec 2012 15:59:23 +0100 Message-ID: <50D084CB.5000608@st.com> Date: Tue, 18 Dec 2012 15:00:00 -0000 From: Christian Bruel User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Jakub Jelinek Cc: "gcc-patches@gcc.gnu.org" Subject: Re: [PATCH]. Fix HAVE_SYS_SDT_H for cross-compilation References: <50D080B6.6080509@st.com> <20121218144729.GP2315@tucnak.redhat.com> In-Reply-To: <20121218144729.GP2315@tucnak.redhat.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-12/txt/msg01124.txt.bz2 On 12/18/2012 03:47 PM, Jakub Jelinek wrote: > On Tue, Dec 18, 2012 at 03:41:58PM +0100, Christian Bruel wrote: >> Canadian Cross Builds fail to build libgcc/unwind-dw2.c >> >> ... >> ../../../../libgcc/unwind-dw2.c:42:21: fatal error: sys/sdt.h: No such >> file or directory >> ... >> >> when the build machine has sys/sdt.h installed (systemtap-sdt-devel), >> but not the target's, because of this: >> >> #ifdef HAVE_SYS_SDT_H >> #include >> #endif >> >> This appears to be because auto-host.h unconditionally defines >> HAVE_SYS_SDT_H from config.in, that should be guarded with #ifndef >> USED_FOR_TARGET >> >> This patch changes the sys/sdt.h detection to the standard macro to >> correctly generate it. And need to regenerate configure and config.in. >> >> Checked for x86 native boostrap OK and SH4-linux Cross and Native builds >> on host (with and without systemtap host header installed) >> >> OK for trunk ? > > That doesn't look like a correct fix. If HAVE_SYS_SDT_H define is always > guarded with #ifndef USED_FOR_TARGET, then it will never be used in the > target unwind-dw2.c where it is supposed to be used if available. > The configury snippet was clearly looking for target sys/sdt.h header: > if test -f $target_header_dir/sys/sdt.h; then > have_sys_sdt_h=yes > Well, it should be used by unwind-dw2.c, because we have #include "tconfig.h" that includes it: #ifndef GCC_TCONFIG_H #define GCC_TCONFIG_H #ifndef USED_FOR_TARGET # define USED_FOR_TARGET #endif #include "auto-host.h" in which there is : #ifndef USED_FOR_TARGET #define HAVE_SYS_SDT_H 1 #endif So HAVE_SYS_SDT will be defined in unwind-dw2.c on system that need it. > so the question is why it found a host header instead in your case. This is for everyone. The auto-host.h is used commonly for the target, unded the definition of 'USED_FOR_TARGET' Cheers Christian > > Jakub >