From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 96596 invoked by alias); 1 Aug 2017 13:20:55 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 96568 invoked by uid 89); 1 Aug 2017 13:20:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=twist, Hx-languages-length:1545, in-house, inhouse X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 01 Aug 2017 13:20:52 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id D4682813ED; Tue, 1 Aug 2017 15:20:50 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Uj34YwJvgTxU; Tue, 1 Aug 2017 15:20:50 +0200 (CEST) Received: from idefix.act-europe.fr (idefix.act-europe.fr [10.10.1.101]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id BD031813E2; Tue, 1 Aug 2017 15:20:50 +0200 (CEST) From: Olivier Hainque Content-Type: multipart/mixed; boundary="Apple-Mail=_0E522911-92B1-4B76-B6B3-37AAEC8B93C5" Subject: Refine VxWorks header file path twists for libgcc builds Date: Tue, 01 Aug 2017 13:20:00 -0000 Message-Id: <168C0D93-639C-4DFF-A34F-AC1863B1A0B2@adacore.com> Cc: Olivier Hainque To: GCC Patches Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) X-SW-Source: 2017-08/txt/msg00078.txt.bz2 --Apple-Mail=_0E522911-92B1-4B76-B6B3-37AAEC8B93C5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Content-length: 1523 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 =3D -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 fr= om 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 AC= ATS tests on a gcc-7 based compiler for arm-vxworks and arm-vxworks7, and check= ing that a build for arm-wrs-vxworks proceeds to completion on mainline. Committing to mainline, With Kind Regards, Olivier 2017-08-01 Olivier Hainque libgcc/ * config/t-vxworks (LIBGCC2_INCLUDES): Start with -I. after -nostdinc. * config/t-vxworks7: Likewise. --Apple-Mail=_0E522911-92B1-4B76-B6B3-37AAEC8B93C5 Content-Disposition: attachment; filename=0002-When-building-libgcc-search-for-the-local-build-subd.patch Content-Type: application/octet-stream; name="0002-When-building-libgcc-search-for-the-local-build-subd.patch" Content-Transfer-Encoding: 7bit Content-length: 1902 --- 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 --Apple-Mail=_0E522911-92B1-4B76-B6B3-37AAEC8B93C5--