From patchwork Tue Apr 13 04:03:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 1465553 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; helo=desiato.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=d6/kmbbc; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Uh0dhN+M; dkim-atps=neutral Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FKBq32WZJz9sTD for ; Tue, 13 Apr 2021 14:05:50 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=GeCj2KsofZubDi/SO3/pe9JNyvT1GR4vwm+4DUjK+pE=; b=d6/kmbbc+X0390 kuf8yPeGyxazmGNtgKpaJ2vcdfLf/p+y5UFtsL+dEjowZWnh99lCHkNT6rO0rrJUbWYpZ1VTlrAsS wdcYJAcF9MmFGdf0DOPW5LBvwh4QIGSe8UDlOojh2rxxQEnJyQkdf5p8PTb75aU7nxLeizPLOTiNn peMmsNlk4+2no9361RGNzjBGoVaw40NuMJaPGqgD0QGWoHppCbk2n2zUSuMdiYyQW3kKZKZkt7alJ Ha+AuIpfnXcJopTksfyjqh4R/BmoWRbMa6UAYlvfVaEXooKq0UeFdsI+AbG18P9R0l/dv30FnQeXg Hp9u0vV/lQ9sEVxe+7Iw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lWAH7-008Cwv-0V; Tue, 13 Apr 2021 04:03:41 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lWAH1-008CwY-NB for openwrt-devel@lists.openwrt.org; Tue, 13 Apr 2021 04:03:38 +0000 Received: by mail-pj1-x102c.google.com with SMTP id k23-20020a17090a5917b02901043e35ad4aso10003738pji.3 for ; Mon, 12 Apr 2021 21:03:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=gDBndwZQdEFCvwnIboDjtmaH/qXf0LRG/9Mvtyu5wvA=; b=Uh0dhN+MqqyceYn8BbM1qqXOKYcnUAunwgszkBGSTpFKkBCSF+Anc1NbKhHSOKOjWZ nL6MIUQj4T15GT0xZXjnUQhfYnLp8mz2Hx3EmUfnZQFzWHwiw7An11uiOR/YX+iJR7Pt GGcRIL5wAtemW1LwIDq/3Zd8EOxN29cPJwxdKVeAZpYbG4kz1/Plt1e0OBOJPYSSsYJL rQ3qqGZOx3c2OIZiW18VRURjTZcVX+W3KS5TWGSDUgt3GkVIDGAQ66TBf56sFJllShTA rXO9ymKmToG3C7Qrno9Zr5qEjHUO0+QCPz0aEJfnd0NJ7sC4wW+n8f4M3UpslKoaqJzh 4gWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=gDBndwZQdEFCvwnIboDjtmaH/qXf0LRG/9Mvtyu5wvA=; b=pdjcGDkHNzkbjAIC/+UujH4lVBbLtRnuDyBcIxcz5xELE87A1KehrvBTOCrly9wl5i A9gNi1S5Lv7f0AWqcD+Z+UyqLK3zP+d+cOfThCyoL/D0GhyZ+WsHE4/CQLotuPwi3uRJ ETZ+rVOJF6wFDEQ7CBE8LZFkDGTkfH24wh7XDwZEAHUahSTyHBNllnhs9VjC12uMQWL5 wpixwWoX1XJoix+OCAzxZU9I7tDCAcUtS/5rTVoiM6WT53iLzTsOVWiN753uCkxzx0HH SRZQCSm4rxL8bjnQiIzjoplmv0UuXGqvGCdag6G5VP2D5vvoC0g6hssdMLpYIri/XYeZ mwng== X-Gm-Message-State: AOAM532HRqJChWuxQg+lkHKrQdWue3PRW94l2vKMbdY4VVXz4ShwmOHG QsQjBALCsXFw17OZ8fG9voBjJZMiL3A= X-Google-Smtp-Source: ABdhPJx8TYwIUFBLsemLRyRDa27eTkmJabtjsqiolUyJfCIBUbBCq2KUGDs/10+wuX2+PO/Iy0wfUg== X-Received: by 2002:a17:90a:46c4:: with SMTP id x4mr2775604pjg.8.1618286611495; Mon, 12 Apr 2021 21:03:31 -0700 (PDT) Received: from mangix-trapnet.lan ([2001:470:1f05:79e::367]) by smtp.gmail.com with ESMTPSA id r1sm11793780pfh.153.2021.04.12.21.03.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Apr 2021 21:03:31 -0700 (PDT) From: Rosen Penev To: openwrt-devel@lists.openwrt.org Subject: [PATCH] fortify-headers: fix compilation with GCC 10.3 Date: Mon, 12 Apr 2021 21:03:29 -0700 Message-Id: <20210413040329.2976942-1-rosenp@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210413_050335_968804_4695E9E9 X-CRM114-Status: GOOD ( 13.03 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: For some reason, fortified mempcpy does not work with GCC 10.3. It worked with GCC 10.2. Some output with tvheadend: error: 'mempcpy' undeclared here (not in a function); did you mean 'memccpy'? 144 | _FORTIFY_FN(mempcpy) void *mempcpy(void *__d, const void *__s, size_t __n) | ^~~~~~~ note: in definition of macro '_ [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [rosenp[at]gmail.com] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:102c listed in] [list.dnswl.org] X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org For some reason, fortified mempcpy does not work with GCC 10.3. It worked with GCC 10.2. Some output with tvheadend: error: 'mempcpy' undeclared here (not in a function); did you mean 'memccpy'? 144 | _FORTIFY_FN(mempcpy) void *mempcpy(void *__d, const void *__s, size_t __n) | ^~~~~~~ note: in definition of macro '_FORTIFY_ORIG' 20 | #define _FORTIFY_ORIG(p,fn) __typeof__(fn) __orig_##fn __asm__(_FORTIFY_STR(p) #fn) note: in expansion of macro '_FORTIFY_FN' 144 | _FORTIFY_FN(mempcpy) void *mempcpy(void *__d, const void *__s, size_t __n) In function 'mempcpy': error: called object '__orig_mempcpy' is not a function or function pointer 151 | return _orig_mempcpy(__d, __s, __n); Signed-off-by: Rosen Penev --- toolchain/fortify-headers/Makefile | 2 +- toolchain/fortify-headers/patches/010-mempcpy.patch | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 toolchain/fortify-headers/patches/010-mempcpy.patch diff --git a/toolchain/fortify-headers/Makefile b/toolchain/fortify-headers/Makefile index a6151bb2f1..bb67c33c30 100644 --- a/toolchain/fortify-headers/Makefile +++ b/toolchain/fortify-headers/Makefile @@ -9,7 +9,7 @@ include $(INCLUDE_DIR)/target.mk PKG_NAME:=fortify-headers PKG_VERSION:=1.1 -PKG_RELEASE=1 +PKG_RELEASE=2 PKG_SOURCE_URL:=http://dl.2f30.org/releases PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz diff --git a/toolchain/fortify-headers/patches/010-mempcpy.patch b/toolchain/fortify-headers/patches/010-mempcpy.patch new file mode 100644 index 0000000000..8423395da5 --- /dev/null +++ b/toolchain/fortify-headers/patches/010-mempcpy.patch @@ -0,0 +1,11 @@ +--- a/include/string.h ++++ b/include/string.h +@@ -139,7 +139,7 @@ _FORTIFY_FN(strncpy) char *strncpy(char + return __orig_strncpy(__d, __s, __n); + } + +-#ifdef _GNU_SOURCE ++#if 0 + #undef mempcpy + _FORTIFY_FN(mempcpy) void *mempcpy(void *__d, const void *__s, size_t __n) + {