public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5858] Provide vxworks alternate stdint.h during the build
@ 2021-12-09 15:57 Olivier Hainque
  0 siblings, 0 replies; only message in thread
From: Olivier Hainque @ 2021-12-09 15:57 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:6a0f6018ba41658b9b85ad82ed1bd748754f3eca

commit r12-5858-g6a0f6018ba41658b9b85ad82ed1bd748754f3eca
Author: Olivier Hainque <hainque@adacore.com>
Date:   Sun Nov 28 15:21:25 2021 +0000

    Provide vxworks alternate stdint.h during the build
    
    This change arranges to provide the vxworks alternate stdint.h
    at build time instead of at install time, so it is used instead
    of the system one while building the libraries.
    
    This is a lot more consistent and helps the build on configurations
    where the system does not come with stdint.h at all.
    
    The change uses a similar mechanism as the one previsouly introduced
    for glimits.h and takes the opportunity to simplify the glimits.h
    command to use an automatic variable.
    
    This introduces an indirect dependency on the VxWorks version.h
    for vxcrtstuff objects, for which we then need to apply the same
    tricks as for libgcc2 regarding include paths (to select the system
    header instead of the gcc one).
    
    2021-02-12  Olivier Hainque  <hainque@adacore.com>
                Rasmus Villemoes  <rv@rasmusvillemoes.dk>
    
    gcc/
            * Makefile.in (T_STDINT_GCC_H): New variable, path to
            stdint-gcc.h that a target configuration may override when
            use_gcc_stdint is "provide".
            (stmp-int-hdrs): Depend on it and copy that for
            USE_GCC_INT=provide.
            * config.gcc (vxworks): Revert to use_gcc_stdint=provide.
            * config/t-vxworks (T_STDINT_GCC_H): Define, as vxw-stdint-gcc.h.
            (vxw-stdint-gcc.h): New target, produced from the original
            stdint-gcc.h.
            (vxw-glimits.h): Use an automatic variable to designate the
            first and only prerequisite.
            * config/vxworks/stdint.h: Remove.
    
    libgcc/
            * config/t-vxworks: Set CRTSTUFF_T_CFLAGS to
            $(LIBGCC2_INCLUDES).
            * config/t-vxworks7: Likewise.

Diff:
---
 gcc/Makefile.in             |  5 +++--
 gcc/config.gcc              | 11 ++---------
 gcc/config/t-vxworks        | 22 +++++++++-------------
 gcc/config/vxworks/stdint.h | 28 ----------------------------
 libgcc/config/t-vxworks     |  2 ++
 libgcc/config/t-vxworks7    |  2 ++
 6 files changed, 18 insertions(+), 52 deletions(-)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 2a0be9e66a6..41949f0f392 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -452,6 +452,7 @@ USER_H_INC_NEXT_POST = @user_headers_inc_next_post@
 
 # Enable target overriding of this fragment, as in config/t-vxworks.
 T_GLIMITS_H = $(srcdir)/glimits.h
+T_STDINT_GCC_H = $(srcdir)/ginclude/stdint-gcc.h
 
 # The GCC to use for compiling crt*.o.
 # Usually the one we just built.
@@ -3099,7 +3100,7 @@ gcov-tool$(exeext): $(GCOV_TOOL_OBJS) $(LIBDEPS)
 # be rebuilt.
 
 # Build the include directories.
-stmp-int-hdrs: $(STMP_FIXINC) $(T_GLIMITS_H) $(USER_H) fixinc_list
+stmp-int-hdrs: $(STMP_FIXINC) $(T_GLIMITS_H) $(T_STDINT_GCC_H) $(USER_H) fixinc_list
 # Copy in the headers provided with gcc.
 #
 # The sed command gets just the last file name component;
@@ -3145,7 +3146,7 @@ stmp-int-hdrs: $(STMP_FIXINC) $(T_GLIMITS_H) $(USER_H) fixinc_list
 	  cp $(srcdir)/ginclude/stdint-wrap.h include/stdint.h; \
 	  chmod a+r include/stdint.h; \
 	elif [ $(USE_GCC_STDINT) = provide ]; then \
-	  cp $(srcdir)/ginclude/stdint-gcc.h include/stdint.h; \
+	  cp $(T_STDINT_GCC_H) include/stdint.h; \
 	  chmod a+r include/stdint.h; \
 	fi
 	set -e; for ml in `cat fixinc_list`; do \
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 1ca9d364ff0..c8824367b13 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1019,16 +1019,9 @@ case ${target} in
   extra_headers="${extra_headers} ../vxworks/math.h ../vxworks/complex.h"
   extra_headers="${extra_headers} ../vxworks/inttypes.h ../vxworks/setjmp.h"
 
-  # We provide stdint.h ...
-
+  # We provide (a tailored version of) stdint.h
   tm_file="${tm_file} vxworks-stdint.h"
-
-  # .. only through the yvals conditional wrapping mentioned above
-  # to abide by the VxWorks 7 expectations.  The final copy is performed
-  # explicitly by a t-vxworks Makefile rule.
-
-  use_gcc_stdint=none
-  extra_headers="${extra_headers} ../../ginclude/stdint-gcc.h"
+  use_gcc_stdint=provide
 
   case ${enable_threads} in
     no) ;;
diff --git a/gcc/config/t-vxworks b/gcc/config/t-vxworks
index 5a06ebe1b87..8441af2a8cf 100644
--- a/gcc/config/t-vxworks
+++ b/gcc/config/t-vxworks
@@ -24,18 +24,6 @@ vxworks-c.o: $(srcdir)/config/vxworks-c.c
 	$(COMPILE) $<
 	$(POSTCOMPILE)
 
-# Arrange to install our stdint.h wrapper, by copying it in the
-# build-time include dir before this include dir is installed and after
-# stmp-int-hdrs removes it (because it was told we don't provide it).
-
-INSTALL_HEADERS += install-stdint.h
-
-install-stdint.h: stmp-int-hdrs
-	cp -p $(srcdir)/config/vxworks/stdint.h include/stdint.h
-	chmod a+r include/stdint.h
-
-$(INSTALL_HEADERS_DIR): install-stdint.h
-
 # Both the kernel and RTP headers provide limits.h.  They embed VxWorks
 # specificities and are dated on some configurations so we both need to
 # provide our own version and make sure the system one gets exposed.
@@ -54,5 +42,13 @@ T_GLIMITS_H = vxw-glimits.h
 
 vxw-glimits.h: $(srcdir)/glimits.h
 	ID=`echo $(BASEVER_c) | sed -e 's/\./_/g'` && \
-	sed -e "s/_LIMITS_H__/_LIMITS_H__$${ID}_/" < $(srcdir)/glimits.h > $@T
+	sed -e "s/_LIMITS_H__/_LIMITS_H__$${ID}_/" < $< > $@T
+	mv $@T $@
+
+# Arrange to "provide" a tailored version of stdint-gcc.h
+
+T_STDINT_GCC_H = vxw-stdint-gcc.h
+
+vxw-stdint-gcc.h: $(srcdir)/ginclude/stdint-gcc.h
+	sed -e "/#define _GCC_STDINT_H/ a #include <_yvals.h>" < $< > $@T
 	mv $@T $@
diff --git a/gcc/config/vxworks/stdint.h b/gcc/config/vxworks/stdint.h
deleted file mode 100644
index 5e0dbdfaabd..00000000000
--- a/gcc/config/vxworks/stdint.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 3, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-<http://www.gnu.org/licenses/>.  */
-
-#ifndef __GCC_STDINT_H
-#define __GCC_STDINT_H
-
-#include <_yvals.h>
-#include <stdint-gcc.h>
-
-#endif
diff --git a/libgcc/config/t-vxworks b/libgcc/config/t-vxworks
index b4bb85bff08..5f7ced8b561 100644
--- a/libgcc/config/t-vxworks
+++ b/libgcc/config/t-vxworks
@@ -17,3 +17,5 @@ LIBGCC2_INCLUDES = -nostdinc -I. \
      */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 ;; \
    esac`
+
+CRTSTUFF_T_CFLAGS = $(LIBGCC2_INCLUDES)
diff --git a/libgcc/config/t-vxworks7 b/libgcc/config/t-vxworks7
index 6ddd3e84f33..180784bf3a1 100644
--- a/libgcc/config/t-vxworks7
+++ b/libgcc/config/t-vxworks7
@@ -18,3 +18,5 @@ LIBGCC2_INCLUDES = -nostdinc -I. \
       */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 ;; \
    esac`
+
+CRTSTUFF_T_CFLAGS = $(LIBGCC2_INCLUDES)


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

only message in thread, other threads:[~2021-12-09 15:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-09 15:57 [gcc r12-5858] Provide vxworks alternate stdint.h during the build 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).