Don't compile some opcodes files when bfd is 32-bit only
authorAlan Modra <amodra@gmail.com>
Fri, 12 Nov 2021 08:25:45 +0000 (18:55 +1030)
committerAlan Modra <amodra@gmail.com>
Fri, 12 Nov 2021 08:32:12 +0000 (19:02 +1030)
* Makefile.am (TARGET_LIBOPCODES_CFILES): Split into..
(TARGET64_LIBOPCODES_CFILES): ..this and..
(TARGET32_LIBOPCODES_CFILES): ..this.
(ALL_MACHINES): Likewise split to
(ALL64_MACHINES, ALL32_MACHINES): ..this.
* disassemble.c: Define some ARCH_* when ARCH_all only if BFD64.
* configure.ac (BFD_MACHINES): Defined depending on BFD_ARCH_SIZE.
* Makefile.in: Regenerate.
* configure: Regenerate.

opcodes/Makefile.am
opcodes/Makefile.in
opcodes/configure
opcodes/configure.ac
opcodes/disassemble.c

index e07e360d842790a075a50aaa895ec045abf90772..ab7072c0249189ed5482d89f64b6751f234d5826 100644 (file)
@@ -88,7 +88,7 @@ HFILES = \
 
 # C source files that correspond to .o's ending up in libopcodes
 # for all machines.
-TARGET_LIBOPCODES_CFILES = \
+TARGET64_LIBOPCODES_CFILES = \
        aarch64-asm.c \
        aarch64-asm-2.c \
        aarch64-dis.c \
@@ -97,6 +97,27 @@ TARGET_LIBOPCODES_CFILES = \
        aarch64-opc-2.c \
        alpha-dis.c \
        alpha-opc.c \
+       bpf-asm.c \
+       bpf-desc.c \
+       bpf-dis.c \
+       bpf-ibld.c \
+       bpf-opc.c \
+       ia64-dis.c \
+       ia64-opc.c \
+       loongarch-opc.c \
+       loongarch-dis.c \
+       loongarch-coder.c \
+       mips-dis.c \
+       mips-opc.c \
+       mips16-opc.c \
+       micromips-opc.c \
+       mmix-dis.c \
+       mmix-opc.c \
+       nfp-dis.c \
+       riscv-dis.c \
+       riscv-opc.c
+
+TARGET32_LIBOPCODES_CFILES = \
        arc-dis.c \
        arc-ext.c \
        arc-opc.c \
@@ -120,11 +141,6 @@ TARGET_LIBOPCODES_CFILES = \
        d30v-dis.c \
        d30v-opc.c \
        dlx-dis.c \
-       bpf-asm.c \
-       bpf-desc.c \
-       bpf-dis.c \
-       bpf-ibld.c \
-       bpf-opc.c \
        epiphany-asm.c \
        epiphany-desc.c \
        epiphany-dis.c \
@@ -146,8 +162,6 @@ TARGET_LIBOPCODES_CFILES = \
        hppa-dis.c \
        i386-dis.c \
        i386-opc.c \
-       ia64-dis.c \
-       ia64-opc.c \
        ip2k-asm.c \
        ip2k-desc.c \
        ip2k-dis.c \
@@ -164,9 +178,6 @@ TARGET_LIBOPCODES_CFILES = \
        lm32-ibld.c \
        lm32-opc.c \
        lm32-opinst.c \
-       loongarch-opc.c \
-       loongarch-dis.c \
-       loongarch-coder.c \
        m10200-dis.c \
        m10200-opc.c \
        m10300-dis.c \
@@ -196,12 +207,6 @@ TARGET_LIBOPCODES_CFILES = \
        mep-opc.c \
        metag-dis.c \
        microblaze-dis.c \
-       micromips-opc.c \
-       mips-dis.c \
-       mips-opc.c \
-       mips16-opc.c \
-       mmix-dis.c \
-       mmix-opc.c \
        moxie-dis.c \
        moxie-opc.c \
        msp430-decode.c \
@@ -213,7 +218,6 @@ TARGET_LIBOPCODES_CFILES = \
        mt-opc.c \
        nds32-asm.c \
        nds32-dis.c \
-       nfp-dis.c \
        nios2-dis.c \
        nios2-opc.c \
        ns32k-dis.c \
@@ -230,8 +234,6 @@ TARGET_LIBOPCODES_CFILES = \
        ppc-opc.c \
        pru-dis.c \
        pru-opc.c \
-       riscv-dis.c \
-       riscv-opc.c \
        rl78-decode.c \
        rl78-dis.c \
        rx-decode.c \
@@ -278,7 +280,8 @@ TARGET_LIBOPCODES_CFILES = \
 
 # C source files that correspond to .o's ending up in libopcodes.
 LIBOPCODES_CFILES = \
-       $(TARGET_LIBOPCODES_CFILES) \
+       $(TARGET32_LIBOPCODES_CFILES) \
+       $(TARGET64_LIBOPCODES_CFILES) \
        dis-buf.c \
        dis-init.c \
        disassemble.c
@@ -299,7 +302,8 @@ CFILES = \
        s390-mkopc.c \
        z8kgen.c
 
-ALL_MACHINES = $(TARGET_LIBOPCODES_CFILES:.c=.lo)
+ALL32_MACHINES = $(TARGET32_LIBOPCODES_CFILES:.c=.lo)
+ALL64_MACHINES = $(TARGET64_LIBOPCODES_CFILES:.c=.lo)
 
 OFILES = @BFD_MACHINES@
 
index 942737106abf96814bd2f0cb9d013dcec57d05cf..59ed0d2c81fd01b3402d1822cd83dadd7f08b49a 100644 (file)
@@ -479,7 +479,7 @@ HFILES = \
 
 # C source files that correspond to .o's ending up in libopcodes
 # for all machines.
-TARGET_LIBOPCODES_CFILES = \
+TARGET64_LIBOPCODES_CFILES = \
        aarch64-asm.c \
        aarch64-asm-2.c \
        aarch64-dis.c \
@@ -488,6 +488,27 @@ TARGET_LIBOPCODES_CFILES = \
        aarch64-opc-2.c \
        alpha-dis.c \
        alpha-opc.c \
+       bpf-asm.c \
+       bpf-desc.c \
+       bpf-dis.c \
+       bpf-ibld.c \
+       bpf-opc.c \
+       ia64-dis.c \
+       ia64-opc.c \
+       loongarch-opc.c \
+       loongarch-dis.c \
+       loongarch-coder.c \
+       mips-dis.c \
+       mips-opc.c \
+       mips16-opc.c \
+       micromips-opc.c \
+       mmix-dis.c \
+       mmix-opc.c \
+       nfp-dis.c \
+       riscv-dis.c \
+       riscv-opc.c
+
+TARGET32_LIBOPCODES_CFILES = \
        arc-dis.c \
        arc-ext.c \
        arc-opc.c \
@@ -511,11 +532,6 @@ TARGET_LIBOPCODES_CFILES = \
        d30v-dis.c \
        d30v-opc.c \
        dlx-dis.c \
-       bpf-asm.c \
-       bpf-desc.c \
-       bpf-dis.c \
-       bpf-ibld.c \
-       bpf-opc.c \
        epiphany-asm.c \
        epiphany-desc.c \
        epiphany-dis.c \
@@ -537,8 +553,6 @@ TARGET_LIBOPCODES_CFILES = \
        hppa-dis.c \
        i386-dis.c \
        i386-opc.c \
-       ia64-dis.c \
-       ia64-opc.c \
        ip2k-asm.c \
        ip2k-desc.c \
        ip2k-dis.c \
@@ -555,9 +569,6 @@ TARGET_LIBOPCODES_CFILES = \
        lm32-ibld.c \
        lm32-opc.c \
        lm32-opinst.c \
-       loongarch-opc.c \
-       loongarch-dis.c \
-       loongarch-coder.c \
        m10200-dis.c \
        m10200-opc.c \
        m10300-dis.c \
@@ -587,12 +598,6 @@ TARGET_LIBOPCODES_CFILES = \
        mep-opc.c \
        metag-dis.c \
        microblaze-dis.c \
-       micromips-opc.c \
-       mips-dis.c \
-       mips-opc.c \
-       mips16-opc.c \
-       mmix-dis.c \
-       mmix-opc.c \
        moxie-dis.c \
        moxie-opc.c \
        msp430-decode.c \
@@ -604,7 +609,6 @@ TARGET_LIBOPCODES_CFILES = \
        mt-opc.c \
        nds32-asm.c \
        nds32-dis.c \
-       nfp-dis.c \
        nios2-dis.c \
        nios2-opc.c \
        ns32k-dis.c \
@@ -621,8 +625,6 @@ TARGET_LIBOPCODES_CFILES = \
        ppc-opc.c \
        pru-dis.c \
        pru-opc.c \
-       riscv-dis.c \
-       riscv-opc.c \
        rl78-decode.c \
        rl78-dis.c \
        rx-decode.c \
@@ -670,7 +672,8 @@ TARGET_LIBOPCODES_CFILES = \
 
 # C source files that correspond to .o's ending up in libopcodes.
 LIBOPCODES_CFILES = \
-       $(TARGET_LIBOPCODES_CFILES) \
+       $(TARGET32_LIBOPCODES_CFILES) \
+       $(TARGET64_LIBOPCODES_CFILES) \
        dis-buf.c \
        dis-init.c \
        disassemble.c
@@ -692,7 +695,8 @@ CFILES = \
        s390-mkopc.c \
        z8kgen.c
 
-ALL_MACHINES = $(TARGET_LIBOPCODES_CFILES:.c=.lo)
+ALL32_MACHINES = $(TARGET32_LIBOPCODES_CFILES:.c=.lo)
+ALL64_MACHINES = $(TARGET64_LIBOPCODES_CFILES:.c=.lo)
 OFILES = @BFD_MACHINES@
 
 # development.sh is used to determine -Werror default.
index acfbdd6ec6fd79441f2994061be2e05080015779..6672c368082828818a719385f6436422999f60b4 100755 (executable)
@@ -12319,7 +12319,11 @@ if test x${all_targets} = xfalse ; then
 
 else   # all_targets is true
     archdefs=-DARCH_all
-    BFD_MACHINES='$(ALL_MACHINES)'
+    if grep '#define BFD_ARCH_SIZE 64' ../bfd/bfd-in3.h > /dev/null; then
+       BFD_MACHINES='$(ALL32_MACHINES) $(ALL64_MACHINES)'
+    else
+       BFD_MACHINES='$(ALL32_MACHINES)'
+    fi
 fi
 
 
index 757ce10fbe24c63bcfa87a33a813910e3439f3e5..03433157c081da85b17bd213bc89f9f4c71115c8 100644 (file)
@@ -379,7 +379,11 @@ if test x${all_targets} = xfalse ; then
 
 else   # all_targets is true
     archdefs=-DARCH_all
-    BFD_MACHINES='$(ALL_MACHINES)'
+    if grep '#define BFD_ARCH_SIZE 64' ../bfd/bfd-in3.h > /dev/null; then
+       BFD_MACHINES='$(ALL32_MACHINES) $(ALL64_MACHINES)'
+    else
+       BFD_MACHINES='$(ALL32_MACHINES)'
+    fi
 fi
 
 AC_SUBST(archdefs)
index 61e666c182234d7ea41329f83a5ebfd4a4849432..21d894f57d422204ff03040eb3dfdbdb89692700 100644 (file)
 #include "opintl.h"
 
 #ifdef ARCH_all
+#ifdef BFD64
 #define ARCH_aarch64
 #define ARCH_alpha
+#define ARCH_bpf
+#define ARCH_cris
+#define ARCH_ia64
+#define ARCH_loongarch
+#define ARCH_mips
+#define ARCH_mmix
+#define ARCH_nfp
+#define ARCH_riscv
+#define ARCH_score
+#define ARCH_tilegx
+#endif
 #define ARCH_arc
 #define ARCH_arm
 #define ARCH_avr
 #define ARCH_bfin
 #define ARCH_cr16
-#define ARCH_cris
 #define ARCH_crx
 #define ARCH_csky
 #define ARCH_d10v
 #define ARCH_d30v
 #define ARCH_dlx
-#define ARCH_bpf
 #define ARCH_epiphany
 #define ARCH_fr30
 #define ARCH_frv
 #define ARCH_h8300
 #define ARCH_hppa
 #define ARCH_i386
-#define ARCH_ia64
 #define ARCH_ip2k
 #define ARCH_iq2000
 #define ARCH_lm32
-#define ARCH_loongarch
 #define ARCH_m32c
 #define ARCH_m32r
 #define ARCH_m68hc11
 #define ARCH_mep
 #define ARCH_metag
 #define ARCH_microblaze
-#define ARCH_mips
-#define ARCH_mmix
 #define ARCH_mn10200
 #define ARCH_mn10300
 #define ARCH_moxie
 #define ARCH_mt
 #define ARCH_msp430
 #define ARCH_nds32
-#define ARCH_nfp
 #define ARCH_nios2
 #define ARCH_ns32k
 #define ARCH_or1k
 #define ARCH_pj
 #define ARCH_powerpc
 #define ARCH_pru
-#define ARCH_riscv
 #define ARCH_rs6000
 #define ARCH_rl78
 #define ARCH_rx
 #define ARCH_s12z
 #define ARCH_s390
-#define ARCH_score
 #define ARCH_sh
 #define ARCH_sparc
 #define ARCH_spu
@@ -89,7 +92,6 @@
 #define ARCH_tic4x
 #define ARCH_tic54x
 #define ARCH_tic6x
-#define ARCH_tilegx
 #define ARCH_tilepro
 #define ARCH_v850
 #define ARCH_vax