]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Use LC_ALL=C when running selftests [PR117361]
authorDavid Malcolm <dmalcolm@redhat.com>
Fri, 1 Nov 2024 16:22:47 +0000 (12:22 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Fri, 1 Nov 2024 16:22:47 +0000 (12:22 -0400)
gcc/ChangeLog:
PR bootstrap/117361
* Makefile.in (GCC_FOR_SELFTESTS): New.

gcc/c/ChangeLog:
PR bootstrap/117361
* Make-lang.in (s-selftest-c): Use GCC_FOR_SELFTESTS.
(selftest-c-gdb): Likewise.
(selftest-c-valgrind): Likewise.

gcc/cp/ChangeLog:
PR bootstrap/117361
* Make-lang.in (s-selftest-c++): Use GCC_FOR_SELFTESTS.
(selftest-c++-gdb): Likewise.
(selftest-c++-valgrind): Likewise.

gcc/rust/ChangeLog:
PR bootstrap/117361
* Make-lang.in (s-selftest-rust): Use GCC_FOR_SELFTESTS.
(selftest-rust-gdb): Likewise.
(selftest-rust-valgrind): Likewise.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/Makefile.in
gcc/c/Make-lang.in
gcc/cp/Make-lang.in
gcc/rust/Make-lang.in

index b4d34cc0b42e613f879ee4298092143717a75cfe..2b80cdc046d95e238c45df75498b8a9bf0f21881 100644 (file)
@@ -487,6 +487,9 @@ T_STDINT_GCC_H = $(srcdir)/ginclude/stdint-gcc.h
 # Don't use this as a dependency--use $(GCC_PASSES).
 GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include -L$(objdir)/../ld $(TFLAGS)
 
+# The GCC to use when running selftests
+GCC_FOR_SELFTESTS = LC_ALL=C $(GCC_FOR_TARGET)
+
 # Set if the compiler was configured with --with-build-sysroot.
 SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
 
index 905ab9e79f74c116b9cbe52aef99e3588c084cbe..e7082a935635758edddd031426e79def82ce13b7 100644 (file)
@@ -150,13 +150,13 @@ C_SELFTEST_DEPS = cc1$(exeext) $(SELFTEST_DEPS)
 
 # Run the C selftests:
 s-selftest-c: $(C_SELFTEST_DEPS)
-       $(GCC_FOR_TARGET) $(C_SELFTEST_FLAGS)
+       $(GCC_FOR_SELFTESTS) $(C_SELFTEST_FLAGS)
        $(STAMP) $@
 
 # Convenience methods for running C selftests under gdb:
 .PHONY: selftest-c-gdb
 selftest-c-gdb: $(C_SELFTEST_DEPS)
-       $(GCC_FOR_TARGET) $(C_SELFTEST_FLAGS) \
+       $(GCC_FOR_SELFTESTS) $(C_SELFTEST_FLAGS) \
          -wrapper gdb,--args
 
 .PHONY: selftest-gdb
@@ -165,7 +165,7 @@ selftest-gdb: selftest-c-gdb
 # Convenience methods for running C selftests under valgrind:
 .PHONY: selftest-c-valgrind
 selftest-c-valgrind: $(C_SELFTEST_DEPS)
-       $(GCC_FOR_TARGET) $(C_SELFTEST_FLAGS) \
+       $(GCC_FOR_SELFTESTS) $(C_SELFTEST_FLAGS) \
          -wrapper valgrind,--leak-check=full
 
 .PHONY: selftest-valgrind
index e792ea4ddf3625dd281004b8e0fcbac3c5becb9f..fb7ae59d9d4cd7076f74eab6665eab8499a28cdb 100644 (file)
@@ -252,19 +252,19 @@ CPP_SELFTEST_FLAGS = -xc++ $(SELFTEST_FLAGS)
 
 # Run the C++ selftests
 s-selftest-c++: $(CPP_SELFTEST_DEPS)
-       $(GCC_FOR_TARGET) $(CPP_SELFTEST_FLAGS)
+       $(GCC_FOR_SELFTESTS) $(CPP_SELFTEST_FLAGS)
        $(STAMP) $@
 
 # Convenience method for running C++ selftests under gdb:
 .PHONY: selftest-c++-gdb
 selftest-c++-gdb: $(CPP_SELFTEST_DEPS)
-       $(GCC_FOR_TARGET) $(CPP_SELFTEST_FLAGS) \
+       $(GCC_FOR_SELFTESTS) $(CPP_SELFTEST_FLAGS) \
          -wrapper gdb,--args
 
 # Convenience method for running C++ selftests under valgrind:
 .PHONY: selftest-c++-valgrind
 selftest-c++-valgrind: $(CPP_SELFTEST_DEPS)
-       $(GCC_FOR_TARGET) $(CPP_SELFTEST_FLAGS) \
+       $(GCC_FOR_SELFTESTS) $(CPP_SELFTEST_FLAGS) \
          -wrapper valgrind,--leak-check=full
 
 # 'make check' in gcc/ looks for check-c++, as do all toplevel C++-related
index aed9a998c80adece935285a4374f52b523667ada..69178557059e8da401359783267e5e8e5982aa0e 100644 (file)
@@ -338,19 +338,19 @@ RUST_SELFTEST_DEPS = crab1$(exeext) $(SELFTEST_DEPS)
 
 # Run the rust selftests
 s-selftest-rust: $(RUST_SELFTEST_DEPS)
-       $(GCC_FOR_TARGET) $(RUST_SELFTEST_FLAGS)
+       $(GCC_FOR_SELFTESTS) $(RUST_SELFTEST_FLAGS)
        $(STAMP) $@
 
 # Convenience methods for running rust selftests under gdb:
 .PHONY: selftest-rust-gdb
 selftest-rust-gdb: $(RUST_SELFTEST_DEPS)
-       $(GCC_FOR_TARGET) $(RUST_SELFTEST_FLAGS) \
+       $(GCC_FOR_SELFTESTS) $(RUST_SELFTEST_FLAGS) \
          -wrapper gdb,--args
 
 # Convenience methods for running rust selftests under valgrind:
 .PHONY: selftest-rust-valgrind
 selftest-rust-valgrind: $(RUST_SELFTEST_DEPS)
-       $(GCC_FOR_TARGET) $(RUST_SELFTEST_FLAGS) \
+       $(GCC_FOR_SELFTESTS) $(RUST_SELFTEST_FLAGS) \
          -wrapper valgrind,--leak-check=full
 
 # Install info documentation for the front end, if it is present in the source directory. This target