diff mbox series

[LM32] Fix '"LINK_GCC_C_SEQUENCE_SPEC" redefined' warning

Message ID 20210930193451.gacunhy24jqyqxau@lug-owl.de
State Committed
Commit 5b4bf54a00be17e49433582c237724ac4e653608
Headers show
Series [LM32] Fix '"LINK_GCC_C_SEQUENCE_SPEC" redefined' warning | expand

Commit Message

Jan-Benedict Glaw Sept. 30, 2021, 7:34 p.m. UTC
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.


Ok for trunk?

Thanks,
  Jan-Benedict

--

Comments

Jan-Benedict Glaw Oct. 5, 2021, 2:46 p.m. UTC | #1
Hi,

On Thu, 2021-09-30 21:34:51 +0200, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> 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?

...and a ping for this patch.

Thanks,
  Jan-Benedict

--
Jeff Law Oct. 5, 2021, 2:53 p.m. UTC | #2
On 10/5/2021 8:46 AM, Jan-Benedict Glaw wrote:
> Hi,
>
> On Thu, 2021-09-30 21:34:51 +0200, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
>> 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?
> ...and a ping for this patch.
OK
jeff
diff mbox series

Patch

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}}"