From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by sourceware.org (Postfix) with ESMTPS id 0DDE43834420 for ; Tue, 2 Feb 2021 23:17:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0DDE43834420 Received: by mail-oi1-x229.google.com with SMTP id m13so24688852oig.8 for ; Tue, 02 Feb 2021 15:17:11 -0800 (PST) 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=l9VMMRTtKQZfiQ9vnf+at9GDcEnoxVSrfH/qsyJr0SM=; b=h12wsMw825494rtuZJofSnL72G5aEXEis7jc6JjYEzoRJBkFhrDQqUL8G+agyyA0l9 v+SOsGHiCJ441HsaPQXyUZKBNSEh8VidoBIzOWRt0iEpw+sPMf/LweiT4wZu70/ZSk1T s0rAEDRnfTFoQr7ODN9o7k8bNy9qQwtPPKssXglIjgN4oUBv26N3XZQ/UvWr6jfAfePO jgzn9NRanyULvTVAub5sBxEqSO/Bg2/uNxtb6H1Px1pIRltMy6Sj/a0jnQ613k1bBDmZ xxzp/iyq9SElrMUiXLbNRIEqYtrAVDboxMg/FQKuf1QnaKB5uUlNOEomqbSEGqNvTYms X7/w== X-Gm-Message-State: AOAM530PsCgI8qh8IJuGVTzTXVN/vJ0yWhI6dW+/O8xBmijV0VK9W3c1 UIUhTLdJDREGMAcOBp742hThMNHUrsGu8Tx3jBpti5fY2O0= X-Google-Smtp-Source: ABdhPJxRb6h+z8mW3PWOrYmSvUTnbn4OEZGQzBWMKj03fUJHafsuIEDZ8/esnecAEPGgu+6Xo5cvIFTM/1Aee/rE/Cw= X-Received: by 2002:aca:f503:: with SMTP id t3mr133693oih.79.1612307830457; Tue, 02 Feb 2021 15:17:10 -0800 (PST) MIME-Version: 1.0 References: <20210202215112.1002416-1-hjl.tools@gmail.com> In-Reply-To: From: "H.J. Lu" Date: Tue, 2 Feb 2021 15:16:34 -0800 Message-ID: Subject: Re: [PATCH] x86: Require full ISA support for x86-64 level marker [BZ #27318] To: Joseph Myers Cc: GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3029.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLACK autolearn=no 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: Tue, 02 Feb 2021 23:17:13 -0000 On Tue, Feb 2, 2021 at 3:11 PM Joseph Myers wrote: > > On Tue, 2 Feb 2021, H.J. Lu via Libc-alpha wrote: > > > Instead, we should require full ISA support for x86-64 level marker to > > detect such case: > > > > In file included from ../sysdeps/x86/abi-note.c:28: > > ../sysdeps/x86/isa-level.c:62:5: error: #error "Invalid ISAs for x86-64 ISA level v3" > > 62 | # error "Invalid ISAs for x86-64 ISA level v3" > > | ^~~~~ > > When does this error occur (what conditions for compilation / > configuration of glibc)? It happens at compile time when glibc is built with "-march=sandybridge". > It's definitely valid to build glibc with a compiler defaulting to any > -march option valid for x86_64, including those between two ISA levels > such as -march=sandybridge; that must not produce an error with default > configure options, and must produce a glibc binary that does in fact > execute correctly on the processor corresponding to the compiler default. > > It's OK for compiling glibc with -march=sandybridge to produce a glibc > binary that does not contain ISA level markers, or contains ISA level > markers that permit execution on some processors that don't have all the > instructions used in the binary. It's not OK for it to fail to compile > glibc, or to produce a binary that doesn't execute on Sandy Bridge. > We can add a configure option, --disable-isa-level, to unset INCLUDE_X86_ISA_LEVEL. The resulting libc.so doesn't have a marker and won't run on all machines. -- H.J.