View | Details | Raw Unified | Return to bug 243906 | Differences between
and this patch

Collapse All | Expand All

(-)emulators/qemu-sbruno/Makefile (+3 lines)
Lines 20-25 USES= bison compiler:c11 gmake perl5 pkgconfig py Link Here
20
USE_PERL5=	build
20
USE_PERL5=	build
21
MAKE_ENV+=	BSD_MAKE="${MAKE}" V=1
21
MAKE_ENV+=	BSD_MAKE="${MAKE}" V=1
22
22
23
DEPRECATED=	Port will be removed in favor of emulators/qemu
24
EXPIRATION_DATE=	2020-07-01
25
23
ONLY_FOR_ARCHS=		amd64 powerpc powerpc64 # XXX someone wants to debug sparc64 hosts?
26
ONLY_FOR_ARCHS=		amd64 powerpc powerpc64 # XXX someone wants to debug sparc64 hosts?
24
BROKEN_i386=		aarch64 system target is currently broken for i386 hosts, disable for now while dealing with upstream
27
BROKEN_i386=		aarch64 system target is currently broken for i386 hosts, disable for now while dealing with upstream
25
28
(-)emulators/qemu-user-static/Makefile (-35 lines)
Lines 1-35 Link Here
1
# Created by: nox@FreeBSD.org
2
# $FreeBSD$
3
4
COMMENT=	QEMU CPU Emulator github bsd-user branch - static user targets
5
PKGNAMESUFFIX=	-user-static
6
7
QEMU_USER_STATIC=	yes
8
PKGMESSAGE=	/dev/null
9
DESCR=		${.CURDIR}/pkg-descr
10
OPTIONS_SLAVE=	STATIC_LINK BSD_USER X86_TARGETS
11
OPTIONS_EXCLUDE=SAMBA X11 GTK2 OPENGL GNUTLS SASL JPEG PNG CURL \
12
		CDROM_DMA PCAP USBREDIR GNS3 DOCS
13
MASTERDIR=	${.CURDIR}/../qemu-sbruno
14
CONFIGURE_ARGS+=	--extra-cflags=-D_IFI_OQDROPS
15
16
post-install:
17
	@${RM} -r ${STAGEDIR}${PREFIX}/bin/qemu-ga
18
	@${RM} -r ${STAGEDIR}${PREFIX}/bin/qemu-img
19
	@${RM} -r ${STAGEDIR}${PREFIX}/bin/qemu-io
20
	@${RM} -r ${STAGEDIR}${PREFIX}/bin/qemu-nbd
21
	@${RM} -r ${STAGEDIR}${PREFIX}/bin/ivshmem-client
22
	@${RM} -r ${STAGEDIR}${PREFIX}/bin/ivshmem-server
23
	@${MV} ${STAGEDIR}${PREFIX}/etc/rc.d ${WRKDIR}
24
	@${RM} -r ${STAGEDIR}${PREFIX}/etc
25
.if exists(/usr/sbin/binmiscctl)
26
	@${MKDIR} ${STAGEDIR}${PREFIX}/etc
27
	@${MV} ${WRKDIR}/rc.d ${STAGEDIR}${PREFIX}/etc
28
.endif
29
	@${RM} -r ${STAGEDIR}${PREFIX}/man
30
	@${RM} -r ${STAGEDIR}${DATADIR}
31
	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/qemu-*
32
	@(cd ${STAGEDIR}${PREFIX}/bin && \
33
		for i in qemu-*; do ${MV} -i $$i $$i-static; done)
34
35
.include "${MASTERDIR}/Makefile"
(-)emulators/qemu-user-static/pkg-descr (-23 lines)
Lines 1-23 Link Here
1
QEMU is a FAST! processor emulator using dynamic translation to achieve
2
good emulation speed.
3
QEMU has two operating modes:
4
5
    * Full system emulation. In this mode, QEMU emulates a full system
6
(for example a PC), including a processor and various peripherials.
7
It can be used to launch different Operating Systems without rebooting
8
the PC or to debug system code.
9
    * User mode emulation (Linux host only). In this mode, QEMU can launch
10
Linux processes compiled for one CPU on another CPU. It can be used to
11
launch the Wine Windows API emulator or to ease cross-compilation and
12
cross-debugging.
13
14
As QEMU requires no host kernel patches to run, it is very safe and easy to use.
15
16
This is a slave port of emulators/qemu-sbruno to build only static
17
bsd-user targets named like qemu-mips-static.  While still being
18
experimental people have already built quite a few armv6/mips/mips64
19
packages using these and e.g. poudriere.  Some notes are also here:
20
21
	http://wiki.freebsd.org/QemuUserModeHowTo
22
23
WWW: http://wiki.qemu.org/Main_Page
(-)emulators/qemu-user-static/Makefile (+91 lines)
Line 0 Link Here
1
# $FreeBSD$
2
3
PORTNAME=	qemu
4
PORTVERSION=	3.1.0
5
PORTREVISION=	3
6
CATEGORIES=	emulators
7
PKGNAMESUFFIX=	-user-static
8
DIST_SUBDIR=	qemu/${PORTVERSION}
9
10
MAINTAINER=	emulation@FreeBSD.org
11
COMMENT=	QEMU CPU Emulator (github bsd-user branch)
12
13
LICENSE=	GPLv2
14
LICENSE_FILE=	${WRKSRC}/COPYING
15
16
ONLY_FOR_ARCHS=		amd64 powerpc powerpc64
17
CONFLICTS_INSTALL=	qemu-user-static-devel-[0-9]*
18
19
USES=		bison compiler:c11 gmake perl5 pkgconfig python:build
20
USE_GITHUB=	yes
21
GH_TUPLE=	seanbruno:qemu-bsd-user:e21442a	\
22
		qemu:keycodemapdb:10739aa:keycodemapdb/ui/keycodemapdb
23
HAS_CONFIGURE=	yes
24
USE_PERL5=	build
25
MAKE_ENV+=	BSD_MAKE="${MAKE}" V=1
26
27
USE_RC_SUBR=	qemu_user_static
28
SUB_LIST=	NAME=qemu_user_static
29
30
# When static linking we have a build dependency on libglib-2.0.a, otherwise
31
# we use glib20 in the usual way (shared-lib runtime dependency).
32
BUILD_DEPENDS+=	${LOCALBASE}/lib/libglib-2.0.a:devel/glib20
33
34
.include <bsd.port.pre.mk>
35
36
CONFIGURE_ARGS+=	--localstatedir=/var
37
CONFIGURE_ARGS+=	--extra-ldflags=-L${LOCALBASE}/lib
38
CONFIGURE_ARGS+=	--extra-cflags=-I${LOCALBASE}/include
39
CONFIGURE_ARGS+=	--disable-libssh2
40
41
QEMU_TARGETS=		i386-bsd-user sparc-bsd-user arm-bsd-user mips-bsd-user mipsel-bsd-user ppc-bsd-user
42
.if ${ARCH} == "amd64" || ${ARCH} == "powerpc64"
43
QEMU_TARGETS+=		x86_64-bsd-user riscv64-bsd-user sparc64-bsd-user mips64-bsd-user mips64el-bsd-user ppc64-bsd-user aarch64-bsd-user
44
PLIST_SUB+=	64BIT=""
45
.else
46
PLIST_SUB+=	64BIT="@comment "
47
.endif
48
CONFIGURE_ARGS+=	--target-list=${QEMU_TARGETS:ts,}
49
50
WITHOUT_CPU_CFLAGS=yes	#to avoid problems with register allocation
51
CFLAGS:=	${CFLAGS:C/-fno-tree-vrp//}
52
CFLAGS+=	-Wno-address-of-packed-member
53
CFLAGS+=	-D_WANT_SEMUN
54
CONFIGURE_ARGS+=	--prefix=${PREFIX} --cc=${CC} --enable-docs \
55
	--disable-linux-user --disable-linux-aio \
56
	--disable-kvm --disable-xen \
57
	--smbd=${LOCALBASE}/sbin/smbd \
58
	--enable-debug \
59
	--enable-debug-info \
60
	--static \
61
	--python=${PYTHON_CMD} \
62
	--disable-sdl --disable-gtk --disable-vte --disable-gnutls --disable-vnc \
63
	--disable-curl --disable-opengl --disable-usb-redir --disable-pcap \
64
	--disable-docs --disable-tools --disable-system --disable-guest-agent \
65
	--extra-cflags=-I${WRKSRC}\ -I${LOCALBASE}/include\ -DPREFIX=\\\"\"${PREFIX}\\\"\"
66
67
QEMU_ARCH=	${ARCH:C/amd64/x86_64/:C/powerpc/ppc/}
68
MAKE_ARGS+=	ARCH=${QEMU_ARCH}
69
70
post-patch:
71
	@${REINPLACE_CMD} -E \
72
		-e "s|^(CFLAGS=).*|\1${CFLAGS} -fno-strict-aliasing|" \
73
		-e "s|^(LDFLAGS=).*|\1${LDFLAGS}|" \
74
		${WRKSRC}/Makefile.target
75
	@${REINPLACE_CMD} -E \
76
		-e "s|^(CFLAGS=).*|\1${CFLAGS} -fno-strict-aliasing -I.|" \
77
		-e "s|^(LDFLAGS=).*|\1${LDFLAGS}|" \
78
		${WRKSRC}/Makefile
79
80
post-install:
81
	@${MV} ${STAGEDIR}${PREFIX}/etc/rc.d ${WRKDIR}
82
	@${RM} -r ${STAGEDIR}${PREFIX}/etc
83
	@${MKDIR} ${STAGEDIR}${PREFIX}/etc
84
	@${MV} ${WRKDIR}/rc.d ${STAGEDIR}${PREFIX}/etc
85
	@${RM} -r ${STAGEDIR}${PREFIX}/man
86
	@${RM} -r ${STAGEDIR}${DATADIR}
87
	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/qemu-*
88
	@(cd ${STAGEDIR}${PREFIX}/bin && \
89
		for i in qemu-*; do ${MV} -i $$i $$i-static; done)
90
91
.include <bsd.port.post.mk>
(-)emulators/qemu-user-static/distinfo (+5 lines)
Line 0 Link Here
1
TIMESTAMP = 1576119784
2
SHA256 (qemu/3.1.0/seanbruno-qemu-bsd-user-3.1.0-e21442a_GH0.tar.gz) = 8396a53fbf6f46f89327bc0b747aca928dc21916f67952f938f6c527ccab8cfd
3
SIZE (qemu/3.1.0/seanbruno-qemu-bsd-user-3.1.0-e21442a_GH0.tar.gz) = 16902208
4
SHA256 (qemu/3.1.0/qemu-keycodemapdb-10739aa_GH0.tar.gz) = ae43fb1e2b07b78be88a7882306b6e71383eb77472a35d7d78fed21e345d134a
5
SIZE (qemu/3.1.0/qemu-keycodemapdb-10739aa_GH0.tar.gz) = 47895
(-)emulators/qemu-user-static/files/qemu_user_static.in (+164 lines)
Line 0 Link Here
1
#!/bin/sh
2
#
3
# $FreeBSD$
4
#
5
6
# PROVIDE: %%NAME%%
7
# REQUIRE: LOGIN
8
# KEYWORD: shutdown
9
10
# Add the following lines to /etc/rc.conf to enable `%%NAME%%':
11
#
12
# %%NAME%%_enable="YES"
13
#
14
15
. /etc/rc.subr
16
17
name=%%NAME%%
18
rcvar=%%NAME%%_enable
19
20
# read configuration and set defaults
21
load_rc_config "$name"
22
23
: ${%%NAME%%_enable:="NO"}
24
25
BINMISCCTL=/usr/sbin/binmiscctl
26
QEMU_DIR=%%PREFIX%%/bin
27
QEMU_PREFIX=qemu-
28
QEMU_SUFFIX=-static
29
30
start_cmd=%%NAME%%_start
31
stop_cmd=%%NAME%%_stop
32
extra_commands=list
33
list_cmd="${BINMISCCTL} list"
34
35
%%NAME%%_start()
36
{
37
	# register arm interpreter styled 'arm'
38
	interpreter=${QEMU_DIR}/${QEMU_PREFIX}arm${QEMU_SUFFIX}
39
	if [ -x "${interpreter}" ]; then
40
		${BINMISCCTL} add arm --interpreter "${interpreter}" \
41
			--magic "\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00" \
42
			--mask  "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff" \
43
			--size 20 --set-enabled
44
	else
45
		echo "$0: interpreter ${interpreter} not found, cannot register."
46
	fi
47
	# register armv6 interpreter styled 'arm'
48
	interpreter=${QEMU_DIR}/${QEMU_PREFIX}arm${QEMU_SUFFIX}
49
	if [ -x "${interpreter}" ]; then
50
		${BINMISCCTL} add armv6 --interpreter "${interpreter}" \
51
			--magic "\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00" \
52
			--mask  "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff" \
53
			--size 20 --set-enabled
54
	else
55
		echo "$0: interpreter ${interpreter} not found, cannot register."
56
	fi
57
	# register armv7 interpreter styled 'arm'
58
	interpreter=${QEMU_DIR}/${QEMU_PREFIX}arm${QEMU_SUFFIX}
59
	if [ -x "${interpreter}" ]; then
60
		${BINMISCCTL} add armv7 --interpreter "${interpreter}" \
61
			--magic "\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00" \
62
			--mask  "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff" \
63
			--size 20 --set-enabled
64
	else
65
		echo "$0: interpreter ${interpreter} not found, cannot register."
66
	fi
67
	# register aarch64 interpreter styled 'aarch64'
68
	interpreter=${QEMU_DIR}/${QEMU_PREFIX}aarch64${QEMU_SUFFIX}
69
	if [ -x "${interpreter}" ]; then
70
		${BINMISCCTL} add aarch64 --interpreter "${interpreter}" \
71
			--magic "\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00" \
72
			--mask  "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff" \
73
			--size 20 --set-enabled
74
	else
75
		echo "$0: interpreter ${interpreter} not found, cannot register."
76
	fi
77
	# register mips interpreter styled 'mips'
78
	interpreter=${QEMU_DIR}/${QEMU_PREFIX}mips${QEMU_SUFFIX}
79
	if [ -x "${interpreter}" ]; then
80
		${BINMISCCTL} add mips --interpreter "${interpreter}" \
81
			--magic "\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08" \
82
			--mask "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff" \
83
			--size 20 --set-enabled
84
	else
85
		echo "$0: interpreter ${interpreter} not found, cannot register."
86
	fi
87
	# register mipsle interpreter styled 'mipsel'
88
	interpreter=${QEMU_DIR}/${QEMU_PREFIX}mipsel${QEMU_SUFFIX}
89
	if [ -x "${interpreter}" ]; then
90
		${BINMISCCTL} add mipsel --interpreter "${interpreter}" \
91
			--magic "\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00" \
92
			--mask "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff" \
93
			--size 20 --set-enabled
94
	else
95
		echo "$0: interpreter ${interpreter} not found, cannot register."
96
	fi
97
	# register mips64 interpreter styled 'mips64'
98
	interpreter=${QEMU_DIR}/${QEMU_PREFIX}mips64${QEMU_SUFFIX}
99
	if [ -x "${interpreter}" ]; then
100
		${BINMISCCTL} add mips64 --interpreter "${interpreter}" \
101
			--magic "\x7f\x45\x4c\x46\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08" \
102
			--mask  "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff" \
103
			--size 20 --set-enabled
104
	else
105
		echo "$0: interpreter ${interpreter} not found, cannot register."
106
	fi
107
	# register powerpc interpreter styled 'ppc'
108
	interpreter=${QEMU_DIR}/${QEMU_PREFIX}ppc${QEMU_SUFFIX}
109
	if [ -x "${interpreter}" ]; then
110
		${BINMISCCTL} add powerpc --interpreter "${interpreter}" \
111
			--magic "\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14" \
112
			--mask "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff" \
113
			--size 20 --set-enabled
114
	else
115
		echo "$0: interpreter ${interpreter} not found, cannot register."
116
	fi
117
	# register powerpc64 interpreter styled 'ppc64'
118
	interpreter=${QEMU_DIR}/${QEMU_PREFIX}ppc64${QEMU_SUFFIX}
119
	if [ -x "${interpreter}" ]; then
120
		${BINMISCCTL} add powerpc64 --interpreter "${interpreter}" \
121
			--magic "\x7f\x45\x4c\x46\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15" \
122
			--mask "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff" \
123
			--size 20 --set-enabled
124
	else
125
		echo "$0: interpreter ${interpreter} not found, cannot register."
126
	fi
127
	# register riscv64 interpreter styled 'riscv64'
128
	interpreter=${QEMU_DIR}/${QEMU_PREFIX}riscv64${QEMU_SUFFIX}
129
	if [ -x "${interpreter}" ]; then
130
		${BINMISCCTL} add riscv64 --interpreter "${interpreter}" \
131
			--magic "\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xf3\x00" \
132
			--mask "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff" \
133
			--size 20 --set-enabled
134
	else
135
		echo "$0: interpreter ${interpreter} not found, cannot register."
136
	fi
137
	# register sparc64 interpreter styled 'sparc64'
138
	interpreter=${QEMU_DIR}/${QEMU_PREFIX}sparc64${QEMU_SUFFIX}
139
	if [ -x "${interpreter}" ]; then
140
		${BINMISCCTL} add sparc64 --interpreter "${interpreter}" \
141
			--magic "\x7f\x45\x4c\x46\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2b" \
142
			--mask "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff" \
143
			--size 20 --set-enabled
144
	else
145
		echo "$0: interpreter ${interpreter} not found, cannot register."
146
	fi
147
}
148
149
%%NAME%%_stop()
150
{
151
	${BINMISCCTL} remove arm
152
	${BINMISCCTL} remove armv6
153
	${BINMISCCTL} remove armv7
154
	${BINMISCCTL} remove aarch64
155
	${BINMISCCTL} remove mips
156
	${BINMISCCTL} remove mips64
157
	${BINMISCCTL} remove mipsel
158
	${BINMISCCTL} remove powerpc
159
	${BINMISCCTL} remove powerpc64
160
	${BINMISCCTL} remove riscv64
161
	${BINMISCCTL} remove sparc64
162
}
163
164
run_rc_command "$1"
(-)emulators/qemu-user-static/pkg-descr (+22 lines)
Line 0 Link Here
1
QEMU is a FAST! processor emulator using dynamic translation to achieve
2
good emulation speed.
3
QEMU has two operating modes:
4
5
    * Full system emulation. In this mode, QEMU emulates a full system
6
(for example a PC), including a processor and various peripherials.
7
It can be used to launch different Operating Systems without rebooting
8
the PC or to debug system code.
9
    * User mode emulation (Linux host only). In this mode, QEMU can launch
10
Linux processes compiled for one CPU on another CPU. It can be used to
11
launch the Wine Windows API emulator or to ease cross-compilation and
12
cross-debugging.
13
14
As QEMU requires no host kernel patches to run, it is very safe and easy to use.
15
16
This port builds static bsd-user targets named like qemu-mips-static. While
17
still being experimental, people have already built many armv6/mips/mips64 ports
18
using these and, e.g., poudriere.  Some notes are also here:
19
20
	http://wiki.freebsd.org/QemuUserModeHowTo
21
22
WWW: http://wiki.qemu.org/Main_Page
(-)emulators/qemu-user-static/pkg-plist (+13 lines)
Line 0 Link Here
1
%%64BIT%%bin/qemu-aarch64-static
2
bin/qemu-arm-static
3
bin/qemu-i386-static
4
bin/qemu-mips-static
5
%%64BIT%%bin/qemu-mips64-static
6
%%64BIT%%bin/qemu-mips64el-static
7
bin/qemu-mipsel-static
8
bin/qemu-ppc-static
9
%%64BIT%%bin/qemu-ppc64-static
10
%%64BIT%%bin/qemu-riscv64-static
11
bin/qemu-sparc-static
12
%%64BIT%%bin/qemu-sparc64-static
13
%%64BIT%%bin/qemu-x86_64-static

Return to bug 243906