This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]. Fix HAVE_SYS_SDT_H for cross-compilation
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Christian Bruel <christian dot bruel at st dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 18 Dec 2012 15:47:30 +0100
- Subject: Re: [PATCH]. Fix HAVE_SYS_SDT_H for cross-compilation
- References: <50D080B6.6080509@st.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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
so the question is why it found a host header instead in your case.
Jakub