public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Christian Bruel <christian.bruel@st.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH]. Fix  HAVE_SYS_SDT_H for cross-compilation
Date: Tue, 18 Dec 2012 15:00:00 -0000	[thread overview]
Message-ID: <50D084CB.5000608@st.com> (raw)
In-Reply-To: <20121218144729.GP2315@tucnak.redhat.com>



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 <sys/sdt.h>
>> #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
> 

  reply	other threads:[~2012-12-18 15:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-18 14:42 Christian Bruel
2012-12-18 14:48 ` Jakub Jelinek
2012-12-18 15:00   ` Christian Bruel [this message]
2013-08-22 14:40 Bill Schmidt
2013-08-22 17:51 ` Jakub Jelinek
2013-08-22 18:39   ` Bill Schmidt
2013-08-29  8:38   ` Christian Bruel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50D084CB.5000608@st.com \
    --to=christian.bruel@st.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).