https://sourceware.org/bugzilla/show_bug.cgi?id=33103

--- Comment #4 from Sergei Trofimovich <slyich at gmail dot com> ---
(In reply to Mark Wielaard from comment #3)
> I don't understand why this is only a problem with srcdir == builddir.

AFAIU the difference in in-tree/out-of-tree is the following:

in-tree:

    - builder process is in src/
    - src/ contains freshly built 'stack' binary
    - clang is ran as 'clang++ -iquote . -I . srcfiles.cxx'
    - <stack> is looked up from '-I .' and finds ./stack ELF

out-of-tree:

    - builder process is in build-tree/src/
    - build-tree/src/ contains freshly built 'stack' binary
    - clang is ran as 'clang++ -iquote . -I ../../src srcfiles.cxx'
    - <stack> is looked up from '-I ../../src' and does not find ./stack (as
it's in current ./stack build tree, source tree is clean)

> But maybe we can extend the original solution to use -iquote for srcdir. And
> only have -I for lib and the top builddir (for <config.h>)?
> 
> Does the following work for you?
> 
> diff --git a/config/eu.am b/config/eu.am
> index 5157a34ee552..1361044804f5 100644
> --- a/config/eu.am
> +++ b/config/eu.am
> @@ -31,7 +31,7 @@
>  ##
>  
>  DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"'
> -AM_CPPFLAGS = -iquote . -I$(srcdir) -I$(top_srcdir)/lib -I..
> +AM_CPPFLAGS = -iquote. -iquote$(srcdir) -I$(top_srcdir)/lib
> -I$(abs_top_builddir)
>  
>  # Drop the 'u' flag that automake adds by default. It is incompatible
>  # with deterministic archives.
> diff --git a/libdw/libdwP.h b/libdw/libdwP.h
> index 25d53d31c7c8..b77db1423fe0 100644
> --- a/libdw/libdwP.h
> +++ b/libdw/libdwP.h
> @@ -32,8 +32,8 @@
>  #include <stdbool.h>
>  #include <pthread.h>
>  
> -#include <libdw.h>
> -#include <dwarf.h>
> +#include "libdw.h"
> +#include "dwarf.h"
>  #include "eu-search.h"

Yes, I confirm that fixes build failure for my in-tree clang setup.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to