From patchwork Thu Sep 30 19:34:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan-Benedict Glaw X-Patchwork-Id: 45621 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0956F3857C53 for ; Thu, 30 Sep 2021 19:35:44 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lug-owl.de (lug-owl.de [IPv6:2a03:4000:10:469::]) by sourceware.org (Postfix) with ESMTP id EF2483858001 for ; Thu, 30 Sep 2021 19:34:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EF2483858001 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=lug-owl.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=lug-owl.de Received: by lug-owl.de (Postfix, from userid 1001) id 5F22C41EF1; Thu, 30 Sep 2021 21:34:51 +0200 (CEST) Date: Thu, 30 Sep 2021 21:34:51 +0200 From: Jan-Benedict Glaw To: Sebastien Bourdeauducq , gcc-patches@gcc.gnu.org Subject: [LM32] Fix '"LINK_GCC_C_SEQUENCE_SPEC" redefined' warning Message-ID: <20210930193451.gacunhy24jqyqxau@lug-owl.de> MIME-Version: 1.0 Content-Disposition: inline X-Operating-System: Linux chamaeleon 5.8.0-0.bpo.2-amd64 X-gpg-fingerprint: 250D 3BCF 7127 0D8C A444 A961 1DBD 5E75 8399 E1BB X-gpg-key: wwwkeys.de.pgp.net X-Echelon-Enable: howto poison arsenous mail psychological biological nuclear warfare test the bombastical terror of flooding the spy listeners explosion sex drugs and rock'n'roll X-TKUeV: howto poison arsenous mail psychological biological nuclear warfare test the bombastical terror of flooding the spy listeners explosion sex drugs and rock'n'roll X-message-flag: Please send plain text messages only. Do not send HTML emails. Thank you. User-Agent: NeoMutt/20170113 (1.7.2) X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" 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 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}}"