Skip to content

Commit baf8e69

Browse files
authored
Initial work towards building for UEFI ##build
1 parent 44744db commit baf8e69

37 files changed

+995
-250
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ else
1414
BUILDSEC=$(shell date "+__%H:%M:%S")
1515
endif
1616
DATADIRS=libr/cons/d libr/flag/d libr/bin/d libr/asm/d libr/syscall/d libr/magic/d libr/anal/d libr/util/d libr/arch/d
17-
USE_ZIP=YES
17+
ZIPWINDIST=YES
1818
ZIP=zip
1919

2020
R2VC=$(shell git rev-list --all --count 2>/dev/null)
@@ -179,7 +179,7 @@ windist:
179179
@cp -f doc/hud "${WINDIST}/share/radare2/${VERSION}/hud/main"
180180
@mv "${WINDIST}" "radare2-${WINBITS}-${VERSION}"
181181
@rm -f "radare2-${WINBITS}-${VERSION}.zip"
182-
ifneq ($(USE_ZIP),NO)
182+
ifneq ($(ZIPWINDIST),NO)
183183
$(ZIP) -r "${ZIPNAME}" "radare2-${WINBITS}-${VERSION}"
184184
endif
185185

configure

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ WITH_CAPSTONE=0
3939
WITHOUT_SYSCAPSTONE=1
4040
WITH_SQSH=1
4141
WITH_SYSLZ4=0
42+
WANT_ZIP=1
4243
USE_ZIP=0
4344
USE_XXHASH=0
4445
WITH_GPL=1
@@ -232,6 +233,7 @@ Optional Features:
232233
--without-syscapstone avoid the system-wide capstone
233234
--without-sqsh ensure squashfs support is not included, even if library is found
234235
--with-syslz4 force to use system's liblz4
236+
--without-zip build without the ZIP/ZLIB support
235237
--with-syszip force to use system's libzip and zlib
236238
--with-sysxxhash force to use system's xxhash
237239
--without-gpl do not build GPL code (grub, cxx, ... )
@@ -323,7 +325,7 @@ echo "LANGS: c"
323325
echo "REQUIRED: libdl"
324326
echo "OPTIONAL: libatomic libmagic libz libzip libxxhash libssl liblibuv>=1.0.0"
325327
echo "PKGCONFIG: capstone libsqsh liblz4 openssl libuv"
326-
echo "FLAGS: --disable-debugger --with-libatomic --with-sysmagic --disable-threads --disable-loadlibs --enable-threadsafety --without-qjs --without-dylink --without-fork --without-ptrace-wrap --without-gperf --without-capstone --with-libr --with-static-themes --with-capstone-next --with-capstone5 --with-capstone4 --with-syscapstone --without-syscapstone --without-sqsh --with-syslz4 --with-syszip --with-sysxxhash --without-gpl --with-ssl --with-ssl-crypto --with-libuv --with-v35 --with-new-abi --with-rpath --with-compiler=gcc --with-ostype=auto --with-libversion=xxx --without-jemalloc --with-checks-level=2 --disable-debug-stuff"
328+
echo "FLAGS: --disable-debugger --with-libatomic --with-sysmagic --disable-threads --disable-loadlibs --enable-threadsafety --without-qjs --without-dylink --without-fork --without-ptrace-wrap --without-gperf --without-capstone --with-libr --with-static-themes --with-capstone-next --with-capstone5 --with-capstone4 --with-syscapstone --without-syscapstone --without-sqsh --with-syslz4 --without-zip --with-syszip --with-sysxxhash --without-gpl --with-ssl --with-ssl-crypto --with-libuv --with-v35 --with-new-abi --with-rpath --with-compiler=gcc --with-ostype=auto --with-libversion=xxx --without-jemalloc --with-checks-level=2 --disable-debug-stuff"
327329
exit 0
328330
;;
329331
--cache-file)
@@ -396,6 +398,7 @@ echo "FLAGS: --disable-debugger --with-libatomic --with-sysmagic --disable
396398
"--without-syscapstone") WITHOUT_SYSCAPSTONE="0"; ;;
397399
"--without-sqsh") WITH_SQSH="0"; ;;
398400
"--with-syslz4") WITH_SYSLZ4="1"; ;;
401+
"--without-zip") WANT_ZIP="0"; ;;
399402
"--with-syszip") USE_ZIP="1"; ;;
400403
"--with-sysxxhash") USE_XXHASH="1"; ;;
401404
"--without-gpl") WITH_GPL="0"; ;;
@@ -428,7 +431,7 @@ parse_options "$1"
428431
shift
429432
done
430433

431-
ENVWORDS="MANDIR DESCRIPTION INFODIR LIBDIR INCLUDEDIR LOCALSTATEDIR ETCDIR SYSCONFDIR DATADIR DOCDIR LIBEXECDIR SBINDIR BINDIR EPREFIX PREFIX SPREFIX TARGET HOST BUILD INSTALL INSTALL_LIB INSTALL_MAN INSTALL_PROGRAM INSTALL_PROGRAM_STRIP INSTALL_DIR INSTALL_SCRIPT INSTALL_DATA HOST_OS HOST_CPU BUILD_OS BUILD_CPU TARGET_OS TARGET_CPU VERSION VERSION_MAJOR VERSION_MINOR VERSION_PATCH VERSION_NUMBER PKGCFG_LIBDIR PKGCFG_INCDIR PKGNAME VPATH CONTACT CONTACT_NAME CONTACT_MAIL CC CFLAGS CPPFLAGS LDFLAGS HAVE_LANG_C DEBUGGER HAVE_LIB_DL DL_LIBS PKGCONFIG R2_BUILDSYSTEM HAVE_PATCH PATCH HAVE_AR AR HAVE_GIT GIT HAVE_GPERF GPERF HAVE_LIB_ATOMIC HAVE_LIB_MAGIC HAVE_LINUX_CAN_H USE_LIB_ATOMIC LIBATOMIC USE_MAGIC USE_LIB_MAGIC LIBMAGIC WANT_THREADS LOADLIBS R_CRITICAL_ENABLED WANT_QJS WANT_DYLINK HAVE_FORK WANT_PTRACE_WRAP WANT_GPERF WANT_CAPSTONE WITH_LIBR WITH_STATIC_THEMES USE_CSNEXT USE_CS5 USE_CS4 WITH_CAPSTONE WITHOUT_SYSCAPSTONE CAPSTONE_CFLAGS CAPSTONE_LDFLAGS HAVE_PKGCFG_CAPSTONE USE_CAPSTONE SQSH_CFLAGS SQSH_LDFLAGS HAVE_PKGCFG_LIBSQSH WITH_SQSH USE_SQSH LZ4_CFLAGS LZ4_LDFLAGS HAVE_PKGCFG_LIBLZ4 WITH_SYSLZ4 USE_SYSLZ4 HAVE_LIB_Z HAVE_LIB_ZIP USE_ZIP USE_LIB_ZIP LIBZIP HAVE_LIB_XXHASH USE_XXHASH USE_LIB_XXHASH LIBXXHASH WITH_GPL HAVE_DECL_ADDR_NO_RANDOMIZE HAVE_DECL___GLIBC__ HAVE_ARC4RANDOM_UNIFORM HAVE_EXPLICIT_BZERO HAVE_EXPLICIT_MEMSET HAVE_CLOCK_NANOSLEEP HAVE___ATOMIC_FETCH_ADD_8 HAVE_SIGACTION HAVE_CLOCK_GETTIME FORCE_LIB_ATOMIC CLOCK_LDFLAGS SUPPORT_GNU99 HAVE_LIB_GMP WANT_SSL WANT_SSL_CRYPTO HAVE_OPENSSL SSL_CFLAGS SSL_LDFLAGS HAVE_LIB_SSL HAVE_PKGCFG_OPENSSL WANT_LIBUV HAVE_LIBUV_VERSION_1_0_0 LIBUV_CFLAGS LIBUV_LDFLAGS HAVE_PKGCFG_LIBUV HAVE_LIBUV WANT_V35 USE_NEW_ABI USE_RPATH USERCC USEROSTYPE LIBVERSION HAVE_JEMALLOC HAVE_PTRACE USE_PTRACE_WRAP R_CHECKS_LEVEL WANT_DEBUGSTUFF"
434+
ENVWORDS="MANDIR DESCRIPTION INFODIR LIBDIR INCLUDEDIR LOCALSTATEDIR ETCDIR SYSCONFDIR DATADIR DOCDIR LIBEXECDIR SBINDIR BINDIR EPREFIX PREFIX SPREFIX TARGET HOST BUILD INSTALL INSTALL_LIB INSTALL_MAN INSTALL_PROGRAM INSTALL_PROGRAM_STRIP INSTALL_DIR INSTALL_SCRIPT INSTALL_DATA HOST_OS HOST_CPU BUILD_OS BUILD_CPU TARGET_OS TARGET_CPU VERSION VERSION_MAJOR VERSION_MINOR VERSION_PATCH VERSION_NUMBER PKGCFG_LIBDIR PKGCFG_INCDIR PKGNAME VPATH CONTACT CONTACT_NAME CONTACT_MAIL CC CFLAGS CPPFLAGS LDFLAGS HAVE_LANG_C DEBUGGER HAVE_LIB_DL DL_LIBS PKGCONFIG R2_BUILDSYSTEM HAVE_PATCH PATCH HAVE_AR AR HAVE_GIT GIT HAVE_GPERF GPERF HAVE_LIB_ATOMIC HAVE_LIB_MAGIC HAVE_LINUX_CAN_H USE_LIB_ATOMIC LIBATOMIC USE_MAGIC USE_LIB_MAGIC LIBMAGIC WANT_THREADS LOADLIBS R_CRITICAL_ENABLED WANT_QJS WANT_DYLINK HAVE_FORK WANT_PTRACE_WRAP WANT_GPERF WANT_CAPSTONE WITH_LIBR WITH_STATIC_THEMES USE_CSNEXT USE_CS5 USE_CS4 WITH_CAPSTONE WITHOUT_SYSCAPSTONE CAPSTONE_CFLAGS CAPSTONE_LDFLAGS HAVE_PKGCFG_CAPSTONE USE_CAPSTONE SQSH_CFLAGS SQSH_LDFLAGS HAVE_PKGCFG_LIBSQSH WITH_SQSH USE_SQSH LZ4_CFLAGS LZ4_LDFLAGS HAVE_PKGCFG_LIBLZ4 WITH_SYSLZ4 USE_SYSLZ4 WANT_ZIP HAVE_LIB_Z HAVE_LIB_ZIP USE_ZIP USE_LIB_ZIP LIBZIP HAVE_LIB_XXHASH USE_XXHASH USE_LIB_XXHASH LIBXXHASH WITH_GPL HAVE_DECL_ADDR_NO_RANDOMIZE HAVE_DECL___GLIBC__ HAVE_ARC4RANDOM_UNIFORM HAVE_EXPLICIT_BZERO HAVE_EXPLICIT_MEMSET HAVE_CLOCK_NANOSLEEP HAVE___ATOMIC_FETCH_ADD_8 HAVE_SIGACTION HAVE_CLOCK_GETTIME FORCE_LIB_ATOMIC CLOCK_LDFLAGS SUPPORT_GNU99 HAVE_LIB_GMP WANT_SSL WANT_SSL_CRYPTO HAVE_OPENSSL SSL_CFLAGS SSL_LDFLAGS HAVE_LIB_SSL HAVE_PKGCFG_OPENSSL WANT_LIBUV HAVE_LIBUV_VERSION_1_0_0 LIBUV_CFLAGS LIBUV_LDFLAGS HAVE_PKGCFG_LIBUV HAVE_LIBUV WANT_V35 USE_NEW_ABI USE_RPATH USERCC USEROSTYPE LIBVERSION HAVE_JEMALLOC HAVE_PTRACE USE_PTRACE_WRAP R_CHECKS_LEVEL WANT_DEBUGSTUFF"
432435

433436
create_environ
434437

@@ -735,6 +738,8 @@ else
735738
USE_SYSLZ4="0"; fi
736739
check_library HAVE_LIB_Z z 0
737740
check_library HAVE_LIB_ZIP zip 0
741+
if [ "$WANTZIP" = "0" ]; then
742+
USE_ZIP="0"; fi
738743
if [ 11 = "$HAVE_LIB_Z$USE_ZIP" ]; then
739744

740745
if [ "$HAVE_LIB_ZIP" = "1" ]; then
@@ -1025,7 +1030,14 @@ for A in ${ENVWORDS} ; do
10251030
[ "${A}" = VPATH ] && continue
10261031
[ "${A}" = srcdir ] && continue
10271032
eval "VAR=\$${A}"
1028-
VAR="`echo ${VAR} | sed -e 's/\,/\\\,/g'`"
1033+
case "" in
1034+
mingw*|cygwin*|msys*)
1035+
VAR="`echo ${VAR} | sed -e 's/\\/\\\\/g' -e 's/\,/\\\,/g'`"
1036+
;;
1037+
*)
1038+
VAR="`echo ${VAR} | sed -e 's/\,/\\\,/g'`"
1039+
;;
1040+
esac
10291041
[ $COUNT = 10 ] && COUNT=0 && SEDFLAGS="${SEDFLAGS}' -e '"
10301042
COUNT=$(($COUNT+1))
10311043
SEDFLAGS="${SEDFLAGS}s,@${A}@,${VAR},g;"

configure.acr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,13 @@ IFAND WITH_SYSLZ4 HAVE_PKGCFG_LIBLZ4 {
105105
}
106106

107107
(( ZIP ))
108+
ARG_WITHOUT WANT_ZIP zip build without the ZIP/ZLIB support ;
108109
CHKLIB z
109110
CHKLIB zip
110111
ARG_WITH USE_ZIP syszip force to use system's libzip and zlib ;
112+
IFNOT WANTZIP {
113+
USE_ZIP = 0 ;
114+
}
111115
IFAND HAVE_LIB_Z USE_ZIP {
112116
IF HAVE_LIB_ZIP {
113117
USE_LIB_ZIP = 1 ;

dist/plugins-cfg/plugins.uefi.cfg

Lines changed: 271 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,271 @@
1+
STATIC="
2+
anal.null
3+
anal.a2f
4+
arch.any_as
5+
arch.any_vasm
6+
arch.arc
7+
arch.arm
8+
arch.arm_cs
9+
arch.arm_gnu
10+
arch.nds32
11+
arch.arm_v35
12+
arch.avr
13+
arch.bf
14+
arch.bpf
15+
arch.bpf_cs
16+
arch.sbpf_cs
17+
arch.chip8
18+
arch.cr16
19+
arch.cris
20+
arch.dalvik
21+
arch.dis
22+
arch.ebc
23+
arch.evm
24+
arch.fslsp
25+
arch.gb
26+
arch.stm8
27+
arch.i4004
28+
arch.i8080
29+
arch.null
30+
arch.or1k
31+
arch.pickle
32+
arch.pyc
33+
arch.wasm
34+
arch.x86_cs
35+
arch.x86_nasm
36+
arch.x86_nz
37+
bin.any
38+
bin.uf2
39+
bin.art
40+
bin.avr
41+
bin.bf
42+
bin.bflt
43+
bin.bios
44+
bin.bootimg
45+
bin.cgc
46+
bin.coff
47+
bin.dex
48+
bin.dis
49+
bin.dmp64
50+
bin.dol
51+
bin.dyldcache
52+
bin.io
53+
bin.elf
54+
bin.elf64
55+
bin.fs
56+
bin.hunk
57+
bin.java
58+
bin.le
59+
bin.lua
60+
bin.mach0
61+
bin.mach064
62+
bin.mbn
63+
bin.mdmp
64+
bin.mclf
65+
bin.menuet
66+
bin.pdp11
67+
bin.msx
68+
bin.mz
69+
bin.ne
70+
bin.nes
71+
bin.nin3ds
72+
bin.ninds
73+
bin.ningb
74+
bin.ningba
75+
bin.nro
76+
bin.nso
77+
bin.off
78+
bin.omf
79+
bin.p9
80+
bin.pe
81+
bin.pe64
82+
bin.pebble
83+
bin.pef
84+
bin.pcap
85+
bin.prg
86+
bin.psxexe
87+
bin.pyc
88+
bin.qnx
89+
bin.rel
90+
bin.s390
91+
bin.sfc
92+
bin.smd
93+
bin.sms
94+
bin.symbols
95+
bin.te
96+
bin.tic
97+
bin.vsf
98+
bin.wad
99+
bin.wasm
100+
bin.xbe
101+
bin.xcoff64
102+
bin.xnu_kernelcache
103+
bin.xtac
104+
bin.z64
105+
bin.zimg
106+
bin_ldr.ldr_linux
107+
bin_xtr.xtr_dyldcache
108+
bin_xtr.xtr_fatmach0
109+
bin_xtr.xtr_pemixed
110+
bin_xtr.xtr_sep64
111+
bin_xtr.xtr_xalz
112+
bp.null
113+
bp.arm
114+
bp.bf
115+
bp.mips
116+
bp.s390x
117+
bp.ppc
118+
bp.riscv
119+
bp.x86
120+
core.agD
121+
core.a2f
122+
core.writedwarf
123+
core.prj
124+
core.java
125+
core.sixref
126+
muta.null
127+
muta.add
128+
muta.aes
129+
muta.aes_cbc
130+
muta.aes_wrap
131+
muta.base64
132+
muta.base91
133+
muta.bech32
134+
muta.blowfish
135+
muta.cps2
136+
muta.des
137+
muta.ed25519
138+
muta.entropy
139+
muta.punycode
140+
muta.rc2
141+
muta.rc4
142+
muta.rc6
143+
muta.rol
144+
muta.ror
145+
muta.rot
146+
muta.serpent
147+
muta.sm4
148+
muta.xor
149+
muta.strhash
150+
muta.sip
151+
muta.charset_pokemon
152+
debug.bf
153+
debug.evm
154+
debug.rv32ima
155+
debug.bochs
156+
debug.esil
157+
debug.gdb
158+
debug.io
159+
debug.native
160+
debug.null
161+
debug.qnx
162+
debug.rap
163+
debug.winkd
164+
egg.bind
165+
egg.reverse
166+
egg.exec
167+
egg.nullby
168+
egg.xor
169+
esil.null
170+
esil.dummy
171+
esil.forth
172+
fs.ext2
173+
fs.squashfs
174+
fs.fat
175+
fs.fb
176+
fs.hfs
177+
fs.hfsplus
178+
fs.io
179+
fs.iso9660
180+
fs.jfs
181+
fs.minix
182+
fs.ntfs
183+
fs.posix
184+
fs.r2
185+
fs.reiserfs
186+
fs.sfs
187+
fs.tar
188+
fs.udf
189+
fs.ufs
190+
fs.xfs
191+
fs.zip
192+
io.ar
193+
io.cyclic
194+
io.bfdbg
195+
io.bochs
196+
io.debug
197+
io.default
198+
io.dsc
199+
io.fd
200+
io.gdb
201+
io.gzip
202+
io.http
203+
io.ihex
204+
io.isotp
205+
io.pvm
206+
io.mach
207+
io.malloc
208+
io.mmap
209+
io.null
210+
io.procpid
211+
io.ptrace
212+
io.qnx
213+
io.r2k
214+
io.r2pipe
215+
io.r2web
216+
io.rap
217+
io.rbuf
218+
io.reg
219+
io.self
220+
io.serial
221+
io.socket
222+
io.sparse
223+
io.tcpslurp
224+
io.treebuf
225+
io.w32
226+
io.w32dbg
227+
io.winedbg
228+
io.sysgdb
229+
io.uf2
230+
io.winkd
231+
io.xalz
232+
io.xattr
233+
io.zip
234+
lang.c
235+
lang.cpipe
236+
lang.pipe
237+
lang.rust
238+
lang.spp
239+
lang.v
240+
lang.vala
241+
lang.zig
242+
asm.6502
243+
asm.msp430
244+
asm.arm
245+
asm.8051
246+
asm.att2intel
247+
asm.avr
248+
asm.bpf
249+
asm.chip8
250+
asm.cosmac
251+
asm.dalvik
252+
asm.evm
253+
asm.gb
254+
asm.java
255+
asm.m68k
256+
asm.mips
257+
asm.sparc
258+
asm.null
259+
asm.pickle
260+
asm.ppc
261+
asm.riscv
262+
asm.sh
263+
asm.stm8
264+
asm.tms320
265+
asm.tricore
266+
asm.v850
267+
asm.wasm
268+
asm.x86
269+
asm.z80
270+
"
271+
SHARED="io.shm"

dist/uefi/Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.PHONY: all configure build
2+
3+
CFLAGS += -DR2_UEFI=1
4+
export CFLAGS
5+
6+
all: build
7+
8+
configure:
9+
rm -rf ../../build-uefi
10+
cd ../.. && meson setup build-uefi --cross-file dist/uefi/cross-uefi.ini -Duse_zip=false -Dstatic_runtime=true -Duse_sys_zlib=false -Duse_sys_magic=false -Duse_sys_openssl=false -Denable_tests=false -Dplugins= -Duse_fork=false -Duse_dylink=false -Ddebugger=false > /dev/null
11+
12+
build: configure
13+
cd ../.. && meson compile -C build-uefi
14+
15+
clean:
16+
cd ../.. && rm -rf build-uefi

0 commit comments

Comments
 (0)