From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) by sourceware.org (Postfix) with ESMTPS id 8F6DC3857829 for ; Wed, 24 Mar 2021 00:23:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8F6DC3857829 Received: by mail-ot1-x329.google.com with SMTP id 91-20020a9d08640000b0290237d9c40382so31625oty.12 for ; Tue, 23 Mar 2021 17:23:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=r60WAouzfhxr1sVS3f4unL5RJDhllN8cn6iWETfNLaQ=; b=i/pnqYVCgljiZSD1/JHmsoWvGKUic2cPAr+U/k9sFX8OJgR99lfs9+eNc6wFpNjnjR iu7p/JkblRFYzpEwgIpL/zix2KJx5goZ9SOERejKpmGT+CElTB/zQMiipP954KjuQQ2R dRlP4OkueoMUp1kZezItTk30NhIZXksKFNsGabvi3Lgsvx5u9WLvxR3kkjrlAT4mpJYr f57UjRP0NROoPxfR4E1EMsgPi+7BjScLaB16vBfCU2bmYa9WeREDqZcs3ZkBtn7uVkNM Yz2sRaiHbf7Rb7SdFVdUF0Sd0ZjmjsJutvW+0/OhzYHpTnMQzIT3k2uypBJESEG9G0n3 VRpw== X-Gm-Message-State: AOAM530z6WRLzxSFY8ZCorMP67Spm71389SnGi968Zm+u78CGU1Xp74h nYSzjkKDg2hIWU4RNPBcnkJS3go+OleKEuhliTfkn8Jg X-Google-Smtp-Source: ABdhPJyrRJLi6supzrN/BVbzfGYYE76mbuSLzq5D6lRgWUQ+ib843kwq672KOToVr+GfbU/JgoWlhfo3qFBkLoSGdu0= X-Received: by 2002:a05:6830:90c:: with SMTP id v12mr797520ott.179.1616545404923; Tue, 23 Mar 2021 17:23:24 -0700 (PDT) MIME-Version: 1.0 References: <20210324001150.336441-1-samuel.thibault@ens-lyon.org> In-Reply-To: <20210324001150.336441-1-samuel.thibault@ens-lyon.org> From: "H.J. Lu" Date: Tue, 23 Mar 2021 17:22:48 -0700 Message-ID: Subject: Re: [PATCH] elf: Fix not compiling ifunc tests that need gcc ifunc support To: Samuel Thibault Cc: GNU C Library , commit-hurd@gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3034.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 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Wed, 24 Mar 2021 00:23:27 -0000 On Tue, Mar 23, 2021 at 5:13 PM Samuel Thibault wrote: > > --- > configure.ac | 1 + > elf/Makefile | 17 ++++++++++++----- > elf/ifuncmain9.c | 16 ---------------- > sysdeps/x86/Makefile | 2 ++ > 4 files changed, 15 insertions(+), 21 deletions(-) > > diff --git a/configure.ac b/configure.ac > index 16b15b6f90..6a3a9ab620 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -1770,6 +1770,7 @@ LIBC_CONFIG_VAR([have-ifunc], [$libc_cv_ld_gnu_indirect_function]) > if test x"$libc_cv_gcc_indirect_function" = xyes; then > AC_DEFINE(HAVE_GCC_IFUNC) > fi > +LIBC_CONFIG_VAR([have-gcc-ifunc], [$libc_cv_gcc_indirect_function]) > > # This is far from the AC_ARG_ENABLE that sets it so that a sysdeps > # configure fragment can override the value to prevent this AC_DEFINE. > diff --git a/elf/Makefile b/elf/Makefile > index 3b8e13e066..0bef49e53d 100644 > --- a/elf/Makefile > +++ b/elf/Makefile > @@ -395,8 +395,10 @@ tests-ifuncstatic := ifuncmain1static ifuncmain1picstatic \ > ifuncmain2static ifuncmain2picstatic \ > ifuncmain4static ifuncmain4picstatic \ > ifuncmain5static ifuncmain5picstatic \ > - ifuncmain7static ifuncmain7picstatic \ > - ifuncmain9static ifuncmain9picstatic > + ifuncmain7static ifuncmain7picstatic > +ifeq (yes,$(have-gcc-ifunc)) > +tests-ifuncstatic += ifuncmain9static ifuncmain9picstatic > +endif > tests-static += $(tests-ifuncstatic) > tests-internal += $(tests-ifuncstatic) > ifeq (yes,$(build-shared)) > @@ -407,15 +409,20 @@ tests-internal += \ > ifuncmain1staticpic \ > ifuncmain2 ifuncmain2pic ifuncmain3 ifuncmain4 \ > ifuncmain5 ifuncmain5pic ifuncmain5staticpic \ > - ifuncmain7 ifuncmain7pic \ > - ifuncmain9 ifuncmain9pic > + ifuncmain7 ifuncmain7pic > +ifeq (yes,$(have-gcc-ifunc)) > +tests-internal += ifuncmain9 ifuncmain9pic > +endif > ifunc-test-modules = ifuncdep1 ifuncdep1pic ifuncdep2 ifuncdep2pic \ > ifuncdep5 ifuncdep5pic > extra-test-objs += $(ifunc-test-modules:=.o) > test-internal-extras += $(ifunc-test-modules) > ifeq (yes,$(have-fpie)) > ifunc-pie-tests = ifuncmain1pie ifuncmain1vispie ifuncmain1staticpie \ > - ifuncmain5pie ifuncmain6pie ifuncmain7pie ifuncmain9pie > + ifuncmain5pie ifuncmain6pie ifuncmain7pie > +ifeq (yes,$(have-gcc-ifunc)) > +ifunc-pie-tests += ifuncmain9pie > +endif > ifeq (yes,$(have-textrel_ifunc)) > ifunc-pie-tests += tst-ifunc-textrel > endif > diff --git a/elf/ifuncmain9.c b/elf/ifuncmain9.c > index e775c5cfa9..15419a159a 100644 > --- a/elf/ifuncmain9.c > +++ b/elf/ifuncmain9.c > @@ -20,8 +20,6 @@ > > #include > > -#ifdef HAVE_GCC_IFUNC > - > # include > # include > > @@ -92,17 +90,3 @@ main (void) > > return errors; > } > - > -#else /* !HAVE_GCC_IFUNC */ > - > -# include > - > -static int > -do_test (void) > -{ > - FAIL_UNSUPPORTED ("GCC does not support the ifunc attribute"); > - return 1; /* Not reachable. */ > -} > - > -# include > -#endif > diff --git a/sysdeps/x86/Makefile b/sysdeps/x86/Makefile > index 3ca7bfefe4..8186e45fec 100644 > --- a/sysdeps/x86/Makefile > +++ b/sysdeps/x86/Makefile > @@ -16,6 +16,7 @@ tests-static += tst-get-cpu-features-static \ > tst-cpu-features-cpuinfo-static \ > tst-cpu-features-supports-static > ifeq (yes,$(have-ifunc)) > +ifeq (yes,$(have-gcc-ifunc)) > tests += \ > tst-ifunc-isa-1 \ > tst-ifunc-isa-1-static \ > @@ -25,6 +26,7 @@ tests-static += \ > tst-ifunc-isa-1-static \ > tst-ifunc-isa-2-static > endif > +endif > ifeq (yes,$(enable-x86-isa-level)) > tests += tst-isa-level-1 > modules-names += tst-isa-level-mod-1-baseline \ > -- > 2.30.2 > LGTM. Thanks. -- H.J.