Skip to content

Commit 5631596

Browse files
abrodkinstephanosio
andcommitted
meta-zephyr-sdk: Add separate QEMU recipe for ARC
This commit makes the following changes to add a separate QEMU recipe for ARC. 1. Re-generate "cross.patch" as there're quite some changes in the newer "configure" script. 2. Remove "--disable-sheepdog" as otherwise configurations fails with --------------->8------------ ERROR: unknown option --disable-sheepdog --------------->8------------ 3. Add symlinks to the ARC QEMU emulator executables in `/usr/bin`. Co-authored-by: Stephanos Ioannidis <[email protected]> Signed-off-by: Alexey Brodkin <[email protected]> Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent d1d1660 commit 5631596

File tree

4 files changed

+270
-0
lines changed

4 files changed

+270
-0
lines changed
Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
2+
DEPENDS = "glib-2.0 zlib pixman gnutls libtasn1 dtc ninja-native meson-native"
3+
LICENSE = "GPLv2"
4+
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
5+
LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
6+
file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f"
7+
8+
SRCREV = "2625a6fbc3f60233e1d340931d00242d82230091"
9+
SRC_URI = "git://github.com/foss-for-synopsys-dwc-arc-processors/qemu.git;protocol=https \
10+
file://cross.patch \
11+
"
12+
13+
BBCLASSEXTEND = "native nativesdk"
14+
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
15+
INHIBIT_PACKAGE_STRIP = "1"
16+
17+
S = "${WORKDIR}/git"
18+
19+
arc_qemu_prefix = "${base_prefix}/usr/synopsys"
20+
21+
inherit autotools pkgconfig
22+
23+
# Standard options:
24+
# --prefix=PREFIX install in PREFIX [$prefix]
25+
# --interp-prefix=PREFIX where to find shared libraries, etc.
26+
# use %M for cpu name [$interp_prefix]
27+
# --target-list=LIST set target list (default: build everything)
28+
# $(echo Available targets: $default_target_list | \
29+
# fold -s -w 53 | sed -e 's/^/ /')
30+
#
31+
# Advanced options (experts only):
32+
# --source-path=PATH path of source code [$source_path]
33+
# --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]
34+
# --cc=CC use C compiler CC [$cc]
35+
# --iasl=IASL use ACPI compiler IASL [$iasl]
36+
# --host-cc=CC use C compiler CC [$host_cc] for code run at
37+
# build time
38+
# --cxx=CXX use C++ compiler CXX [$cxx]
39+
# --objcc=OBJCC use Objective-C compiler OBJCC [$objcc]
40+
# --extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS
41+
# --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS
42+
# --make=MAKE use specified make [$make]
43+
# --install=INSTALL use specified install [$install]
44+
# --python=PYTHON use specified python [$python]
45+
# --smbd=SMBD use specified smbd [$smbd]
46+
# --static enable static build [$static]
47+
# --mandir=PATH install man pages in PATH
48+
# --datadir=PATH install firmware in PATH$confsuffix
49+
# --docdir=PATH install documentation in PATH$confsuffix
50+
# --bindir=PATH install binaries in PATH
51+
# --libdir=PATH install libraries in PATH
52+
# --sysconfdir=PATH install config in PATH$confsuffix
53+
# --localstatedir=PATH install local state in PATH (set at runtime on win32)
54+
# --with-confsuffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir [$confsuffix]
55+
# --enable-modules enable modules support
56+
# --enable-debug-tcg enable TCG debugging
57+
# --disable-debug-tcg disable TCG debugging (default)
58+
# --enable-debug-info enable debugging information (default)
59+
# --disable-debug-info disable debugging information
60+
# --enable-debug enable common debug build options
61+
# --enable-sparse enable sparse checker
62+
# --disable-sparse disable sparse checker (default)
63+
# --disable-strip disable stripping binaries
64+
# --disable-werror disable compilation abort on warning
65+
# --disable-stack-protector disable compiler-provided stack protection
66+
# --disable-sdl disable SDL
67+
# --enable-sdl enable SDL
68+
# --with-sdlabi select preferred SDL ABI 1.2 or 2.0
69+
# --disable-gtk disable gtk UI
70+
# --enable-gtk enable gtk UI
71+
# --with-gtkabi select preferred GTK ABI 2.0 or 3.0
72+
# --disable-virtfs disable VirtFS
73+
# --enable-virtfs enable VirtFS
74+
# --disable-vnc disable VNC
75+
# --enable-vnc enable VNC
76+
# --disable-cocoa disable Cocoa (Mac OS X only)
77+
# --enable-cocoa enable Cocoa (default on Mac OS X)
78+
# --audio-drv-list=LIST set audio drivers list:
79+
# Available drivers: $audio_possible_drivers
80+
# --block-drv-whitelist=L Same as --block-drv-rw-whitelist=L
81+
# --block-drv-rw-whitelist=L
82+
# set block driver read-write whitelist
83+
# (affects only QEMU, not qemu-img)
84+
# --block-drv-ro-whitelist=L
85+
# set block driver read-only whitelist
86+
# (affects only QEMU, not qemu-img)
87+
# --disable-xen disable xen backend driver support
88+
# --enable-xen enable xen backend driver support
89+
# --disable-xen-pci-passthrough
90+
# --enable-xen-pci-passthrough
91+
# --disable-brlapi disable BrlAPI
92+
# --enable-brlapi enable BrlAPI
93+
# --disable-vnc-tls disable TLS encryption for VNC server
94+
# --enable-vnc-tls enable TLS encryption for VNC server
95+
# --disable-vnc-sasl disable SASL encryption for VNC server
96+
# --enable-vnc-sasl enable SASL encryption for VNC server
97+
# --disable-vnc-jpeg disable JPEG lossy compression for VNC server
98+
# --enable-vnc-jpeg enable JPEG lossy compression for VNC server
99+
# --disable-vnc-png disable PNG compression for VNC server (default)
100+
# --enable-vnc-png enable PNG compression for VNC server
101+
# --disable-vnc-ws disable Websockets support for VNC server
102+
# --enable-vnc-ws enable Websockets support for VNC server
103+
# --disable-curses disable curses output
104+
# --enable-curses enable curses output
105+
# --disable-curl disable curl connectivity
106+
# --enable-curl enable curl connectivity
107+
# --disable-fdt disable fdt device tree
108+
# --enable-fdt enable fdt device tree
109+
# --disable-bluez disable bluez stack connectivity
110+
# --enable-bluez enable bluez stack connectivity
111+
# --disable-slirp disable SLIRP userspace network connectivity
112+
# --disable-kvm disable KVM acceleration support
113+
# --enable-kvm enable KVM acceleration support
114+
# --disable-rdma disable RDMA-based migration support
115+
# --enable-rdma enable RDMA-based migration support
116+
# --enable-tcg-interpreter enable TCG with bytecode interpreter (TCI)
117+
# --enable-system enable all system emulation targets
118+
# --disable-system disable all system emulation targets
119+
# --enable-user enable supported user emulation targets
120+
# --disable-user disable all user emulation targets
121+
# --enable-linux-user enable all linux usermode emulation targets
122+
# --disable-linux-user disable all linux usermode emulation targets
123+
# --enable-bsd-user enable all BSD usermode emulation targets
124+
# --disable-bsd-user disable all BSD usermode emulation targets
125+
# --enable-guest-base enable GUEST_BASE support for usermode
126+
# emulation targets
127+
# --disable-guest-base disable GUEST_BASE support
128+
# --enable-pie build Position Independent Executables
129+
# --disable-pie do not build Position Independent Executables
130+
# --fmod-lib path to FMOD library
131+
# --fmod-inc path to FMOD includes
132+
# --oss-lib path to OSS library
133+
# --cpu=CPU Build for host CPU [$cpu]
134+
# --enable-uuid enable uuid support
135+
# --disable-vde disable support for vde network
136+
# --enable-vde enable support for vde network
137+
# --disable-netmap disable support for netmap network
138+
# --enable-netmap enable support for netmap network
139+
# --disable-linux-aio disable Linux AIO support
140+
# --enable-linux-aio enable Linux AIO support
141+
# --disable-cap-ng disable libcap-ng support
142+
# --enable-cap-ng enable libcap-ng support
143+
# --disable-attr disables attr and xattr support
144+
# --enable-attr enable attr and xattr support
145+
# --disable-blobs disable installing provided firmware blobs
146+
# --enable-docs enable documentation build
147+
# --disable-docs disable documentation build
148+
# --disable-vhost-net disable vhost-net acceleration support
149+
# --enable-vhost-net enable vhost-net acceleration support
150+
# --enable-trace-backends=B Set trace backend
151+
# Available backends: $($python $source_path/scripts/tracetool.py --list-backends)
152+
# --with-trace-file=NAME Full PATH,NAME of file to store traces
153+
# Default:trace-<pid>
154+
# --disable-spice disable spice
155+
# --enable-spice enable spice
156+
# --enable-rbd enable building the rados block device (rbd)
157+
# --disable-libiscsi disable iscsi support
158+
# --enable-libiscsi enable iscsi support
159+
# --disable-libnfs disable nfs support
160+
# --enable-libnfs enable nfs support
161+
# --disable-smartcard-nss disable smartcard nss support
162+
# --enable-smartcard-nss enable smartcard nss support
163+
# --disable-libusb disable libusb (for usb passthrough)
164+
# --enable-libusb enable libusb (for usb passthrough)
165+
# --disable-usb-redir disable usb network redirection support
166+
# --enable-usb-redir enable usb network redirection support
167+
# --enable-lzo enable the support of lzo compression library
168+
# --enable-snappy enable the support of snappy compression library
169+
# --disable-guest-agent disable building of the QEMU Guest Agent
170+
# --enable-guest-agent enable building of the QEMU Guest Agent
171+
# --with-vss-sdk=SDK-path enable Windows VSS support in QEMU Guest Agent
172+
# --with-win-sdk=SDK-path path to Windows Platform SDK (to build VSS .tlb)
173+
# --disable-seccomp disable seccomp support
174+
# --enable-seccomp enables seccomp support
175+
# --with-coroutine=BACKEND coroutine backend. Supported options:
176+
# gthread, ucontext, sigaltstack, windows
177+
# --disable-coroutine-pool disable coroutine freelist (worse performance)
178+
# --enable-coroutine-pool enable coroutine freelist (better performance)
179+
# --enable-glusterfs enable GlusterFS backend
180+
# --disable-glusterfs disable GlusterFS backend
181+
# --enable-gcov enable test coverage analysis with gcov
182+
# --gcov=GCOV use specified gcov [$gcov_tool]
183+
# --disable-tpm disable TPM support
184+
# --enable-tpm enable TPM support
185+
# --disable-libssh2 disable ssh block device support
186+
# --enable-libssh2 enable ssh block device support
187+
# --disable-vhdx disables support for the Microsoft VHDX image format
188+
# --enable-vhdx enable support for the Microsoft VHDX image format
189+
# --disable-quorum disable quorum block filter support
190+
# --enable-quorum enable quorum block filter support
191+
# --disable-numa disable libnuma support
192+
# --enable-numa enable libnuma support
193+
194+
195+
QEMUS_BUILT = "arc-softmmu arc64-softmmu"
196+
QEMU_FLAGS = "--disable-docs --disable-sdl --disable-debug-info --disable-cap-ng \
197+
--disable-libnfs --disable-libusb --disable-libiscsi --disable-usb-redir --disable-linux-aio\
198+
--disable-guest-agent --disable-libssh --disable-vnc-png --disable-seccomp \
199+
--disable-tpm --disable-numa --disable-glusterfs \
200+
--disable-virtfs --disable-xen --disable-curl --disable-attr --disable-curses --disable-iconv \
201+
--disable-kvm --disable-parallels --disable-replication \
202+
--disable-live-block-migration --disable-dmg --disable-fdt --disable-blobs \
203+
"
204+
205+
# NOTE: Once --prefix is set, QEMU configure script automatically figures out adequate sysconfdir,
206+
# libexecdir and localstatedir based on the prefix directory; therefore, it is not necessary
207+
# to manually specify these directories. Using the global directory variables to specify
208+
# these directories will lead to shared file conflict with the upstream QEMU that resides in
209+
# /usr.
210+
211+
do_configure() {
212+
# Unset the install path environment variables set by the BitBake because the new configure
213+
# script picks these up, and that interferes with prefix-based install path resolution.
214+
unset libdir
215+
unset libexecdir
216+
unset includedir
217+
unset bindir
218+
unset mandir
219+
unset datadir
220+
unset docdir
221+
unset sysconfdir
222+
unset local_statedir
223+
unset firmwarepath
224+
unset localedir
225+
226+
${S}/configure ${QEMU_FLAGS} --target-list="${QEMUS_BUILT}" --prefix=${arc_qemu_prefix} \
227+
--meson=meson
228+
}
229+
230+
FILES_${PN} = " \
231+
/opt/zephyr-sdk \
232+
"
233+
234+
INSANE_SKIP_${PN} = "already-stripped"
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
We need to be able to trigger configure's cross code but we don't want
2+
to set cross_prefix as it does other things we don't want. Patch things
3+
so we can do what we need in the target config case.
4+
5+
Upstream-Status: Inappropriate [may be rewritten in a way upstream may accept?]
6+
Signed-off-by: Richard Purdie <[email protected]>
7+
8+
9+
Index: qemu/configure
10+
===================================================================
11+
--- a/configure
12+
+++ b/configure
13+
@@ -3934,7 +3934,6 @@ if test "$skip_meson" = no; then
14+
fi
15+
echo "strip = [$(meson_quote $strip)]" >> $cross
16+
echo "windres = [$(meson_quote $windres)]" >> $cross
17+
- if test "$cross_compile" = "yes"; then
18+
cross_arg="--cross-file config-meson.cross"
19+
echo "[host_machine]" >> $cross
20+
if test "$mingw32" = "yes" ; then
21+
@@ -3966,9 +3965,6 @@ if test "$skip_meson" = no; then
22+
else
23+
echo "endian = 'little'" >> $cross
24+
fi
25+
- else
26+
- cross_arg="--native-file config-meson.cross"
27+
- fi
28+
mv $cross config-meson.cross
29+
30+
rm -rf meson-private meson-info meson-logs

meta-zephyr-sdk/recipes-devtools/qemu/zephyr-qemu_git.bb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,13 @@ do_configure() {
224224
}
225225

226226
do_install_append() {
227+
# Link Xilinx QEMU executables
227228
ln -sf ../xilinx/bin/qemu-system-aarch64 ${D}${bindir}/qemu-system-xilinx-aarch64
228229
ln -sf ../xilinx/bin/qemu-system-microblazeel ${D}${bindir}/qemu-system-xilinx-microblazeel
230+
231+
# Link ARC (Synopsys) QEMU executables
232+
ln -sf ../synopsys/bin/qemu-system-arc ${D}${bindir}/qemu-system-arc
233+
ln -sf ../synopsys/bin/qemu-system-arc64 ${D}${bindir}/qemu-system-arc64
229234
}
230235

231236
FILES_${PN} = " \

meta-zephyr-sdk/recipes-hosttools/hosttools/hosttools-tarball.bb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384
66
TOOLCHAIN_TARGET_TASK ?= ""
77

88
TOOLCHAIN_HOST_TASK ?= "\
9+
nativesdk-arc-qemu \
910
nativesdk-zephyr-qemu \
1011
nativesdk-xilinx-qemu \
1112
nativesdk-openocd \

0 commit comments

Comments
 (0)