mirror of
https://github.com/SerenityOS/serenity.git
synced 2026-11-07 04:29:30 -10:00
While `pc` is not particularly wrong on x86_64, it's nonsensical on other supported platforms, namely aarch64 and riscv64. For consistency, we now don't use this vendor anymore, regardless of the platform. Within the LLVM project, we now build as `$arch-serenity`. This is enough in most cases, the only place where we have to specify a vendor is the target .cfg file where we use `$arch-unknown-serenity`. When building GCC and friends, again we simply identify as `$arch-serenity` and this is enough. As a result, the tools in Toolchain/Local/$arch/bin are now named after this pattern: `$arch-serenity-$tool`. These changes affect the toolchain build scripts, serenity's build scripts and the Ports. The last place where we should see `x86_64-pc-serenity` is the output of `config.sub`, which assume the vendor is `pc` on vendor-less `x86*` triples. So `x86_64-serenity` is expanded to `x86_64-pc-serenity`, luckily enough and AFAICT, the whole GNU ecosystem considers `pc`, `unknown` and vendor-less target triples the same. So `configure` shouldn't have an issue finding the right tools anyway. The gn files were edited with sed and are not tested. This commit also includes a check in `Meta/serenity.sh` to give a nicer error message when trying to build the system with an old toolchain. ---- To test this patch, on a clean tree I: - Ran `./Meta/serenity.sh x86_64 GNU` - Ran `./Toolchain/BuildJakt.sh` - Tested these ports: python3(configure based), libjxl(cmake based) and rizin(meson based) - Also booted on aarch64 and risv64 I also repeated the steps above with a Clang toolchain. On a working tree I tested all the affected ports, the results are: - tinycc build fine but can't compile programs, I observed the same on master. - gdb and epsilon don't build but report the same errors as on master. - I manually edited the libgpg-error, and it builds fine. - The gcc port works fine.
46 lines
1.2 KiB
Bash
Executable File
46 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env -S bash ../.port_include.sh
|
|
|
|
source version.sh
|
|
|
|
port='qemu'
|
|
version="${QEMU_VERSION}"
|
|
useconfigure='true'
|
|
configopts=(
|
|
'--target-list=aarch64-softmmu,i386-softmmu,riscv64-softmmu,x86_64-softmmu'
|
|
"--cross-prefix=${SERENITY_ARCH}-serenity-"
|
|
'--extra-ldflags=-lm'
|
|
'--without-default-features'
|
|
'--disable-strip'
|
|
'--enable-pie'
|
|
'--enable-sdl'
|
|
'--enable-slirp'
|
|
'--enable-tcg'
|
|
'--enable-tools'
|
|
)
|
|
depends=(
|
|
'glib'
|
|
'libslirp'
|
|
'pixman'
|
|
'SDL2'
|
|
)
|
|
files=(
|
|
"${QEMU_ARCHIVE_URL}#${QEMU_ARCHIVE_SHA256SUM}"
|
|
)
|
|
|
|
pre_patch() {
|
|
# Disable tests (those need way more stuff than QEMU itself) by clearing the respective meson file.
|
|
echo '' > "${workdir}/tests/meson.build"
|
|
}
|
|
|
|
post_install() {
|
|
# Add a drop-in fstab entry to make sure that we can use anonymous executable memory and bypass W^X
|
|
mkdir -p "${SERENITY_INSTALL_ROOT}/etc/fstab.d"
|
|
rm -rf "${SERENITY_INSTALL_ROOT}/etc/fstab.d/qemu"
|
|
for i in /usr/local/bin/qemu-system-{aarch64,i386,riscv64,x86_64}; do
|
|
echo "${i} ${i} bind bind,wxallowed,axallowed" >> "${SERENITY_INSTALL_ROOT}/etc/fstab.d/qemu"
|
|
done
|
|
}
|
|
|
|
# We don't have '<arch>-serenity-pkg-config', so just use the "normal" one.
|
|
export PKG_CONFIG="pkg-config"
|