From patchwork Thu Oct 12 21:09:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 115679 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp2376161qgn; Thu, 12 Oct 2017 14:10:30 -0700 (PDT) X-Received: by 10.101.83.140 with SMTP id x12mr617066pgq.425.1507842630262; Thu, 12 Oct 2017 14:10:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507842630; cv=none; d=google.com; s=arc-20160816; b=fN0qVM/dP3wZ0ipqCBzIeSLNOeM5Z3G2EJlNOdmE+AIzLexAUlgC5KtvD3W3JgODuS PRrw0RY0cxqgSVo4cOhqSOWCxggBxIgGK6bkDk3dNSy9UBVglFAiDw6ibCE2yY27Ccb0 hrgJrGV606xiJxc/R0fOqG8tx83h3nXCc/H/mSAtxP9lXCcRCsDDJ3h0PU+1CLN69HB3 nuefKC6reOd0/Kw5yLTaoZBTtrTYlvHkOpm6EoR92Si5UK2ynAUIylVw6MqmXKf/cvNw lJq0Hwu5eo+Ua9gFXBNkFE76YQb3xowfXGTJoxEDDISSiHu1MC/qLoGtA2r+/NjjOZb+ JyiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:to:from:delivered-to:sender:list-help :list-post:list-archive:list-subscribe:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=othSC5QcrvKtS2BX1hBUJaqN5Bc0g4zVbgg9KfxTK8A=; b=Jw9mPb1krM8M9z4Gr2K2idLMOCzURo8fx5jGvYMUi12TjIjtlpk6i6jjE0wHZH7u/C qcledgu8USxYdAaIQkTNDU1m267X+lsRycckz1u8SNBsFsrfWLxp2lfybebmIgDnissF ZIKemSBrktPmiSXxzbVzVvdrZmc/uGBcUUPpJ5idO5m1ZIMCgQdVXALg3LZSV5NAPl2q D8aC2DHq1BdgPUIREHgTjTH7sIs8yQR43dO1S/HvIRsofw1zP9xwRNuL0gM/wjjAo1cr Mg1LhemTily2SQBkB/8pPA2v7vuOP/a+0HklymDHyotRAGyEmOlMqm054MTtlopcYRyx tg1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=ro5H8SLh; spf=pass (google.com: domain of libc-alpha-return-85764-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-85764-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 9si2029545pfw.188.2017.10.12.14.10.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Oct 2017 14:10:30 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-85764-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=ro5H8SLh; spf=pass (google.com: domain of libc-alpha-return-85764-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-85764-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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; q=dns; s= default; b=rijNccNRbBJzp15FzrGls6es9hSrg1gG9AaRL5d1nE4yqrKxEY0eh aV5ey4ETfKZ2seSImtoYQFUT6TI7EgCXAwIRxOU8HkcLyvP+WpPJUIfNY0i2ltAF rTBAjFvCWBFmDtHHZ6BURvI8vYLoKN7vOPgkND8w9Ga2oi2BcINeZE= 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; s=default; bh=0KZRP9tBPcsLprkuwNFjoO0iFZ8=; b=ro5H8SLhtVV4DibVboEDgNF+d6Ns BL9Fggkcf4NZ1SiW059AQsStyYmmaF4UO5DrmDV8B6L6dxydecezYg5gVlbUoLdy GqxvHeSGYkOKb4tyN13w9xDh4TVQWRROfzjphC8/pE73Bypp9c3JdSGro8ZI2AYK Sx2blJ+Un+Z8TxM= Received: (qmail 102578 invoked by alias); 12 Oct 2017 21:10:03 -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 101943 invoked by uid 89); 12 Oct 2017 21:10:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:3838, 6346 X-HELO: mail-qk0-f170.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=othSC5QcrvKtS2BX1hBUJaqN5Bc0g4zVbgg9KfxTK8A=; b=q50N0JzBlyUceE6H5NDt0bkbLEbp2PYFPQ6nYvyn+Ue3NOvAbIpsKx55MgEUXe2DC4 oKpEsF9BWo8b5XOBECJnFTGbjDzKgBgYKDOkaRgQ/hgyUzp7VpGqXViBCPrlicJpW0PQ Xbv3nq9vThOqW1TsJ/HP1DIW9RFJoWh+rEziPi3p8+zPGaC8DcN3V1vxXzh+/AEVsszT ePvnTFlUb3QFPOAalUSeEkxKiYGlQijK+qkvtcMFN/BEpFdg54GCZbKX8X63Kw3AIHSZ lrtB5evv+wws1brnzih5ylGJn8uhjrR9JTxqhosVCT0MMMmm92tpKaOXPCxmlWYOq0ab jfSw== X-Gm-Message-State: AMCzsaUzO4pig2TJJyKOM3meBUQUXYlVoDNPgM7LH/P4QofCxs/5K8Oc k5sag2ova+GI9m1drXowhcx/CFS+C3k= X-Google-Smtp-Source: AOwi7QCQdkgbpv7gSJArpoljF8RnmKj6UBNBeZLTNwd/DhkBuE+eSeCK+f2acJFCf5tQ5nxP7mC40A== X-Received: by 10.55.98.205 with SMTP id w196mr2529951qkb.322.1507842594437; Thu, 12 Oct 2017 14:09:54 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 1/5] Avoid build multiarch if compiler warns about mismatched alias Date: Thu, 12 Oct 2017 18:09:40 -0300 Message-Id: <1507842584-28674-1-git-send-email-adhemerval.zanella@linaro.org> GCC 8 emits a warning for alias for functions with incompatible types and it is used extensivelly for ifunc resolvers implementations in C (for instance on weak_alias with the internal symbol name to the external one or with the libc_hidden_def to set ifunc for internal usage). This breaks the build when the ifunc resolver is not defined using gcc attribute extensions (HAVE_GCC_IFUNC being 0). Although for all currently architectures that have multiarch support this compiler options is enabled for default, there is still the option where the user might try build glibc with a compiler without support for such extension. In this case this patch just disable the multiarch folder in sysdeps selections. GCC 7 and before still builds IFUNCs regardless of compiler support (although for the lack of attribute support debug information would be optimal). The patch also fixes the default value of the multiarch support in configure.ac (the correct value which is tested later in the script assumes 'yes' instead of 'default'). Checked with a build on multiarch support architectures (aarch64,a arm, sparc, s390, powerpc, x86_64, i386) with multiarch enable and disable and with GCC 7 and GCC 8. * configure.ac (multi_arch): Use 'yes' as default value. (libc_cv_gcc_incompatbile_alias): New define: indicates whether compiler emits an warning for alias for functions with incompatible types. --- ChangeLog | 7 +++++++ configure | 39 ++++++++++++++++++++++++++++++++++++++- configure.ac | 31 ++++++++++++++++++++++++++++++- 3 files changed, 75 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/configure.ac b/configure.ac index 195e81a..647aaa6 100644 --- a/configure.ac +++ b/configure.ac @@ -304,7 +304,7 @@ AC_ARG_ENABLE([multi-arch], AC_HELP_STRING([--enable-multi-arch], [enable single DSO with optimizations for multiple architectures]), [multi_arch=$enableval], - [multi_arch=default]) + [multi_arch=yes]) AC_ARG_ENABLE([experimental-malloc], AC_HELP_STRING([--disable-experimental-malloc], @@ -634,6 +634,26 @@ if ${CC-cc} -c conftest.c -o conftest.o 1>&AS_MESSAGE_LOG_FD \ fi rm -f conftest*]) +# Check if gcc warns about alias for function with incompatible types. +AC_CACHE_CHECK([if compiler warns about alias for function with incompatible types], + libc_cv_gcc_incompatible_alias, [dnl +cat > conftest.c <&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ; then + libc_cv_gcc_incompatible_alias=no +fi +rm -f conftest*]) + if test x"$libc_cv_ld_gnu_indirect_function" != xyes; then if test x"$multi_arch" = xyes; then AC_MSG_ERROR([--enable-multi-arch support requires assembler and linker support]) @@ -645,6 +665,15 @@ if test x"$libc_cv_gcc_indirect_function" != xyes && test x"$multi_arch" = xyes; then AC_MSG_WARN([--enable-multi-arch support recommends a gcc with gnu-indirect-function support. Please use a gcc which supports it by default or configure gcc with --enable-gnu-indirect-function]) + # GCC 8+ emits and warning for alias with incompatible types and thus fail + # to build ifunc resolvers aliases to either weak or internal symbols. + # Disables multiarch build in this case. + if test x"$libc_cv_gcc_incompatible_alias" == xyes && + test x"$enable_werror" == xyes; then + AC_MSG_WARN([gcc emits a warning for alias between functions of incompatible types +and -Werror is enabled. Multi-arch is disabled. ]) + multi_arch=no + fi fi multi_arch_d= if test x"$multi_arch" != xno; then