From patchwork Mon Jan 24 04:06:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 50379 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 E96313858435 for ; Mon, 24 Jan 2022 04:06:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E96313858435 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1642997194; bh=UH7Lb6RnDKP7Qb4soSLReITNW6vgIMXT9g4ZTwubynM=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=xv9mP37jujQ/b4qQNdF10s68Fs57bq0vN28QIhRjeUVi1ic3vY4CF96ZtkCe2rZP5 qle49Cn1Fa9Uhgy6atz1vUW59HLQVwtWTXO/vl+zjNpVR/lZDWW+ZScnWQj1ulifAl bNBLqDUjTqG27NaQeXEUhFWMCgxY4UJzGwOtlYOg= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by sourceware.org (Postfix) with ESMTPS id F23993858C3A for ; Mon, 24 Jan 2022 04:06:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F23993858C3A Received: by mail-pg1-x530.google.com with SMTP id j10so2026457pgc.6 for ; Sun, 23 Jan 2022 20:06:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=UH7Lb6RnDKP7Qb4soSLReITNW6vgIMXT9g4ZTwubynM=; b=5cFKdsK8qx5vnigc1Wh6NQL3QtaY6DMDsvYqJTXcIHrxvkocKihNPsNtjrU9w4pEgo doZhItfm6hqKyzfEEnt4AQIlxsXT7hxhtvlmu6a2JxaR6pipgqoE9OkzJ42hwXAD10Lz WzyfeQOxWQrTwnKttjORnygpyrrkBKOMfJp8JW+PjI8PEmYDXBkzHWpDR0pm7xHRNIZ5 4WOtd+KvBOJtZpsfBpOj/n7qFQK88gxfk+yxiGBImUm/fS+V192ZQa4Kj7QPrmMDLKfs xP0K6VlYcmigpTrbAX3710QKeSDtevPQOP+3Y6aqOoJM2ynshmaJ23PzMEZs/z5ty5Aq 8apw== X-Gm-Message-State: AOAM530I21nMAcvZXHBTWwQYsO0zu0rGZQrU2lvhaEO6JtyaBTP++ZSm CL4Sg2gHyzF0kd55ckGrv1BEr050DW8= X-Google-Smtp-Source: ABdhPJxtED13Deqim4x/UDGI4ynL4qruTla0Pm+6dK+8aYkdfRXrPIk/c4z3kmtL1UbMrvOh4yVe7g== X-Received: by 2002:a63:8448:: with SMTP id k69mr10598946pgd.565.1642997170164; Sun, 23 Jan 2022 20:06:10 -0800 (PST) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id x25sm13731274pfu.91.2022.01.23.20.06.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 20:06:09 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id C54C21140025; Mon, 24 Jan 2022 14:36:06 +1030 (ACDT) Date: Mon, 24 Jan 2022 14:36:06 +1030 To: libc-alpha@sourceware.org Subject: [PATCH 5/5] Enable static-pie on powerpc64 Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3037.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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: Alan Modra via Libc-alpha From: Alan Modra Reply-To: Alan Modra Cc: Tulio Magno Quites Machado Filho Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Also regenerate another powerpc configure file that wasn't done when making the corresponding configure.ac change. With this series and latest gcc + binutils I get mostly working static-pie on powerpc64le-linux. There are a number of regressions: FAIL: elf/tst-glibc-hwcaps-cache FAIL: elf/tst-glibc-hwcaps-prepend-cache FAIL: elf/tst-ldconfig-bad-aux-cache FAIL: elf/tst-ldconfig-ld_so_conf-update FAIL: elf/tst-tlsifunc-static * sysdeps/powerpc/powerpc64/configure.ac (SUPPORT_STATIC_PIE): Define. (PI_STATIC_AND_HIDDEN): Define. * sysdeps/powerpc/powerpc64/configure: Regenerate. * sysdeps/unix/sysv/linux/powerpc/configure: Regenerate. diff --git a/sysdeps/powerpc/powerpc64/configure b/sysdeps/powerpc/powerpc64/configure index fddea0355a..4a219ab8ac 100644 --- a/sysdeps/powerpc/powerpc64/configure +++ b/sysdeps/powerpc/powerpc64/configure @@ -1,6 +1,13 @@ # This file is generated from configure.ac by Autoconf. DO NOT EDIT! # Local configure fragment for sysdeps/powerpc/powerpc64. +$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h + + +# Static PIE is supported. +$as_echo "#define SUPPORT_STATIC_PIE 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for support for overlapping .opd entries" >&5 $as_echo_n "checking for support for overlapping .opd entries... " >&6; } if ${libc_cv_overlapping_opd+:} false; then : diff --git a/sysdeps/powerpc/powerpc64/configure.ac b/sysdeps/powerpc/powerpc64/configure.ac index 1f3d54414c..5eedd2f81c 100644 --- a/sysdeps/powerpc/powerpc64/configure.ac +++ b/sysdeps/powerpc/powerpc64/configure.ac @@ -1,6 +1,13 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. # Local configure fragment for sysdeps/powerpc/powerpc64. +dnl It is always possible to access static and hidden symbols in an +dnl position independent way. +AC_DEFINE(PI_STATIC_AND_HIDDEN) + +# Static PIE is supported. +AC_DEFINE(SUPPORT_STATIC_PIE) + AC_CACHE_CHECK(for support for overlapping .opd entries, libc_cv_overlapping_opd, [dnl libc_cv_overlapping_opd=no diff --git a/sysdeps/unix/sysv/linux/powerpc/configure b/sysdeps/unix/sysv/linux/powerpc/configure index a4c809fd98..7183573bc0 100644 --- a/sysdeps/unix/sysv/linux/powerpc/configure +++ b/sysdeps/unix/sysv/linux/powerpc/configure @@ -93,7 +93,13 @@ EOF $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then - libc_linker_feature=yes + if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,--no-tls-get-addr-optimize -nostdlib \ + -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ + | grep "warning: --no-tls-get-addr-optimize ignored" > /dev/null 2>&1; then + true + else + libc_linker_feature=yes + fi fi rm -f conftest* fi