From patchwork Tue Dec 9 14:58:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 126259 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 7ADE44BA2E25 for ; Tue, 9 Dec 2025 15:00:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7ADE44BA2E25 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=vf0s237Z X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by sourceware.org (Postfix) with ESMTPS id 013774BA2E04 for ; Tue, 9 Dec 2025 14:59:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 013774BA2E04 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 013774BA2E04 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1765292359; cv=none; b=a+UcxzM9eRH2ttCY7C7wLMUUmwccKVvTo67GZMLksoTUZZTULglJ79ME8Pb3pG3AB8LW2Oe3plr4MQzfmOc2GUG3F1s5VcUgHeAu5ybFLNH0oiZRg4hB5Rl5JHlwXt7dclIuYqUGyhEK6+QMmdgbKgvZfGij6YdkXAWZDDjJJbw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1765292359; c=relaxed/simple; bh=og1QHYjcCgCLb1NGDs4ZIUPzv+DIXcv0Zw8uM9wHA0E=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=W0WxcAiKsZ25vfHFOaL/4dyEgdA5p/jG5nlWlXbQZVfuGKm+Rk+INOuNw8ajv0HCnUcgtBBlcxPIPoPt2GwYnugfUvVxW0dyCeNlEFxYmljRr0njf5HabI/XY9xKUAXnGq6smriz5Rod/OPXP/uIVLbc26Dj+aQVWHqwMg+2KLU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 013774BA2E04 Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-29ba9249e9dso80180365ad.3 for ; Tue, 09 Dec 2025 06:59:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765292358; x=1765897158; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Wfw9JKG7IKKxVi29OgwRjgA33xzNZOj5/lEg0DoCLho=; b=vf0s237ZM6hIuWCyQunx/EoNciGj0gnTsdv8TKxlH8v1ay86h58TWFCAUuyvAwzz65 Aa61UYudY4kGfarh0ZnsyTEIG5XwYK17aLhqgvOXotIgAeaU5tiDHKOfu4Tx1VmYGf7B ealE/IjTPw6H7F85cNB63C9V5zleA0sx99bV3DdsZbFKXGlMkBgLkbz3Eh8tHZFhQOS4 icGOQ7LRK5mzT4mDlDAhiIXhC4S8WwFphxJAT1Jaoz1wqh8KstYFJNSyGL68F1/eV4vH 4VXNO9rUv2hlHCqyEBtA0YHcn+6WlGdWNKATyzvyTe2BcfQx6LZLMWVUofEg4kcE5Zi0 aS5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765292358; x=1765897158; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Wfw9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zXUjnO8ucAGd60iQEu0rLaOwg== X-Received: by 2002:a05:7022:309:b0:11e:354:32cb with SMTP id a92af1059eb24-11e03543439mr10342466c88.49.1765292357305; Tue, 09 Dec 2025 06:59:17 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c0:da21:6eba:ccc9:8755:3611]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-11df76ed82esm79149331c88.7.2025.12.09.06.59.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Dec 2025 06:59:15 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: "H . J . Lu" , Collin Funk , Sam James Subject: [PATCH v2 1/3] configure: use TEST_CC to check for --no-error-execstack Date: Tue, 9 Dec 2025 11:58:32 -0300 Message-ID: <20251209145908.3755865-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251209145908.3755865-1-adhemerval.zanella@linaro.org> References: <20251209145908.3755865-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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~patchwork=sourceware.org@sourceware.org The ld.lld does not support the --no-error-execstack option, and it is required only to suppress the linker warning while building tests. A new configure macro, LIBC_TEST_LINKER_FEATURE, is added to check for linker features using TEST_CC instead of CC. Checked on x86_64-linux-gnu and aarch64-linux-gnu with gcc and TEST_CC set to clang-18 and clan-21. Reviewed-by: Sam James --- aclocal.m4 | 32 ++++++++++++++++++++++++++++++++ configure | 9 ++++++--- configure.ac | 6 +++--- 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 5c25a71d8f..b32076d8d0 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -268,6 +268,38 @@ else fi AC_MSG_RESULT($libc_linker_feature)]) +dnl Check linker option support. +dnl LIBC_TEST_LINKER_FEATURE([ld_option], [cc_option], [action-if-true], [action-if-false]) +AC_DEFUN([LIBC_TEST_LINKER_FEATURE], +[AC_MSG_CHECKING([for linker that supports $1]) +libc_linker_feature=no +cat > conftest.c <&AS_MESSAGE_LOG_FD]) +then + if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp $2 -nostdlib \ + -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ + | grep "warning: $1 ignored" > /dev/null 2>&1; then + true + else + libc_linker_feature=yes + fi +fi +rm -f conftest* +if test $libc_linker_feature = yes; then + $3 +else + $4 +fi +CC="$saved_CC" +AC_MSG_RESULT($libc_linker_feature)]) + dnl Add a makefile variable, with value set from a shell string dnl (expanded by the shell inside double quotes), to config.make. dnl LIBC_CONFIG_VAR(make-variable, shell-value) diff --git a/configure b/configure index 9e79accc43..f93530f7ba 100755 --- a/configure +++ b/configure @@ -659,7 +659,7 @@ libc_cv_has_glob_dat libc_cv_fpie libc_cv_test_static_pie libc_cv_z_execstack -libc_cv_no_error_execstack +libc_cv_test_no_error_execstack ASFLAGS_config libc_cv_cc_with_libunwind libc_cv_insert @@ -7142,6 +7142,8 @@ libc_linker_feature=no cat > conftest.c <