Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2038937iob; Sun, 15 May 2022 06:13:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHW4qBtQdeMxFQaghPx0U8rT3+sQ5bcPEDdEtzHUbImzaTpK+FiWGH8gbQd2DNSJcar80d X-Received: by 2002:a05:6402:d0a:b0:425:d455:452 with SMTP id eb10-20020a0564020d0a00b00425d4550452mr8211168edb.259.1652620412041; Sun, 15 May 2022 06:13:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652620412; cv=none; d=google.com; s=arc-20160816; b=ryer20PlEqP9Beqp6w1CcYgxqnVhTRk2xI1lUrvHTeVMPQ0U+TMZIcP1pekhTjk4H5 PCUq3jBYJkKi9Q4Txdo8dTmMUrSFPa3NVOQRYUZwWg/2yR+qQvk86CVROtjVg6KKq8s+ ZpQifFYauxZKojwElD2Lkz1+bsFxlhevZp42APKNBNXA9RDCb0WFN4IAcMOUQTX4p6xA WIGpRY+8yBbSNDdCWlur3CRRBFQCKtattW6IwUubcGmKRlTMpTzqRz5Q+gr5ZMmzjhZX OY5LAqh8HLo0G2bQ+LBFsRK8NoGdvcvldHglllGXapT2/TWR90vV6g6OUDkxQzVB5d4Y PSaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=pXQAhg+CG7KE6rhTDq6khgS7ZvT8892kBjYeIQWt8SA=; b=zQMOFQ48a97uvLu8vAXopfJm2H2kCRxx/rAU3fnHjtDrIKhN+tJM1Pwe7MrIse+jkc dQzBvCpw2SJmimE/VtYFL2zPklhFA4qCOodBiVtZGdIw9VWGY2h9M0o16PgK2ZWyaz+i x93F+0/0sieJ4R1XzWHn82hpaghVpQQIM2n5NwSEAhMln4MS6GJ0+OG56uXg2Bz13bHl ZG1KuY/Wo6aNl1ucgdX/xEpsCzF2aeDveYa39C7+MYQT5ad6q/DoPb0pzQWMDUYXDCfm S6M8s1zuo7eW3JdyyM1/fGRrLdcS8Vu9KDP/kpvTAZNnOFVnm4WPAtQAloxhJwbkObc+ SRhQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ji22-20020a170907981600b006f4904880fbsi8033317ejc.338.2022.05.15.06.13.03; Sun, 15 May 2022 06:13:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236214AbiEOKFb (ORCPT + 99 others); Sun, 15 May 2022 06:05:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236193AbiEOKFa (ORCPT ); Sun, 15 May 2022 06:05:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 961553D1E4; Sun, 15 May 2022 03:05:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2E99160EF6; Sun, 15 May 2022 10:05:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39026C385B8; Sun, 15 May 2022 10:05:27 +0000 (UTC) Date: Sun, 15 May 2022 11:05:23 +0100 From: Catalin Marinas To: Andre Przywara Cc: Will Deacon , Shuah Khan , linux-arm-kernel@lists.infradead.org, Mark Brown , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kselftest/arm64: bti: force static linking Message-ID: References: <20220511172129.2078337-1-andre.przywara@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220511172129.2078337-1-andre.przywara@arm.com> X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, 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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 11, 2022 at 06:21:29PM +0100, Andre Przywara wrote: > The "bti" selftests are built with -nostdlib, which apparently > automatically creates a statically linked binary, which is what we want > and need for BTI (to avoid interactions with the dynamic linker). > > However this is not true when building a PIE binary, which some > toolchains (Ubuntu) configure as the default. > When compiling btitest with such a toolchain, it will create a > dynamically linked binary, which will probably fail some tests, as the > dynamic linker might not support BTI: > =================== > TAP version 13 > 1..18 > not ok 1 nohint_func/call_using_br_x0 > not ok 2 nohint_func/call_using_br_x16 > not ok 3 nohint_func/call_using_blr > .... > =================== > > To make sure we create static binaries, add an explicit -static on the > linker command line. This forces static linking even if the toolchain > defaults to PIE builds, and fixes btitest runs on BTI enabled machines. > > Signed-off-by: Andre Przywara Does this need to go in as a fix (cc stable, fixes tag)? -- Catalin