Hi!

I've now also run into this issue, during contrib/config-list.mk testing;
log/arm-wrs-vxworks-make.out, log/i686-wrs-vxworks-make.out,
log/i686-wrs-vxworksae-make.out, log/mips-wrs-vxworks-make.out,
log/powerpc-wrs-vxworks-make.out, log/powerpc-wrs-vxworksae-make.out,
log/powerpc-wrs-vxworksmils-make.out, log/sh-wrs-vxworks-make.out,
log/sparc-wrs-vxworks-make.out:

    [...]/build-multi/arm-wrs-vxworks/./gcc/xgcc 
-B[...]/build-multi/arm-wrs-vxworks/./gcc/ -xc -S -c /dev/null -fself-test
    xgcc: fatal error: environment variable 'WIND_BASE' not defined
    compilation terminated.
    make[2]: *** [s-selftest] Error 1
    [...]
    make[1]: *** [all-gcc] Error 2

On Thu, 30 Jun 2016 16:09:23 -0400, David Malcolm <dmalc...@redhat.com> wrote:
> On Thu, 2016-06-30 at 08:38 -0400, Nathan Sidwell wrote:
> > [...] WIND_BASE is expected to point at a vxworks install [...]

> [...]
> 
> Hence it appears that passing "-nostdinc" as a param will avoid the
> error: [...]
> 
> Presumably if you're explicitly building for vxworks you have a vxworks
> install, so there is a meaningful value to set WIND_BASE to, whereas if
> you don't have a vxworks install (and are merely building everything as
> a smoketest), you presumably only want to build the "gcc" subdir, since
> AFAIK you can't run then driver.
> 
> So there are at least 2 ways of fixing this:
> 
> (a) add "-nostdinc" when running the selftests i.e. to the invocations
> of GCC_FOR_TARGET in the "s-selftest" and "selftest-gdb" clauses of
> gcc/Makefile.in.
> I've verified that this fixes the issue for --target=i686-wrs-vxworks.

OK to apply the following two patches?  First, a little bit of
refactoring:

commit 0b124fda378c9dc726bd709f805dd52a7dc7c78a
Author: Thomas Schwinge <tho...@codesourcery.com>
Date:   Wed Oct 5 08:06:00 2016 +0200

    In gcc/Makefile.in, factor out SELFTEST_FLAGS
    
        gcc/
        * Makefile.in (SELFTEST_FLAGS): New variable.
        (s-selftest, selftest-gdb, selftest-valgrind): Use it.
---
 gcc/Makefile.in | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git gcc/Makefile.in gcc/Makefile.in
index 15c48bc..08b96a6 100644
--- gcc/Makefile.in
+++ gcc/Makefile.in
@@ -1876,6 +1876,10 @@ endif
 # This does the things that can't be done on the host machine.
 rest.cross: specs
 
+# GCC's selftests.
+# Specify a dummy input file to placate the driver.
+SELFTEST_FLAGS = -x c /dev/null -S -fself-test
+
 # Run the selftests during the build once we have a driver and a cc1,
 # so that self-test failures are caught as early as possible.
 # Use "s-selftest" to ensure that we only run the selftests if the
@@ -1883,18 +1887,19 @@ rest.cross: specs
 .PHONY: selftest
 selftest: s-selftest
 s-selftest: $(GCC_PASSES) cc1$(exeext) stmp-int-hdrs
-       $(GCC_FOR_TARGET) -xc -S -c /dev/null -fself-test
+       $(GCC_FOR_TARGET) $(SELFTEST_FLAGS)
        $(STAMP) $@
 
 # Convenience method for running selftests under gdb:
 .PHONY: selftest-gdb
 selftest-gdb: $(GCC_PASSES) cc1$(exeext) stmp-int-hdrs
-       $(GCC_FOR_TARGET) -xc -S -c /dev/null -fself-test -wrapper gdb,--args
+       $(GCC_FOR_TARGET) $(SELFTEST_FLAGS) \
+         -wrapper gdb,--args
 
 # Convenience method for running selftests under valgrind:
 .PHONY: selftest-valgrind
 selftest-valgrind: $(GCC_PASSES) cc1$(exeext) stmp-int-hdrs
-       $(GCC_FOR_TARGET) -xc -S -c /dev/null -fself-test \
+       $(GCC_FOR_TARGET) $(SELFTEST_FLAGS) \
          -wrapper valgrind,--leak-check=full
 
 # Recompile all the language-independent object files.

..., and then the real change:

commit 8ab49582c42809b385eb957c20b84d21a90e041a
Author: Thomas Schwinge <tho...@codesourcery.com>
Date:   Wed Oct 5 08:08:37 2016 +0200

    Make GCC selftests work for *-wrs-vxworks-* targets
    
        gcc/
        Makefile.in (SELFTEST_FLAGS): Add -nostdinc.
---
 gcc/Makefile.in | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git gcc/Makefile.in gcc/Makefile.in
index 08b96a6..23623ac 100644
--- gcc/Makefile.in
+++ gcc/Makefile.in
@@ -1878,7 +1878,9 @@ rest.cross: specs
 
 # GCC's selftests.
 # Specify a dummy input file to placate the driver.
-SELFTEST_FLAGS = -x c /dev/null -S -fself-test
+# Specify -nostdinc to work around missing WIND_BASE environment variable
+# required for *-wrs-vxworks-* targets.
+SELFTEST_FLAGS = -nostdinc -x c /dev/null -S -fself-test
 
 # Run the selftests during the build once we have a driver and a cc1,
 # so that self-test failures are caught as early as possible.


Grüße
 Thomas

Reply via email to