From patchwork Thu Feb 3 18:09:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 50748 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 871D93858402 for ; Thu, 3 Feb 2022 18:13:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 871D93858402 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1643911985; bh=INJyHCnD6uMT/SPam7iAqthgpd39BTfkuuYhPUAG/Uo=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=WJYbIC62klLIWYHdPErRsASlEc29I2pu3JvnM4zbSZopEkrsD/a4nirXDpCaFQ9tY f+CAQSaKa9HDaxeI2m6ddZXDHqWTZcyCxbL79l663XQfhJdYa9Z2z9DbYma22nYSe0 uEW6dwAK5n3Bavpt86xkYqJz+HoT6wX0lpyQDInE= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by sourceware.org (Postfix) with ESMTPS id 9CE333858D37 for ; Thu, 3 Feb 2022 18:09:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9CE333858D37 Received: by mail-pf1-x432.google.com with SMTP id i17so2855358pfq.13 for ; Thu, 03 Feb 2022 10:09:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=INJyHCnD6uMT/SPam7iAqthgpd39BTfkuuYhPUAG/Uo=; b=M+E2KJUxb92jHloi7P4m0Uc2FP8xstLh+h3BBgWkbWhxn6iHHFOhJAcWeFGC9a1+ux 0+G+XGbZom/sw0Ui58PCryoVBW0offXqsFfiU/kSuISaj5/3mFOWXmR6jN4qy9HBHHEm b9eITShmwqDZoJVp+lowjiw97b7xet5TqGMJhP/23ZcAb28NdWo601jLAs04v1HJSEA2 K/7KNv8AvFFMLma+Hcf2YdJ2rUPIKUYV/VEjMDY5/D+Mwi80d61fmAit53sl21hfb3xY SFqm9EpKcsTD6HmjklUH/NZsM0BU2WNc5aKXgSWV2krzkoQ9CFI8AcniFf8iAdpA6+bi o8/A== X-Gm-Message-State: AOAM533HbR9wjbh6f05jZ85kZlP8bk2qtQsWwthSdQNll2Iq6RXSJsdi E6hCL4HP5UOz19t8jA8C47QQ6JW+6s4= X-Google-Smtp-Source: ABdhPJwsYVJIpnLucqNYrAHjbFP/HZiev0e5p0yWLR3zQXVwr/iT8vnIE37fQo6W0Yd61w3heoYlMQ== X-Received: by 2002:a05:6a00:cb:: with SMTP id e11mr34793609pfj.53.1643911790740; Thu, 03 Feb 2022 10:09:50 -0800 (PST) Received: from gnu-tgl-2.localdomain ([172.58.38.240]) by smtp.gmail.com with ESMTPSA id q19sm29142653pfn.159.2022.02.03.10.09.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 10:09:50 -0800 (PST) Received: from gnu-tgl-2.. (localhost [IPv6:::1]) by gnu-tgl-2.localdomain (Postfix) with ESMTP id DCF183004A8; Thu, 3 Feb 2022 10:09:48 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 4/7] x86/configure.ac: Define PI_STATIC_AND_HIDDEN/SUPPORT_STATIC_PIE Date: Thu, 3 Feb 2022 10:09:45 -0800 Message-Id: <20220203180948.2744-5-hjl.tools@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220203180948.2744-1-hjl.tools@gmail.com> References: <20220203180948.2744-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3029.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "H.J. Lu via Libc-alpha" From: "H.J. Lu" Reply-To: "H.J. Lu" Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Move PI_STATIC_AND_HIDDEN and SUPPORT_STATIC_PIE to sysdeps/x86/configure.ac. --- sysdeps/i386/configure | 6 ------ sysdeps/i386/configure.ac | 7 ------- sysdeps/x86/configure | 6 ++++++ sysdeps/x86/configure.ac | 7 +++++++ sysdeps/x86_64/configure | 6 ------ sysdeps/x86_64/configure.ac | 7 ------- 6 files changed, 13 insertions(+), 26 deletions(-) diff --git a/sysdeps/i386/configure b/sysdeps/i386/configure index ed46d53314..af50c5bfab 100644 --- a/sysdeps/i386/configure +++ b/sysdeps/i386/configure @@ -83,13 +83,7 @@ $as_echo "$libc_cv_ld_static_pie" >&6; } fi fi -$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h - - if test x"$multi_arch" != xno; then $as_echo "#define NO_HIDDEN_EXTERN_FUNC_IN_PIE 1" >>confdefs.h fi - -$as_echo "#define SUPPORT_STATIC_PIE 1" >>confdefs.h - diff --git a/sysdeps/i386/configure.ac b/sysdeps/i386/configure.ac index a6a0672835..234ef2454a 100644 --- a/sysdeps/i386/configure.ac +++ b/sysdeps/i386/configure.ac @@ -53,15 +53,8 @@ rm -f conftest*]) fi fi -dnl It is always possible to access static and hidden symbols in an -dnl position independent way. -AC_DEFINE(PI_STATIC_AND_HIDDEN) - dnl When multi-arch is enabled, all external functions must be called dnl via PIC PLT in PIE, which requires setting up EBX register. if test x"$multi_arch" != xno; then AC_DEFINE(NO_HIDDEN_EXTERN_FUNC_IN_PIE) fi - -dnl Static PIE is supported. -AC_DEFINE(SUPPORT_STATIC_PIE) diff --git a/sysdeps/x86/configure b/sysdeps/x86/configure index 7bdbfdc6dc..46d436fddf 100644 --- a/sysdeps/x86/configure +++ b/sysdeps/x86/configure @@ -189,3 +189,9 @@ $as_echo "$libc_cv_have_x86_movbe" >&6; } fi config_vars="$config_vars enable-x86-isa-level = $libc_cv_include_x86_isa_level" + +$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h + + +$as_echo "#define SUPPORT_STATIC_PIE 1" >>confdefs.h + diff --git a/sysdeps/x86/configure.ac b/sysdeps/x86/configure.ac index 10d5c2e0e5..918b636891 100644 --- a/sysdeps/x86/configure.ac +++ b/sysdeps/x86/configure.ac @@ -127,3 +127,10 @@ if test $libc_cv_include_x86_isa_level = yes; then fi fi LIBC_CONFIG_VAR([enable-x86-isa-level], [$libc_cv_include_x86_isa_level]) + +dnl It is always possible to access static and hidden symbols in an +dnl position independent way. +AC_DEFINE(PI_STATIC_AND_HIDDEN) + +dnl Static PIE is supported. +AC_DEFINE(SUPPORT_STATIC_PIE) diff --git a/sysdeps/x86_64/configure b/sysdeps/x86_64/configure index d4dd0aa7df..44b6055e55 100755 --- a/sysdeps/x86_64/configure +++ b/sysdeps/x86_64/configure @@ -27,11 +27,5 @@ if test x"$build_mathvec" = xnotset; then build_mathvec=yes fi -$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h - - -$as_echo "#define SUPPORT_STATIC_PIE 1" >>confdefs.h - - test -n "$critic_missing" && as_fn_error $? " *** $critic_missing" "$LINENO" 5 diff --git a/sysdeps/x86_64/configure.ac b/sysdeps/x86_64/configure.ac index c4c748c1d0..1215dcb1e4 100644 --- a/sysdeps/x86_64/configure.ac +++ b/sysdeps/x86_64/configure.ac @@ -14,12 +14,5 @@ if test x"$build_mathvec" = xnotset; then build_mathvec=yes fi -dnl It is always possible to access static and hidden symbols in an -dnl position independent way. -AC_DEFINE(PI_STATIC_AND_HIDDEN) - -dnl Static PIE is supported. -AC_DEFINE(SUPPORT_STATIC_PIE) - test -n "$critic_missing" && AC_MSG_ERROR([ *** $critic_missing])