Browse Source

Don't include subproject headers with -I

Use -iquote instead.  This prevents our include paths from messing up
the system headers depended upon by libstdc++.  (The specific problem
was syscall.h in fesvr/, which was interfering with libstdc++'s
dependence on the system's syscall.h for SYS_futex.)

Subproject headers can now be included in the following ways:

    #include "foo.h"      // for a header local to this subproject
    #include <bar/baz.h>" // for a header in another subproject

But no longer:

    #include <baz.h>      // for a header in any subproject

As a special case, libfdt needs itself to be added to the -I path,
because their coding style is to use angle brackets for local headers.
pull/1619/head
Andrew Waterman 2 years ago
parent
commit
c820d2b9b4
  1. 2
      Makefile.in
  2. 2
      fdt/fdt.mk.in
  3. 2
      riscv/riscv.mk.in

2
Makefile.in

@ -69,7 +69,7 @@ install_exes_dir := $(INSTALLDIR)/bin
sprojs := @subprojects@
sprojs_enabled := @subprojects_enabled@
sprojs_include := -I. -I$(src_dir) $(addprefix -I$(src_dir)/, $(sprojs_enabled))
sprojs_include := -iquote . -I$(src_dir) $(addprefix -iquote $(src_dir)/, $(sprojs_enabled))
VPATH := $(addprefix $(src_dir)/, $(sprojs_enabled))
#-------------------------------------------------------------------------

2
fdt/fdt.mk.in

@ -15,3 +15,5 @@ fdt_c_srcs = \
fdt_empty_tree.c \
fdt_addresses.c \
fdt_overlay.c \
fdt_CFLAGS = -I$(src_dir)/fdt

2
riscv/riscv.mk.in

@ -7,7 +7,7 @@ riscv_subproject_deps = \
fesvr \
softfloat \
riscv_CFLAGS = -fPIC
riscv_CFLAGS = -fPIC -I$(src_dir)/fdt
riscv_install_shared_lib = yes

Loading…
Cancel
Save