From patchwork Sun Oct 10 23:23:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fangrui Song X-Patchwork-Id: 46052 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 D4E0D385840A for ; Sun, 10 Oct 2021 23:24:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D4E0D385840A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1633908243; bh=738rn4lN7Tm2Ka7uZpJTUSSBYLdoKNKEdzWaVxl+HMo=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=YBFG3QyAXsQk2gF+CBOZs7tzVmUUQCC387F5Nx+hYQL7hhnOi76ERfu1GF2LhwwhZ vyqMr8QTewZbTQSS+iLDCkImgMrR1r/XKKrTfdh5rcN61ERh8sLrlfmg2euBQ3Jsda QolHCy+kgq761atzx6Cd+G9d5EGC+eR+9w4laymg= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by sourceware.org (Postfix) with ESMTPS id 607CE3858D28 for ; Sun, 10 Oct 2021 23:23:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 607CE3858D28 Received: by mail-yb1-xb49.google.com with SMTP id x16-20020a25b910000000b005b6b7f2f91cso21039018ybj.1 for ; Sun, 10 Oct 2021 16:23:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=738rn4lN7Tm2Ka7uZpJTUSSBYLdoKNKEdzWaVxl+HMo=; b=QaqcEPfHu4fIg/fFHrJiuhNGtmXNOpz3FmCKO9hHlCr/W4a92TRSh5jkl5+4hfdxnn pRK11pkId2am19SpRY2KMoX/a6zRakT7xpYNZtFnpcW+a9pcUG0u56XWTSF5rgglbAwW H9AAd07wsdcZ6uXMn+Tb8gJTtPN/Ha23vnUoBPQJGMuKAudfnqEuPAqNTKiEtL9Ox1VL eNzn5ltDv6oSeitPuLeGb+Tl9WqZ34+hYdeKM7eNnLbTtQzwNzzi1nvftlFs0sWna/X0 2TXmXSglovxlTJzPeWXeJCehxnLXk+5roqnkFlgbXkSJEZaOz2VD+MbOIdjPPnLzOM9a z5+A== X-Gm-Message-State: AOAM530xNF6MdimVBXffvWXu4swMRglkV56QZkoaeZ3eer1Zpm0cxRWb 9bCaeUDrZOY8073bgCCmX5tnheG+hsIMGAFrxfpm3vXxZ15Dbpe7HdXCTbewz1J2sMSco0QIvM5 hdIo/0pl6TsnRjNPkpUUt43jFo2/LvYTXhllBIYrDcXNeFzy4gL8LY4z5prjDqNymZf5r X-Google-Smtp-Source: ABdhPJzdiu7mjDBxlKxnJ4kxtzgu6qISauzrbk6SeNQYvlu58rj0FXrjPWi126vLFLlrHLnY1+wAudLkuLme X-Received: from maskray1.svl.corp.google.com ([2620:15c:2ce:200:f9c1:a45d:226f:b90b]) (user=maskray job=sendgmr) by 2002:a25:76d1:: with SMTP id r200mr17489257ybc.207.1633908218873; Sun, 10 Oct 2021 16:23:38 -0700 (PDT) Date: Sun, 10 Oct 2021 16:23:35 -0700 Message-Id: <20211010232335.1679420-1-maskray@google.com> Mime-Version: 1.0 Subject: [PATCH] x86_64: Improve Intel MPX check to reject incomplete Clang support To: libc-alpha@sourceware.org, "H.J. Lu" X-Spam-Status: No, score=-19.8 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL 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: Fangrui Song via Libc-alpha From: Fangrui Song Reply-To: Fangrui Song Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" LLVM integrated assembler has incomplete MPX support, e.g. bnd is not supported while bndmov is supported: error: invalid instruction mnemonic 'bnd' Improve the configure check so that HAVE_MPX_SUPPORT code can be properly skipped. --- sysdeps/x86_64/configure | 2 ++ sysdeps/x86_64/configure.ac | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sysdeps/x86_64/configure b/sysdeps/x86_64/configure index 585279f83d..c3145e6030 100755 --- a/sysdeps/x86_64/configure +++ b/sysdeps/x86_64/configure @@ -30,6 +30,8 @@ if ${libc_cv_asm_mpx+:} false; then : else cat > conftest.s <<\EOF bndmov %bnd0,(%rsp) + bnd + jmp *%r11 EOF if { ac_try='${CC-cc} -c $ASFLAGS conftest.s 1>&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 diff --git a/sysdeps/x86_64/configure.ac b/sysdeps/x86_64/configure.ac index 29e14033c0..3c935d66e1 100644 --- a/sysdeps/x86_64/configure.ac +++ b/sysdeps/x86_64/configure.ac @@ -14,6 +14,8 @@ dnl Check whether asm supports Intel MPX AC_CACHE_CHECK(for Intel MPX support, libc_cv_asm_mpx, [dnl cat > conftest.s <<\EOF bndmov %bnd0,(%rsp) + bnd + jmp *%r11 EOF if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then libc_cv_asm_mpx=yes