From patchwork Thu Oct 19 16:50:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 735592 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1622010wro; Thu, 19 Oct 2023 09:51:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEQ1htqZDTbRAzF/fWAFCc7bF/xLf6cKQq4gSiHQdy5nQwzyXSWSnv6Hkbm7xV3IUOk+Dsy X-Received: by 2002:a0c:f2cb:0:b0:66d:34d:4441 with SMTP id c11-20020a0cf2cb000000b0066d034d4441mr3208369qvm.22.1697734265160; Thu, 19 Oct 2023 09:51:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697734265; cv=pass; d=google.com; s=arc-20160816; b=zWV6H3Vkta1JE2hyXoR75IkUhNqw62sLfinfFBXs2QYdNtTyLcTXyen9T43WkjXKd8 fTE50DPf0xsExhNXLzEAiwF35oeO+JFBHXdSaoMpH7PSXhXZ6Og8k9moTgz/8C0L33mN kmx/hCjNQsaU+a4eWQacCeDhIr5iBiIT2n08wymlSzxAYsD7fCe1Q8EfhxcRQYWCk1/6 YlpNRS25Oc/YmyHdaAch/s8BlTTv055bB/iLO3U+S70bDrvPXcKd71D2GO80NvJPsqRp YKGqhGNJx/AtEjZ9GSX+eQPDOkyh87yfkRJGTJjgLRZaAtuL6b3Pny3Op1XR4Y42Y7U/ Dn1g== 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=yOK5Yq7i+HmCC75mpzI6WcCSV6Ry7pTlZD9mVIkE6Sw=; fh=dHLBnA+MhGtNtN2B2JMAELi4oD+gmgMg7DL8H0jYbkI=; b=k7co1n20XjYDVIY7B3Kb2O7LZXSgJnCsvGmKseZGWAvGaJT/3VZRU/qJu+fenCUJEu gZ8upanIq4QQtrs+ijUKIPfqBhv6ej+z7b/DWPscWDK2H+vaMC6kZhE8rPizZdrHfsm7 AX9ywMuukp/ClhRO9uxJpV6lVvWG0y2WzS3u4H0r2jqKIfb7TS6UUh5qGCycdVwjBVT5 OaCjX5m/uWkFUi8vYdovoqo5ArDmdR1C6C6icqZ71OB7ESk0ecBjQWt/mSy+M8oWg0pd 0fDCGc4PAWmnK3uxlZGNLEj5xOoB2LcL0vtpfKJLXPvo0zyDJFNtRB7cXlMfLJWnbebN BgsA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W3YtPnWJ; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id du19-20020a05620a47d300b007757f6e5c87si1772345qkb.185.2023.10.19.09.51.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 09:51:05 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.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=@linaro.org header.s=google header.b=W3YtPnWJ; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C268B3857806 for ; Thu, 19 Oct 2023 16:51:04 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by sourceware.org (Postfix) with ESMTPS id 51D843858D1E for ; Thu, 19 Oct 2023 16:50:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 51D843858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 51D843858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::632 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697734259; cv=none; b=LRGdij6VQ3TsIV3Z9+/+isOYxxW9b+C/gScduvRM1K3BOyjHZVOGHaKecbX1RHcFzObRckeWHrvt2THCvfcb5c1czUOoz3KeyMysXJ2h/TlZHefYa1XglShZ36gEAi5CZ9+ib6g8qBIrfTQBPMxb6gd8GX4ILtDjuogaeJ8yCWA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697734259; c=relaxed/simple; bh=RdX5egDjpQ0DFf1VQpUETCZYjVfmrVqECx9H+wOuNA4=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=YvhkxDjiDSzLx21nbYEv9XPrY3j4ZPX2g+X+PA2et67G6vUGrDwjn2ZzrycH50QQmHtjZEqWvbLJJdL7tvUl86NIqyeBRjZhXGDdoNth93JzgFAGqnUvP+hlpfQ9Ql9Wk87Dg1LWdzouO4vb80VXg687nE/hK+ir5Obd3+ObS0Q= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1c9e06f058bso7941665ad.0 for ; Thu, 19 Oct 2023 09:50:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697734257; x=1698339057; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=yOK5Yq7i+HmCC75mpzI6WcCSV6Ry7pTlZD9mVIkE6Sw=; b=W3YtPnWJtku1BCQEwdxPoMLGstdHgQSDIOYH0pIQt4vtuXCBimHtbSd60MFKFzQRF6 GCH1Bb20PaBiP7Qf5BTj1+H5TPp1rb/AaLNDUa+Ypl6drqQaHXcasOzTo2nNuhiN5Egp T32L00p2gpWKndsZfaa9ay9IAqyvn+GeDINeGGRSf+qAMQnBdDlbKzE6xBtpiLQFE0n5 FkT96RTGbSfSs1Ib+KeQu/N8AvY3ZFFHWmKIpaJVszsZeAF1luBBxoNDHnfNSebduV5g TKq8DN8FItaWR8dpBJ87iYbQXhI3JGmyQm+JlHurh/SVBwJWpdOn9fGUIAHCg/05XEr8 pqTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697734257; x=1698339057; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yOK5Yq7i+HmCC75mpzI6WcCSV6Ry7pTlZD9mVIkE6Sw=; b=PsFllNEZvz0HDzBGHvklc7N2aJL1ki++BYiym3u/fCMrsq8CINgxFDYADciL/g1gma vpbHvvGw0wS4XQqYAOumEbw3fKEj5P8oZCNOwRTmSPHPsYRM9HXpDxBMPz5OUNLsQABN me+0CUGOaXAnleffd2jQPtf/o9gyc7MgpMkpfVx5t6RzPlVRIju8qsuNWvXZeIZuW8rx wgorAF5tcIrTwQCdPyq6ROI2SIUlu9PmflDVR4QI3nz/nK3ua6benrP11AYi6wfgCj1p VjIUh4mfzwuRbM63cwXo/G1kA9znKtVo5o0U+4HTFsfYboL3rWhvJq0FL7XYQQHXgp2B RBzg== X-Gm-Message-State: AOJu0YwAxcDpi7d6kvniDGmOztW0Rmi0Hpf+IQaYIwqWw1AuAr2/MNde qGe3Ts+9TcjCYpEAq3pLnaYFWSwJi4WI6kCbhMh22g== X-Received: by 2002:a17:903:22c2:b0:1b7:f64b:379b with SMTP id y2-20020a17090322c200b001b7f64b379bmr3579648plg.17.1697734256740; Thu, 19 Oct 2023 09:50:56 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:a647:8435:c932:f94b:575b]) by smtp.gmail.com with ESMTPSA id jh1-20020a170903328100b001c72f4334afsm2182890plb.20.2023.10.19.09.50.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 09:50:55 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH] malloc: Fix tst-tcfree3 build csky-linux-gnuabiv2 with fortify source Date: Thu, 19 Oct 2023 13:50:50 -0300 Message-Id: <20231019165050.2134920-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patch=linaro.org@sourceware.org With gcc 13.1 with --enable-fortify-source=2, tst-tcfree3 fails to build on csky-linux-gnuabiv2 with: ../string/bits/string_fortified.h: In function ‘do_test’: ../string/bits/string_fortified.h:26:8: error: inlining failed in call to ‘always_inline’ ‘memcpy’: target specific option mismatch 26 | __NTH (memcpy (void *__restrict __dest, const void *__restrict __src, | ^~~~~~ ../misc/sys/cdefs.h:81:62: note: in definition of macro ‘__NTH’ 81 | # define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct | ^~~ tst-tcfree3.c:45:3: note: called from here 45 | memcpy (c, a, 32); | ^~~~~~~~~~~~~~~~~ Instead of relying on -O0 to avoid malloc/free to be optimized away, disable the builtin. Reviewed-by: DJ Delorie --- malloc/Makefile | 2 ++ malloc/tst-tcfree3.c | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/malloc/Makefile b/malloc/Makefile index c1db3347d8..f6cdf7bf0b 100644 --- a/malloc/Makefile +++ b/malloc/Makefile @@ -298,6 +298,8 @@ CPPFLAGS-malloc.c += -DUSE_TCACHE=1 # Uncomment this for test releases. For public releases it is too expensive. #CPPFLAGS-malloc.o += -DMALLOC_DEBUG=1 +CFLAGS-tst-tcfree3.c += -fno-builtin-malloc -fno-builtin-free + sLIBdir := $(shell echo $(slibdir) | sed 's,lib\(\|64\)$$,\\\\$$LIB,') $(objpfx)mtrace: mtrace.pl diff --git a/malloc/tst-tcfree3.c b/malloc/tst-tcfree3.c index ce6d958f8a..30886b6f49 100644 --- a/malloc/tst-tcfree3.c +++ b/malloc/tst-tcfree3.c @@ -19,9 +19,6 @@ #include #include -/* Prevent GCC from optimizing away any malloc/free pairs. */ -#pragma GCC optimize ("O0") - static int do_test (void) {