From patchwork Tue Dec 5 18:49:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 1872299 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=EVETzMet; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Sl8jc61cvz23mj for ; Wed, 6 Dec 2023 05:50:10 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1DA4D3857BB5 for ; Tue, 5 Dec 2023 18:50:08 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 25BFB3858D32 for ; Tue, 5 Dec 2023 18:49:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 25BFB3858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 25BFB3858D32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701802198; cv=none; b=XRMNrGlCAXDUDRaS89M2atfiqDtGUJtVhN1hrY6ICML2db81NPnXkqUZejlHHgP2oBQW/YdcWEe7qdORm0Br54CskN/TOtiwXFllWGLoxmEza5kVlVYs2wOJrJjgGgU504Tx5kxzWCazXJC7nPifn07iKFRt1TahcEjaKNBHC1M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701802198; c=relaxed/simple; bh=Z2JvChfiAC+/Eq0vLDdF7NA1f71wm0bvv2rUygOauz8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Z4tphTF5siHnS/h3Zp6PSavwqeRmrKw3ZsA+JlaoDsjSArQWk77F+q724QCedIijLM5z6vDY1LsM/Ha+MsVrDXTUnn2Ea1lQhgLKkbjysmnzQfosAdl0OSqjeiRqyzYCRObpUJ6VvUZ8imUUQcNAxEgd5Ze/22lSjmYBJ1fyeS4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701802192; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rkD9ARnlnHNUesOyKV5Q0RhDvHDeH3fSA7FuEeFu0UY=; b=EVETzMetW5l2muQVq+hl1YSTsbJby01jrcJ9ydK9P1VI0uaF8bGJDTeghGOj/YaGLq/RsB SdkWcwwsXmuNknXTkQkHXUwVwBauMks3DZMDUblsrPclDBIahKhbrWTE9BTPtLQmB5My+n Dv0XOdewXbsEOlyIsJaVY8t6yPZCMDI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-682-vFpZAJmGOKWyhCIwRCKW0A-1; Tue, 05 Dec 2023 13:49:51 -0500 X-MC-Unique: vFpZAJmGOKWyhCIwRCKW0A-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2D57D848948 for ; Tue, 5 Dec 2023 18:49:51 +0000 (UTC) Received: from pdp-11.redhat.com (unknown [10.22.17.146]) by smtp.corp.redhat.com (Postfix) with ESMTP id 178761121312 for ; Tue, 5 Dec 2023 18:49:51 +0000 (UTC) From: Marek Polacek To: GCC Patches Subject: [PATCH] build: unbreak bootstrap on uclinux targets [PR112762] Date: Tue, 5 Dec 2023 13:49:29 -0500 Message-ID: <20231205184929.76195-1-polacek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Tested with .../configure --target=c6x-uclinux [...] && make all-gcc, ok for trunk? -- >8 -- Currently, cross-compiling with --target=c6x-uclinux (and several other) fails due to: ../../src/gcc/config/linux.h:221:45: error: 'linux_fortify_source_default_level' was not declared in this scope #define TARGET_FORTIFY_SOURCE_DEFAULT_LEVEL linux_fortify_source_default_level In the PR Andrew mentions that another fix would be in config.gcc, but really, here I meant to use the target hook for glibc only, not uclibc. This trivial patch fixes the build problem. It means that -fhardened with uclibc will use -D_FORTIFY_SOURCE=2 and not =3. PR target/112762 gcc/ChangeLog: * config/linux.h: Redefine TARGET_FORTIFY_SOURCE_DEFAULT_LEVEL for glibc only. --- gcc/config/linux.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) base-commit: 9c3a880feecf81c310b4ade210fbd7004c9aece7 diff --git a/gcc/config/linux.h b/gcc/config/linux.h index 79b6537dcf1..73f39d3c603 100644 --- a/gcc/config/linux.h +++ b/gcc/config/linux.h @@ -215,7 +215,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see # undef TARGET_LIBM_FUNCTION_MAX_ERROR # define TARGET_LIBM_FUNCTION_MAX_ERROR linux_libm_function_max_error -#endif - #undef TARGET_FORTIFY_SOURCE_DEFAULT_LEVEL #define TARGET_FORTIFY_SOURCE_DEFAULT_LEVEL linux_fortify_source_default_level + +#endif