From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12668 invoked by alias); 21 Nov 2014 23:20:35 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 12653 invoked by uid 89); 21 Nov 2014 23:20:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 21 Nov 2014 23:20:33 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1XrxV6-0001oD-Aq from joseph_myers@mentor.com ; Fri, 21 Nov 2014 15:20:28 -0800 Received: from digraph.polyomino.org.uk (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.181.6; Fri, 21 Nov 2014 23:20:26 +0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.82) (envelope-from ) id 1XrxV4-0002n6-8C; Fri, 21 Nov 2014 23:20:26 +0000 Date: Fri, 21 Nov 2014 23:49:00 -0000 From: Joseph Myers To: Ilya Enkovich CC: Jeff Law , Andi Kleen , gcc-patches Subject: Re: [PATCH, MPX runtime 1/2] Integrate MPX runtime library In-Reply-To: <20141121153405.GB30483@msticlxl57.ims.intel.com> Message-ID: References: <20141112160432.GA5697@msticlxl57.ims.intel.com> <20141119141555.GD47331@msticlxl57.ims.intel.com> <546CD981.1040002@redhat.com> <20141121153405.GB30483@msticlxl57.ims.intel.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2014-11/txt/msg02875.txt.bz2 On Fri, 21 Nov 2014, Ilya Enkovich wrote: > +# Disable libmpx on unsupported systems. > +if test -d ${srcdir}/libmpx; then > + if test x$enable_libmpx = x; then > + AC_MSG_CHECKING([for libmpx support]) > + if (srcdir=${srcdir}/libmpx; \ > + . ${srcdir}/configure.tgt; \ > + test "$LIBMPX_SUPPORTED" != "yes") > + then > + AC_MSG_RESULT([no]) > + noconfigdirs="$noconfigdirs target-libmpx" > + else > + AC_MSG_RESULT([yes]) > + fi > + fi > +fi Using this at toplevel you can only enable or disable for all multilibs - this code runs just once. But: > diff --git a/libmpx/configure.tgt b/libmpx/configure.tgt > +LIBMPX_SUPPORTED=no > +case "${target}" in > + x86_64-*-linux* | i?86-*-linux*) > + # X32 doesn't support MPX. > + echo "int i[sizeof (void *) == 4 ? 1 : -1] = { __x86_64__ };" > conftestx.c > + if ${CC} ${CFLAGS} -c -o conftestx.o conftestx.c > /dev/null 2>&1; then > + LIBMPX_SUPPORTED=no > + else > + LIBMPX_SUPPORTED=yes > + fi > + ;; Here you are testing something per-multilib. Furthermore, using CC and CFLAGS here is wrong when used by toplevel configure, as at toplevel they'll relate to the host rather than the target. So you need to separate the two tests of (a) might MPX be supported for some multilib on the target (usable at toplevel, not using CC or CFLAGS) and (b) is it supported for the present multilib. Thus the libmpx directory will need configuring for all multilibs for supported targets. Then, if the particular multilib doesn't support it (i.e. is x32), you'll need to arrange for the directory not to build or install anything - much like the libquadmath directory gets configured in some cases where it doesn't build anything. -- Joseph S. Myers joseph@codesourcery.com