From: Olivier Hainque <hainque@adacore.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Olivier Hainque <hainque@adacore.com>
Subject: Refine VxWorks header file path twists for libgcc builds
Date: Tue, 01 Aug 2017 13:20:00 -0000 [thread overview]
Message-ID: <168C0D93-639C-4DFF-A34F-AC1863B1A0B2@adacore.com> (raw)
[-- 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
reply other threads:[~2017-08-01 13:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=168C0D93-639C-4DFF-A34F-AC1863B1A0B2@adacore.com \
--to=hainque@adacore.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).