https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115416

--- Comment #3 from YunQiang Su <syq at gcc dot gnu.org> ---
Since it doesn't exist, why use --includedir with it?
Anyway, so, maybe we should detect the existence of this dir.
Can you have a try of this patch?

--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -560,10 +560,11 @@ LINKER_PLUGIN_API_H = $(srcdir)/../include/plugin-api.h
 # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
 NATIVE_SYSTEM_HEADER_DIR = @NATIVE_SYSTEM_HEADER_DIR@
 # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
-ifeq (@includedir@,$(prefix)/include)
-  CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
-else
-  CROSS_SYSTEM_HEADER_DIR = @includedir@
+CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
+ifneq (@includedir@,$(prefix)/include)
+  ifneq (,$(wildcard @includedir@))
+    CROSS_SYSTEM_HEADER_DIR = @includedir@
+  endif
 endif

Reply via email to