From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by sourceware.org (Postfix) with ESMTPS id 578C93834EE7 for ; Thu, 17 Nov 2022 16:49:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 578C93834EE7 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-x52e.google.com with SMTP id e13so3394705edj.7 for ; Thu, 17 Nov 2022 08:49:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=36iY4Rt49vXtU7oVVIufy8Mtt3Nj+7rZnYVrcC5mfLA=; b=h9B4ljIMrBiuXCwaWv4vYEpwHxDBa0QiQGyWh6sXAH4Jl89dFebon/ljPJwxc7QrKp dSjer2h3JQExPadndym5GHrJFHDjg92NAae/EOgWD/cV5pyey+logmdo/wUlZ26kd2c7 4/aBt9X21CWZBhBDCG9OeVYtETFDXJYviveNAAVq/S9tE5WIQY1GMHCIx9YOtSWrwoEG GbeQpsZGofL6eiXefic63UuVrsw5m/bKG6cmv+dBK/GgD6TktP160w8EH4s0gaF0RQot jAzXuAXwHmu4UTW1JdP39nSsADQGMJDUVWoOxKZVIwn1YW0MVyajEX7/J2lB7El1dtoz xVuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=36iY4Rt49vXtU7oVVIufy8Mtt3Nj+7rZnYVrcC5mfLA=; b=hGP/UXHv/bEG3NmRxTwGKwPKO4NAOM7YQQS/XD2JFJ5ugNfc8oqTcDDLLPikVn+4kU A9ONrt/w0zgT7c1AvZHdGajQhv+ZUEYZrxgHabkeifvY3QdGOp2HMEaDlHnxGf8pmKcB 477uK8XkaaIyqru+rxoU7hD4ExGo4b+YkenG+oDsHjdXz+PZ0tX7GzrjvsTvygMQRiKB dkf1e/UGAaMcWVM3snDgYKol7TCNUvUzHxfSGBGitweJBMuCAZVkUbT2sUSraxKZir0S m2GXuNYfkU8JLwkkSQp8VzbKFMASU8rFIj/qx2VaSK84dJ4lRlHRaFNfeSKJVgyVHD24 TLUA== X-Gm-Message-State: ANoB5plIS9H9k+dGBFS3Rj3uiU91scI2msNG7URZSJmMeTX7aF398dE4 +yEFQTYy6k1UI8jpeuP1AlsWWNCCbNDI5E3l710Xd7qfpsQ= X-Google-Smtp-Source: AA0mqf75IFvVnBgHYJSy1JfaKFNBlV4dR0Bl9wzMWwJE2KwwPcvKtsnsq22CKQ+Rse3nZFVTfCNg5r7FVDjjIiQXABc= X-Received: by 2002:a05:6402:4027:b0:468:fc39:e89 with SMTP id d39-20020a056402402700b00468fc390e89mr908582eda.170.1668703750959; Thu, 17 Nov 2022 08:49:10 -0800 (PST) MIME-Version: 1.0 References: <5c07cdb4-ec26-c7bf-087a-4d0c75ef8549@suse.com> In-Reply-To: From: "H.J. Lu" Date: Thu, 17 Nov 2022 08:48:32 -0800 Message-ID: Subject: Re: [PATCH 2/2] x86: break gas dependency on libopcodes To: Jan Beulich Cc: Binutils Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3017.5 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, Nov 17, 2022 at 5:29 AM Jan Beulich wrote: > > The only item gas still consumes from libopcodes is i386_seg_prefixes[], > which again is used by gas alone. Move it into the assembler, allowing > to remove the linking in of libopcodes. > > To compensate, tie table generation in opcodes/ to the building of > i386-dis.o, despite the file not really depending on the generated data. > --- > RFC: Is there a better way to specify extra dependencies, such that > table generation and compilation of i386-dis.c could be kept > separate (and hence processable in parallel)? > > --- a/gas/config/tc-i386.c > +++ b/gas/config/tc-i386.c > @@ -445,6 +445,16 @@ struct _i386_insn > > typedef struct _i386_insn i386_insn; > > +/* To be indexed by segment register number. */ > +static const unsigned char i386_seg_prefixes[] = { > + ES_PREFIX_OPCODE, > + CS_PREFIX_OPCODE, > + SS_PREFIX_OPCODE, > + DS_PREFIX_OPCODE, > + FS_PREFIX_OPCODE, > + GS_PREFIX_OPCODE > +}; > + > /* Link RC type with corresponding string, that'll be looked for in > asm. */ > struct RC_name > --- a/gas/configure > +++ b/gas/configure > @@ -12263,7 +12263,7 @@ _ACEOF > > # Do we need the opcodes library? > case ${cpu_type} in > - vax | tic30) > + vax | tic30 | i386) > ;; > > *) > --- a/gas/configure.ac > +++ b/gas/configure.ac > @@ -420,7 +420,7 @@ changequote([,])dnl > > # Do we need the opcodes library? > case ${cpu_type} in > - vax | tic30) > + vax | tic30 | i386) > ;; This change isn't needed to move i386_seg_prefixes to gas. > *) > --- a/opcodes/Makefile.am > +++ b/opcodes/Makefile.am > @@ -162,7 +162,6 @@ TARGET32_LIBOPCODES_CFILES = \ > h8300-dis.c \ > hppa-dis.c \ > i386-dis.c \ > - i386-opc.c \ > ip2k-asm.c \ > ip2k-desc.c \ > ip2k-dis.c \ > @@ -564,7 +563,7 @@ $(srcdir)/i386%tbl.h $(srcdir)/i386%init > > # While not really dependencies, specify i386-{init,tbl}.h here as well to > # make sure they are re-generated as necessary. > -i386-opc.lo: $(srcdir)/i386-tbl.h $(srcdir)/i386-init.h > +i386-dis.lo: $(srcdir)/i386-tbl.h $(srcdir)/i386-init.h > > ia64-gen$(EXEEXT_FOR_BUILD): ia64-gen.o $(BUILD_LIB_DEPS) > $(AM_V_CCLD)$(LINK_FOR_BUILD) ia64-gen.o $(BUILD_LIBS) > --- a/opcodes/Makefile.in > +++ b/opcodes/Makefile.in > @@ -554,7 +554,6 @@ TARGET32_LIBOPCODES_CFILES = \ > h8300-dis.c \ > hppa-dis.c \ > i386-dis.c \ > - i386-opc.c \ > ip2k-asm.c \ > ip2k-desc.c \ > ip2k-dis.c \ > @@ -947,7 +946,6 @@ distclean-compile: > @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h8300-dis.Plo@am__quote@ > @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hppa-dis.Plo@am__quote@ > @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386-dis.Plo@am__quote@ > -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386-opc.Plo@am__quote@ > @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ia64-dis.Plo@am__quote@ > @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ia64-opc.Plo@am__quote@ > @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ip2k-asm.Plo@am__quote@ > @@ -1539,7 +1537,7 @@ $(srcdir)/i386%tbl.h $(srcdir)/i386%init > > # While not really dependencies, specify i386-{init,tbl}.h here as well to > # make sure they are re-generated as necessary. > -i386-opc.lo: $(srcdir)/i386-tbl.h $(srcdir)/i386-init.h > +i386-dis.lo: $(srcdir)/i386-tbl.h $(srcdir)/i386-init.h > > ia64-gen$(EXEEXT_FOR_BUILD): ia64-gen.o $(BUILD_LIB_DEPS) > $(AM_V_CCLD)$(LINK_FOR_BUILD) ia64-gen.o $(BUILD_LIBS) > --- a/opcodes/i386-opc.c > +++ /dev/null > @@ -1,33 +0,0 @@ > -/* Intel 80386 opcode table > - Copyright (C) 2007-2022 Free Software Foundation, Inc. > - > - This file is part of the GNU opcodes library. > - > - This library is free software; you can redistribute it and/or modify > - it under the terms of the GNU General Public License as published by > - the Free Software Foundation; either version 3, or (at your option) > - any later version. > - > - It is distributed in the hope that it will be useful, but WITHOUT > - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY > - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public > - License for more details. > - > - You should have received a copy of the GNU General Public License > - along with this program; if not, write to the Free Software > - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, > - MA 02110-1301, USA. */ > - > -#include "sysdep.h" > -#include "libiberty.h" > -#include "i386-opc.h" > - > -/* To be indexed by segment register number. */ > -const unsigned char i386_seg_prefixes[] = { > - ES_PREFIX_OPCODE, > - CS_PREFIX_OPCODE, > - SS_PREFIX_OPCODE, > - DS_PREFIX_OPCODE, > - FS_PREFIX_OPCODE, > - GS_PREFIX_OPCODE > -}; > --- a/opcodes/i386-opc.h > +++ b/opcodes/i386-opc.h > @@ -1003,5 +1003,3 @@ typedef struct > #define Dw2Inval (-1) > } > reg_entry; > - > -extern const unsigned char i386_seg_prefixes[6]; > -- H.J.