From patchwork Wed Feb 20 16:29:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1045457 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-100172-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="H8KBv7u8"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444NNJ2wljz9s5c for ; Thu, 21 Feb 2019 03:29:19 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-transfer-encoding; q=dns; s=default; b=lGnl0yIscNDd7eAB X+hisO5mR79ZRRBVenHBWwSlegFgUm8gIRnN+KovSl424TEeiQwHon8e2JGbDMax JC+6R0FYUhBDmCWAutJ0Acrd2x8G0u0HTot2uw0AalTasdf8KQehCdGdHNQPfN3j tRGckCgAy0G76YpYEn7kwCtC5js= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-transfer-encoding; s=default; bh=YjZSGyROFwrhdaPBCHcpZj /jZoI=; b=H8KBv7u852wTPpRkT7hhPC/i9FyES8vSHCSYyL5J/3LwxlrUMhF0Xp 07zJsTvAvQP+jm+rPHs1j2IbGVC5CnjkUqNvs7y+YXJ4AIdPNEfNxrVxHVvY48Vm Beo1vJqc5hd6NrvuYYo2ezbCzX+erXzylSgMxDjZjyvBNN1beH1XA= Received: (qmail 75457 invoked by alias); 20 Feb 2019 16:29:10 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 75308 invoked by uid 89); 20 Feb 2019 16:29:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=HContent-Transfer-Encoding:8bit X-HELO: mga03.intel.com From: "H.J. Lu" To: libc-alpha@sourceware.org Subject: [PATCH] elf/Makefile: Run IFUNC tests if binutils supports IFUNC Date: Wed, 20 Feb 2019 08:29:03 -0800 Message-Id: <20190220162903.13315-1-hjl.tools@gmail.com> MIME-Version: 1.0 We should run IFUNC tests with --disable-multi-arch if the toolchain supports IFUNCs. For correctness, --disable-multi-arch must not remove IFUNC support from the loader. Tested on x86-64, x32 and i686 with and without --disable-multi-arch. * configure.ac (have-ifunc): New LIBC_CONFIG_VAR. * configure: Regenerated. * elf/Makefile: Run IFUNC tests if binutils supports IFUNC. Reviewed-by: Tulio Magno Quites Machado Filho --- configure | 2 ++ configure.ac | 1 + elf/Makefile | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 2643db9fb7..c773c487b5 100755 --- a/configure +++ b/configure @@ -6794,6 +6794,8 @@ if test x"$libc_cv_ld_gnu_indirect_function" = xyes; then $as_echo "#define HAVE_IFUNC 1" >>confdefs.h fi +config_vars="$config_vars +have-ifunc = $libc_cv_ld_gnu_indirect_function" if test x"$libc_cv_gcc_indirect_function" = xyes; then $as_echo "#define HAVE_GCC_IFUNC 1" >>confdefs.h diff --git a/configure.ac b/configure.ac index ad50e290d4..598ba6c4ae 100644 --- a/configure.ac +++ b/configure.ac @@ -1804,6 +1804,7 @@ AC_SUBST(libc_cv_gcc_unwind_find_fde) if test x"$libc_cv_ld_gnu_indirect_function" = xyes; then AC_DEFINE(HAVE_IFUNC) fi +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) diff --git a/elf/Makefile b/elf/Makefile index faec577d1c..e44960e5fe 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -321,7 +321,7 @@ modules-names-nobuild := filtmod1 tests += $(tests-static) -ifneq (no,$(multi-arch)) +ifeq (yes,$(have-ifunc)) tests-ifuncstatic := ifuncmain1static ifuncmain1picstatic \ ifuncmain2static ifuncmain2picstatic \ ifuncmain4static ifuncmain4picstatic \