From patchwork Tue Jul 2 17:00:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Goodbody X-Patchwork-Id: 809132 Delivered-To: patch@linaro.org Received: by 2002:adf:a199:0:b0:367:895a:4699 with SMTP id u25csp310713wru; Tue, 2 Jul 2024 10:00:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUqHsjCezlXGa2wTGJXUrdj23YSIl/FwsyWDb9xXcUe91GywKpmTMgJQ4gBV+7JphE1n2J4UdTBpMshR7BBwtf/ X-Google-Smtp-Source: AGHT+IGl88JLoV2BpGYTfzSIpwTMYXwZGdeZgS28hOQDdPwlQ/rPL8oFyoPZHfzi7PhynhmbRoki X-Received: by 2002:a05:6402:524f:b0:57d:3ef8:614d with SMTP id 4fb4d7f45d1cf-5878257bfe0mr6677767a12.20.1719939635992; Tue, 02 Jul 2024 10:00:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719939635; cv=none; d=google.com; s=arc-20160816; b=wC0dGEsEGFdC1FWP+dwb7yVfc688TxNVXIMiv+3guOoCtmBqAvv6OsZhPFLsuVQTXR XsfCIfGVyG8GVSXg+pDFQb3RPgJjOfip02cHiSvwglGJC7oCp/kJxhp3riqKlgbKEcY0 V6MU77pWWVO4Lo4JKBt1iUGiyHjeN9J8v7QAU+JtsP+xaF2C/TgYnbFS0L7PJnbUAOf1 35Ed3MS3g9ebPvVwaAI3/62wfHmCQIMyU5Jy8JMTsrvZBGrHuGK2ek8UEzRD1KrQJzbE bkee3jo21ToMmT7ZF1FZ0W3DGBU5fKc4gpSC/ATzhPG2LUeTWIqKmFRTiPmf9vq2lFwO mn7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=djvdJnmDOeXWIocbLWvF02El5tJr8Fngi76wloKtEd8=; fh=mvv6mVRmKOPcEmZLoMLLhpun845FJri2xT3sxnR+3xI=; b=XWsy41BLbfF1F9v+dcV2SkCLrK5rHLu5xvFfhz5/STxrGqqY8B+/1cEWvtpq1hA+Uu iQmMwJN23BO5s6ZgLWH3Pl6Be+k0iOrSfmzttCtOAVqA+bqRlO73Sd5MV4Xwt1ex9pU9 1FILpzp8yaRWKyIIkZu/lkoKmGI84rJpsnWviNBcNx19Ia3f2GovwxFrDxVgUSo9EbE7 GkxUzJgwo7Ad+lb/Ue1GLA5TaevKlfpdXA+YbdfIyBeT7GVNcF4OlDsTtN5GsWZvXA/l y7FcrVlGqrWgENClL0emhUiN+ZBPqkJnboN7p35SXbP/OTp+0yxMsBHwakng54ERTdUC yMng==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pSE046xr; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-58b29f96ab4si1102413a12.617.2024.07.02.10.00.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 10:00:35 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pSE046xr; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 96F2A883AC; Tue, 2 Jul 2024 19:00:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="pSE046xr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 22B8D883AC; Tue, 2 Jul 2024 19:00:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BBF25883A9 for ; Tue, 2 Jul 2024 19:00:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andrew.goodbody@linaro.org Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-36703b0f914so2839545f8f.0 for ; Tue, 02 Jul 2024 10:00:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719939630; x=1720544430; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=djvdJnmDOeXWIocbLWvF02El5tJr8Fngi76wloKtEd8=; b=pSE046xrzCyCmB4MEJl2Pk/vH1n79Obg+upznd3+5r7snOKi/8pVnq8JCrY3A5X/Gw ULmcnONHSpAUFxTTzjDrZ2qfYBqnMtYCX1OjHicZ8QLwbxGQXEl/vErTh+CvbLWUMMym G3OsVglxBHG81ifnAmJGRfQ9KIO2gRYxxvyV3y/x/RkhHgc/37MtcQScssa2BU36+MjR RtoGEUcGrEDfGbwNn+mFiJLCTB5PjgaHjT0kPentt2QFQLaGDmkoiHuJo/vj52/kVa8M +qo4FT91pR+DJVMqqNc3pYXigWYJEdSQOW7dr6xSinQGfDxCDPaqyDFmezs6QTTALOCx nDUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719939630; x=1720544430; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=djvdJnmDOeXWIocbLWvF02El5tJr8Fngi76wloKtEd8=; b=UtWmJZdw7ZpNuJvlV1ygDnKaVt0cMUqPIEm+ccsr2b/vvtdLnR+CRYn4MIo/gW4iyl kGJzubMsNlqMd9Ybh0wcGJF45KWfecB69DjHR5VU1YBiKm2YgWoPB59N1Alps0yO54ww BHj58AKq3FXfIzetUiZhkcre9ut3qBjGHuu2bA2LMi/7ZGa1nGI+ZvRl0x+JGs8/zU0E 6dtm+J2ap+TD1VAdq2hCIA9RYYnUURD0oUtgEJBm2A0SrnK8NsiIeBAkrGuXahhjEnU4 2phBMc2Vim47qR+S9rfgRNKv9qK9rmijYMAXVvov8D/3sltIMlTSYpxbcT8r+rC1qg94 i6nw== X-Gm-Message-State: AOJu0Yz8euftvlPD4onx4nNv9WE0IPoiO3WEZelaKBOHoPzcaHEn5Clw 6PHggF0+ju72DasbVNXFG7KLuk0ng5mZzQQByRYTWTyvrJL4Vk5TzNyN7zsspvLQ99gTauvNlVz +Gm0= X-Received: by 2002:a05:6000:1f8e:b0:366:e09c:56be with SMTP id ffacd0b85a97d-36760a63050mr13190060f8f.6.1719939629879; Tue, 02 Jul 2024 10:00:29 -0700 (PDT) Received: from artemis2.broadband ([2a0a:ef40:ea8:cd01:9aec:1017:ab08:a7e5]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36784e3e0f5sm2532832f8f.11.2024.07.02.10.00.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 10:00:29 -0700 (PDT) From: Andrew Goodbody To: u-boot@lists.denx.de Cc: Andrew Goodbody , Simon Glass , Tom Rini Subject: [PATCH v2] sandbox: Fix LTO to work with STACKPROTECTOR Date: Tue, 2 Jul 2024 18:00:09 +0100 Message-Id: <20240702170009.484961-1-andrew.goodbody@linaro.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Add the STACKPROTECTOR symbols to the script that generates the symbols that should not be removed by the use of LTO when linking a shared object. This prevents a fail to build due to link errors. https://source.denx.de/u-boot/u-boot/-/issues/35 Signed-off-by: Andrew Goodbody --- Changes in v2: - Made the new match more specific and added it to the grep run rather than run grep twice scripts/gen_ll_addressable_symbols.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/gen_ll_addressable_symbols.sh b/scripts/gen_ll_addressable_symbols.sh index 13f670ae0e..fc5ee0e9c0 100755 --- a/scripts/gen_ll_addressable_symbols.sh +++ b/scripts/gen_ll_addressable_symbols.sh @@ -11,5 +11,6 @@ set -e echo '#include ' -$@ 2>/dev/null | grep -oe '_u_boot_list_2_[a-zA-Z0-9_]*_2_[a-zA-Z0-9_]*' | \ - sort -u | sed -e 's/^\(.*\)/extern char \1[];\n__ADDRESSABLE(\1);/' +$@ 2>/dev/null | grep -oe '_u_boot_list_2_[a-zA-Z0-9_]*_2_[a-zA-Z0-9_]*' \ + -e '__stack_chk_guard' | sort -u | \ + sed -e 's/^\(.*\)/extern char \1[];\n__ADDRESSABLE(\1);/'