public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Refine VxWorks header file path twists for libgcc builds
@ 2017-08-01 13:20 Olivier Hainque
  0 siblings, 0 replies; only message in thread
From: Olivier Hainque @ 2017-08-01 13:20 UTC (permalink / raw)
  To: GCC Patches; +Cc: Olivier Hainque

[-- Attachment #1: Type: text/plain, Size: 1554 bytes --]

Hello,

libgcc/config/t-vxworks twists LIBGCC2_INCLUDE to workaround a problem of
header file name conflicts between the system headers and gcc headers during
libgcc builds:

# This ensures that the correct target headers are used; some
# VxWorks system headers have names that collide with GCC's
# internal (host) headers, e.g. regs.h.
LIBGCC2_INCLUDES = -nostdinc \
   `case "/$(MULTIDIR)" in \
      */mrtp*) echo -I$(WIND_USR)/h -I$(WIND_USR)/h/wrn/coreip ;; \
      *) echo -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip ;; \

As the comment indicates, this is typically preventing #include <regs.h> from
a VxWorks header file to pick gcc's regs.h.

For VxWorks 7 RTPs on ARM, the current twist introduces a symmetrical issue,
with #include "unwind.h" from unwind-arm-common.inc picking unwind.h from a
VxWorks system dir instead of the local libgcc one.

The attached patch fixes this by prepending -I. to the set of options, so
we do pick local libgcc headers first without re-introducing access to the
originally problematic gcc headers.

Tested by verifying success of an in-house build and proper execution of ACATS
tests on a gcc-7 based compiler for arm-vxworks and arm-vxworks7, and checking
that a build for arm-wrs-vxworks proceeds to completion on mainline.

Committing to mainline,

With Kind Regards,

Olivier

2017-08-01  Olivier Hainque  <hainque@adacore.com>

	libgcc/
  	* config/t-vxworks (LIBGCC2_INCLUDES): Start with -I. after -nostdinc.
    	* config/t-vxworks7: Likewise.


[-- Attachment #2: 0002-When-building-libgcc-search-for-the-local-build-subd.patch --]
[-- Type: application/octet-stream, Size: 1902 bytes --]

--- a/libgcc/config/t-vxworks
+++ b/libgcc/config/t-vxworks
@@ -4,10 +4,11 @@ LIBGCC2_DEBUG_CFLAGS =
 # Extra libgcc2 modules used by gthr-vxworks.h functions
 LIB2ADDEH += $(srcdir)/config/vxlib.c $(srcdir)/config/vxlib-tls.c
 
-# This ensures that the correct target headers are used; some
-# VxWorks system headers have names that collide with GCC's
-# internal (host) headers, e.g. regs.h.
-LIBGCC2_INCLUDES = -nostdinc \
+# This ensures that the correct target headers are used; some VxWorks
+# system headers have names that collide with GCC's internal (host)
+# headers, e.g. regs.h. Make sure the local libgcc headers still
+# prevail (e.g. unwind.h).
+LIBGCC2_INCLUDES = -nostdinc -I. \
   `case "/$(MULTIDIR)" in \
      */mrtp*) echo -I$(WIND_USR)/h -I$(WIND_USR)/h/wrn/coreip ;; \
      *) echo -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip ;; \
diff --git a/libgcc/config/t-vxworks7 b/libgcc/config/t-vxworks7
index 77591cd..ae1dff9 100644
--- a/libgcc/config/t-vxworks7
+++ b/libgcc/config/t-vxworks7
@@ -4,11 +4,12 @@ LIBGCC2_DEBUG_CFLAGS =
 # Extra libgcc2 modules used by gthr-vxworks.h functions
 LIB2ADDEH += $(srcdir)/config/vxlib.c $(srcdir)/config/vxlib-tls.c
 
-# This ensures that the correct target headers are used; some
-# VxWorks system headers have names that collide with GCC's
-# internal (host) headers, e.g. regs.h.
+# This ensures that the correct target headers are used; some VxWorks
+# system headers have names that collide with GCC's internal (host)
+# headers, e.g. regs.h. Make sure the local libgcc headers still
+# prevail (e.g. unwind.h).
 LIBGCC2_INCLUDES = -nostdinc \
-  -I$(VSB_DIR)/h -I$(VSB_DIR)/share/h \
+  -I. -I$(VSB_DIR)/h -I$(VSB_DIR)/share/h \
   `case "/$(MULTIDIR)" in \
       */mrtp*) echo -I$(VSB_DIR)/usr/h/public -I$(VSB_DIR)/usr/h ;; \
       *) echo -I$(VSB_DIR)/krnl/h/system -I$(VSB_DIR)/krnl/h/public ;; \
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-08-01 13:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-01 13:20 Refine VxWorks header file path twists for libgcc builds Olivier Hainque

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).