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: 174169 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp3636456vqy; Tue, 5 Dec 2023 10:50:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IHAZimAa0rkSVSt4WAZa+XfjoLw4RRi1sNTG//D/uCOxxjvSlItn73e1ePGe3IKJ16D3yT8 X-Received: by 2002:a9d:4d1a:0:b0:6d8:777f:9949 with SMTP id n26-20020a9d4d1a000000b006d8777f9949mr5408550otf.3.1701802219990; Tue, 05 Dec 2023 10:50:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701802219; cv=pass; d=google.com; s=arc-20160816; b=Wlqj9rcRQorgECJt49mPpphuThkIkqEg73AhTSMb69st4RcBpuBsw1RPXx4nzE5564 /8DkBh33hPudEUz3pLJ6KHECcHhvpWz7uS6y8ohTXdcqspCgzH678yX6nq0c7ctkawPy JgDCllkFfzKTF7o2+4YkmlbkQozGhT+pnXBp/OZii6l3K2meHCv47MDbw4yLLyQ6T1lo qyulzGcOHiZC4C0auIWix+uP+L1t7Hp7dMGVDNXJGld9r8lLemvPRGGS36KxV4MnZGLx LC1/JnVXWnLhVzED/OLWiwu/dJ+1/4StNZsHJV+JRha54qrkz5qYE01nO5z8njigU1Jl PaoA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=rkD9ARnlnHNUesOyKV5Q0RhDvHDeH3fSA7FuEeFu0UY=; fh=1L2/IiukS00vgiXcKREcvt+pFBEM8GuYOng2C1a9k1k=; b=iqIJqel3Z5QozAMsZHl58WiMzVrwJdnpTxLM8rqzWxbS7iqG4/AMoc0p06krrTRtgK b2BeNB6nPEehJirs6t+e19b67dMX2yI+Hb1gkez8IXmiZS859vYoxUahiZdEUIEe+lPf 1dUdE1Xzdf2JGyNurNEm05fyWaVJxOUJRNQ3vnrddRasZS4zNxeRyNY6STzWR2h6X6fJ xrOyXwo5Kng9P9hQpYXtJTDpfZsyrj9xA98wDTHM1nCzKSsGXfLEozTkglyhGqh4HWkO eMjpMHM1beUi04QLmytHiNbqJp39dLOgyIJQIO4JgmJortyoJ7D5MOW4Kisk8LQ3mVPl LZtg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EVETzMet; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id fc22-20020a05622a489600b00423707d8c39si13085645qtb.626.2023.12.05.10.50.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 10:50:19 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EVETzMet; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B47F7385782F for ; Tue, 5 Dec 2023 18:50:19 +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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784468964609639709 X-GMAIL-MSGID: 1784468964609639709 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