Hi!
When configuring GCC for --target=lm32-uclinux --enable-werror-always,
it breaks here:
[all 2021-09-30 08:55:55] /usr/lib/gcc-snapshot/bin/g++ -c -g -O2 -DIN_GCC
-DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -DGENERATOR_FILE
-I. -Ibuild -I../../gcc/gcc -I../../gcc/gcc/build -I../../gcc/gcc/../include
-I../../gcc/gcc/../libcpp/include \
[all 2021-09-30 08:55:55] -o build/genpreds.o ../../gcc/gcc/genpreds.c
[all 2021-09-30 08:55:55] In file included from ./tm.h:29,
[all 2021-09-30 08:55:55] from ../../gcc/gcc/genpreds.c:26:
[all 2021-09-30 08:55:55] ../../gcc/gcc/config/lm32/uclinux-elf.h:70: error:
"LINK_GCC_C_SEQUENCE_SPEC" redefined [-Werror]
[all 2021-09-30 08:55:55]70 | #define LINK_GCC_C_SEQUENCE_SPEC \
[all 2021-09-30 08:55:55] |
[all 2021-09-30 08:55:55] In file included from ./tm.h:27,
[all 2021-09-30 08:55:55] from ../../gcc/gcc/genpreds.c:26:
[all 2021-09-30 08:55:55] ../../gcc/gcc/config/gnu-user.h:117: note: this is
the location of the previous definition
[all 2021-09-30 08:55:55] 117 | #define LINK_GCC_C_SEQUENCE_SPEC
GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC
[all 2021-09-30 08:55:55] |
[all 2021-09-30 08:55:58] cc1plus: all warnings being treated as errors
[all 2021-09-30 08:55:58] make[1]: *** [Makefile:2825: build/genpreds.o] Error 1
Easy fix, just undefine LINK_GCC_C_SEQUENCE_SPEC beforehand:
gcc/ChangeLog:
* config/lm32/uclinux-elf.h (LINK_GCC_C_SEQUENCE_SPEC):
Undefine before redefinition.
diff --git a/gcc/config/lm32/uclinux-elf.h b/gcc/config/lm32/uclinux-elf.h
index 370df4c55dd..5b638fa5db2 100644
--- a/gcc/config/lm32/uclinux-elf.h
+++ b/gcc/config/lm32/uclinux-elf.h
@@ -67,6 +67,7 @@
#define TARGET_OS_CPP_BUILTINS() GNU_USER_TARGET_OS_CPP_BUILTINS()
+#undef LINK_GCC_C_SEQUENCE_SPEC
#define LINK_GCC_C_SEQUENCE_SPEC \
"%{static|static-pie:--start-group} %G %{!nolibc:%L} \
%{static|static-pie:--end-group}%{!static:%{!static-pie:%G}}"
Ok for trunk?
Thanks,
Jan-Benedict
--
signature.asc
Description: PGP signature