| 1 |
From: Hilko Bengen <[email protected]> |
| 2 |
Date: Wed, 9 Dec 2020 14:10:03 +0100 |
| 3 |
Subject: Enforce order on wildcard operations for reproducible builds |
| 4 |
|
| 5 |
--- |
| 6 |
Makefile | 76 ++++++++++++++++++++++++++++++++-------------------------------- |
| 7 |
1 file changed, 38 insertions(+), 38 deletions(-) |
| 8 |
|
| 9 |
diff --git a/Makefile b/Makefile |
| 10 |
index f84d43c..71abdbf 100644 |
| 11 |
--- a/Makefile |
| 12 |
+++ b/Makefile |
| 13 |
@@ -117,85 +117,85 @@ LIBNAME = capstone |
| 14 |
|
| 15 |
|
| 16 |
DEP_ARM = |
| 17 |
|
| 18 |
+DEP_ARM += $(sort $(wildcard arch/ARM/ARM*.inc)) |
| 19 |
|
| 20 |
LIBOBJ_ARM = |
| 21 |
ifneq (,$(findstring arm,$(CAPSTONE_ARCHS))) |
| 22 |
CFLAGS += -DCAPSTONE_HAS_ARM |
| 23 |
|
| 24 |
+ LIBSRC_ARM += $(sort $(wildcard arch/ARM/ARM*.c)) |
| 25 |
LIBOBJ_ARM += $(LIBSRC_ARM:%.c=$(OBJDIR)/%.o) |
| 26 |
endif |
| 27 |
|
| 28 |
DEP_ARM64 = |
| 29 |
|
| 30 |
+DEP_ARM64 += $(sort $(wildcard arch/AArch64/AArch64*.inc)) |
| 31 |
|
| 32 |
LIBOBJ_ARM64 = |
| 33 |
ifneq (,$(findstring aarch64,$(CAPSTONE_ARCHS))) |
| 34 |
CFLAGS += -DCAPSTONE_HAS_ARM64 |
| 35 |
|
| 36 |
+ LIBSRC_ARM64 += $(sort $(wildcard arch/AArch64/AArch64*.c)) |
| 37 |
LIBOBJ_ARM64 += $(LIBSRC_ARM64:%.c=$(OBJDIR)/%.o) |
| 38 |
endif |
| 39 |
|
| 40 |
|
| 41 |
DEP_M68K = |
| 42 |
|
| 43 |
|
| 44 |
+DEP_M68K += $(sort $(wildcard arch/M68K/M68K*.inc)) |
| 45 |
+DEP_M68K += $(sort $(wildcard arch/M68K/M68K*.h)) |
| 46 |
|
| 47 |
LIBOBJ_M68K = |
| 48 |
ifneq (,$(findstring m68k,$(CAPSTONE_ARCHS))) |
| 49 |
CFLAGS += -DCAPSTONE_HAS_M68K |
| 50 |
|
| 51 |
+ LIBSRC_M68K += $(sort $(wildcard arch/M68K/M68K*.c)) |
| 52 |
LIBOBJ_M68K += $(LIBSRC_M68K:%.c=$(OBJDIR)/%.o) |
| 53 |
endif |
| 54 |
|
| 55 |
DEP_MIPS = |
| 56 |
|
| 57 |
+DEP_MIPS += $(sort $(wildcard arch/Mips/Mips*.inc)) |
| 58 |
|
| 59 |
LIBOBJ_MIPS = |
| 60 |
ifneq (,$(findstring mips,$(CAPSTONE_ARCHS))) |
| 61 |
CFLAGS += -DCAPSTONE_HAS_MIPS |
| 62 |
|
| 63 |
+ LIBSRC_MIPS += $(sort $(wildcard arch/Mips/Mips*.c)) |
| 64 |
LIBOBJ_MIPS += $(LIBSRC_MIPS:%.c=$(OBJDIR)/%.o) |
| 65 |
endif |
| 66 |
|
| 67 |
|
| 68 |
+DEP_SH = $(sort $(wildcard arch/SH/SH*.inc)) |
| 69 |
|
| 70 |
LIBOBJ_SH = |
| 71 |
ifneq (,$(findstring sh,$(CAPSTONE_ARCHS))) |
| 72 |
CFLAGS += -DCAPSTONE_HAS_SH |
| 73 |
|
| 74 |
+ LIBSRC_SH += $(sort $(wildcard arch/SH/SH*.c)) |
| 75 |
LIBOBJ_SH += $(LIBSRC_SH:%.c=$(OBJDIR)/%.o) |
| 76 |
endif |
| 77 |
|
| 78 |
DEP_PPC = |
| 79 |
|
| 80 |
+DEP_PPC += $(sort $(wildcard arch/PowerPC/PPC*.inc)) |
| 81 |
|
| 82 |
LIBOBJ_PPC = |
| 83 |
ifneq (,$(findstring powerpc,$(CAPSTONE_ARCHS))) |
| 84 |
CFLAGS += -DCAPSTONE_HAS_POWERPC |
| 85 |
|
| 86 |
+ LIBSRC_PPC += $(sort $(wildcard arch/PowerPC/PPC*.c)) |
| 87 |
LIBOBJ_PPC += $(LIBSRC_PPC:%.c=$(OBJDIR)/%.o) |
| 88 |
endif |
| 89 |
|
| 90 |
|
| 91 |
DEP_SPARC = |
| 92 |
|
| 93 |
+DEP_SPARC += $(sort $(wildcard arch/Sparc/Sparc*.inc)) |
| 94 |
|
| 95 |
LIBOBJ_SPARC = |
| 96 |
ifneq (,$(findstring sparc,$(CAPSTONE_ARCHS))) |
| 97 |
CFLAGS += -DCAPSTONE_HAS_SPARC |
| 98 |
|
| 99 |
+ LIBSRC_SPARC += $(sort $(wildcard arch/Sparc/Sparc*.c)) |
| 100 |
LIBOBJ_SPARC += $(LIBSRC_SPARC:%.c=$(OBJDIR)/%.o) |
| 101 |
endif |
| 102 |
|
| 103 |
|
| 104 |
DEP_SYSZ = |
| 105 |
|
| 106 |
+DEP_SYSZ += $(sort $(wildcard arch/SystemZ/SystemZ*.inc)) |
| 107 |
|
| 108 |
LIBOBJ_SYSZ = |
| 109 |
ifneq (,$(findstring systemz,$(CAPSTONE_ARCHS))) |
| 110 |
CFLAGS += -DCAPSTONE_HAS_SYSZ |
| 111 |
|
| 112 |
+ LIBSRC_SYSZ += $(sort $(wildcard arch/SystemZ/SystemZ*.c)) |
| 113 |
LIBOBJ_SYSZ += $(LIBSRC_SYSZ:%.c=$(OBJDIR)/%.o) |
| 114 |
endif |
| 115 |
|
| 116 |
@@ -209,7 +209,7 @@ endif |
| 117 |
|
| 118 |
|
| 119 |
DEP_X86 = |
| 120 |
|
| 121 |
+DEP_X86 += $(sort $(wildcard arch/X86/X86*.inc)) |
| 122 |
|
| 123 |
LIBOBJ_X86 = |
| 124 |
ifneq (,$(findstring x86,$(CAPSTONE_ARCHS))) |
| 125 |
@@ -230,97 +230,97 @@ endif |
| 126 |
|
| 127 |
|
| 128 |
DEP_XCORE = |
| 129 |
|
| 130 |
+DEP_XCORE += $(sort $(wildcard arch/XCore/XCore*.inc)) |
| 131 |
|
| 132 |
LIBOBJ_XCORE = |
| 133 |
ifneq (,$(findstring xcore,$(CAPSTONE_ARCHS))) |
| 134 |
CFLAGS += -DCAPSTONE_HAS_XCORE |
| 135 |
|
| 136 |
+ LIBSRC_XCORE += $(sort $(wildcard arch/XCore/XCore*.c)) |
| 137 |
LIBOBJ_XCORE += $(LIBSRC_XCORE:%.c=$(OBJDIR)/%.o) |
| 138 |
endif |
| 139 |
|
| 140 |
|
| 141 |
DEP_TMS320C64X = |
| 142 |
|
| 143 |
+DEP_TMS320C64X += $(sort $(wildcard arch/TMS320C64x/TMS320C64x*.inc)) |
| 144 |
|
| 145 |
LIBOBJ_TMS320C64X = |
| 146 |
ifneq (,$(findstring tms320c64x,$(CAPSTONE_ARCHS))) |
| 147 |
CFLAGS += -DCAPSTONE_HAS_TMS320C64X |
| 148 |
|
| 149 |
+ LIBSRC_TMS320C64X += $(sort $(wildcard arch/TMS320C64x/TMS320C64x*.c)) |
| 150 |
LIBOBJ_TMS320C64X += $(LIBSRC_TMS320C64X:%.c=$(OBJDIR)/%.o) |
| 151 |
endif |
| 152 |
|
| 153 |
DEP_M680X = |
| 154 |
|
| 155 |
|
| 156 |
+DEP_M680X += $(sort $(wildcard arch/M680X/*.inc)) |
| 157 |
+DEP_M680X += $(sort $(wildcard arch/M680X/M680X*.h)) |
| 158 |
|
| 159 |
LIBOBJ_M680X = |
| 160 |
ifneq (,$(findstring m680x,$(CAPSTONE_ARCHS))) |
| 161 |
CFLAGS += -DCAPSTONE_HAS_M680X |
| 162 |
|
| 163 |
+ LIBSRC_M680X += $(sort $(wildcard arch/M680X/*.c)) |
| 164 |
LIBOBJ_M680X += $(LIBSRC_M680X:%.c=$(OBJDIR)/%.o) |
| 165 |
endif |
| 166 |
|
| 167 |
|
| 168 |
DEP_EVM = |
| 169 |
|
| 170 |
+DEP_EVM += $(sort $(wildcard arch/EVM/EVM*.inc)) |
| 171 |
|
| 172 |
LIBOBJ_EVM = |
| 173 |
ifneq (,$(findstring evm,$(CAPSTONE_ARCHS))) |
| 174 |
CFLAGS += -DCAPSTONE_HAS_EVM |
| 175 |
|
| 176 |
+ LIBSRC_EVM += $(sort $(wildcard arch/EVM/EVM*.c)) |
| 177 |
LIBOBJ_EVM += $(LIBSRC_EVM:%.c=$(OBJDIR)/%.o) |
| 178 |
endif |
| 179 |
|
| 180 |
DEP_RISCV = |
| 181 |
|
| 182 |
+DEP_RISCV += $(sort $(wildcard arch/RISCV/RISCV*.inc)) |
| 183 |
|
| 184 |
LIBOBJ_RISCV = |
| 185 |
ifneq (,$(findstring riscv,$(CAPSTONE_ARCHS))) |
| 186 |
CFLAGS += -DCAPSTONE_HAS_RISCV |
| 187 |
|
| 188 |
+ LIBSRC_RISCV += $(sort $(wildcard arch/RISCV/RISCV*.c)) |
| 189 |
LIBOBJ_RISCV += $(LIBSRC_RISCV:%.c=$(OBJDIR)/%.o) |
| 190 |
endif |
| 191 |
|
| 192 |
DEP_WASM = |
| 193 |
|
| 194 |
+DEP_WASM += $(sort $(wildcard arch/WASM/WASM*.inc)) |
| 195 |
|
| 196 |
LIBOBJ_WASM = |
| 197 |
ifneq (,$(findstring wasm,$(CAPSTONE_ARCHS))) |
| 198 |
CFLAGS += -DCAPSTONE_HAS_WASM |
| 199 |
|
| 200 |
+ LIBSRC_WASM += $(sort $(wildcard arch/WASM/WASM*.c)) |
| 201 |
LIBOBJ_WASM += $(LIBSRC_WASM:%.c=$(OBJDIR)/%.o) |
| 202 |
endif |
| 203 |
|
| 204 |
|
| 205 |
DEP_MOS65XX = |
| 206 |
|
| 207 |
+DEP_MOS65XX += $(sort $(wildcard arch/MOS65XX/MOS65XX*.inc)) |
| 208 |
|
| 209 |
LIBOBJ_MOS65XX = |
| 210 |
ifneq (,$(findstring mos65xx,$(CAPSTONE_ARCHS))) |
| 211 |
CFLAGS += -DCAPSTONE_HAS_MOS65XX |
| 212 |
|
| 213 |
+ LIBSRC_MOS65XX += $(sort $(wildcard arch/MOS65XX/MOS65XX*.c)) |
| 214 |
LIBOBJ_MOS65XX += $(LIBSRC_MOS65XX:%.c=$(OBJDIR)/%.o) |
| 215 |
endif |
| 216 |
|
| 217 |
|
| 218 |
DEP_BPF = |
| 219 |
|
| 220 |
+DEP_BPF += $(sort $(wildcard arch/BPF/BPF*.inc)) |
| 221 |
|
| 222 |
LIBOBJ_BPF = |
| 223 |
ifneq (,$(findstring bpf,$(CAPSTONE_ARCHS))) |
| 224 |
CFLAGS += -DCAPSTONE_HAS_BPF |
| 225 |
|
| 226 |
+ LIBSRC_BPF += $(sort $(wildcard arch/BPF/BPF*.c)) |
| 227 |
LIBOBJ_BPF += $(LIBSRC_BPF:%.c=$(OBJDIR)/%.o) |
| 228 |
endif |
| 229 |
|
| 230 |
DEP_TRICORE = |
| 231 |
|
| 232 |
+DEP_TRICORE +=$(sort $(wildcard arch/TriCore/TriCore*.inc)) |
| 233 |
|
| 234 |
LIBOBJ_TRICORE = |
| 235 |
ifneq (,$(findstring tricore,$(CAPSTONE_ARCHS))) |
| 236 |
CFLAGS += -DCAPSTONE_HAS_TRICORE |
| 237 |
|
| 238 |
+ LIBSRC_TRICORE += $(sort $(wildcard arch/TriCore/TriCore*.c)) |
| 239 |
LIBOBJ_TRICORE += $(LIBSRC_TRICORE:%.c=$(OBJDIR)/%.o) |
| 240 |
endif |
| 241 |
|
| 242 |
@@ -578,7 +578,7 @@ fuzztest: |
| 243 |
./suite/fuzz/fuzz_disasm $(FUZZ_INPUTS) |
| 244 |
|
| 245 |
fuzzallcorp: |
| 246 |
|
| 247 |
+ifneq ($(sort $(wildcard suite/fuzz/corpus-libFuzzer-capstone_fuzz_disasmnext-latest)),) |
| 248 |
./suite/fuzz/fuzz_bindisasm suite/fuzz/corpus-libFuzzer-capstone_fuzz_disasmnext-latest/ > fuzz_bindisasm.log || (tail -1 fuzz_bindisasm.log; false) |
| 249 |
else |
| 250 |
@echo "Skipping tests on whole corpus" |