Everywhere: Stop using pc in our target triples

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.
This commit is contained in:
Lucas Chollet authored and Sönke Holz committed 2026-03-13 20:59:49 +01:00
1 parent 3a272e71b8
commit cc0939a666
42 files changed
+120 -115

No files matched your search

+1 -1
View File
@@ -42,7 +42,7 @@ gcc_path = None
for serenity_arch in ['x86_64', 'aarch64']: for serenity_arch in ['x86_64', 'aarch64']:
candidate_gcc_path = os.path.join( candidate_gcc_path = os.path.join(
DIR_OF_THIS_SCRIPT, 'Toolchain', DIR_OF_THIS_SCRIPT, 'Toolchain',
'Local', serenity_arch, 'bin', f'{serenity_arch}-pc-serenity-gcc' 'Local', serenity_arch, 'bin', f'{serenity_arch}-serenity-gcc'
) )
if os.path.isfile(candidate_gcc_path): if os.path.isfile(candidate_gcc_path):
gcc_path = candidate_gcc_path gcc_path = candidate_gcc_path
+2 -2
View File
@@ -37,7 +37,7 @@ First, make sure you have a working toolchain and can build and run SerenityOS.
Userland/Libraries/LibC/ Userland/Libraries/LibC/
Userland/Libraries/LibSystem/ Userland/Libraries/LibSystem/
Userland/Services/ Userland/Services/
Toolchain/Local/x86_64/x86_64-pc-serenity/include/c++/13.1.0 Toolchain/Local/x86_64/x86_64-serenity/include/c++/13.1.0
Build/x86_64/ Build/x86_64/
Build/x86_64/Userland/ Build/x86_64/Userland/
Build/x86_64/Userland/Libraries/ Build/x86_64/Userland/Libraries/
@@ -100,4 +100,4 @@ option "License template:". Click "Browse…", select your file (i.e.,
## Compiler Kits ## Compiler Kits
You can slightly improve how well Qt interprets the code by adding and setting up an appropriate "compiler kit". You can slightly improve how well Qt interprets the code by adding and setting up an appropriate "compiler kit".
For that you will need to reference the compilers at `Toolchain/Local/x86_64/bin/x86_64-pc-serenity-gcc` and `Toolchain/Local/x86_64/bin/x86_64-pc-serenity-g++`. For that you will need to reference the compilers at `Toolchain/Local/x86_64/bin/x86_64-serenity-gcc` and `Toolchain/Local/x86_64/bin/x86_64-serenity-g++`.
+3 -3
View File
@@ -48,10 +48,10 @@ following `c_cpp_properties.json` to circumvent some errors. Even with the confi
"${workspaceFolder}/Userland/Libraries", "${workspaceFolder}/Userland/Libraries",
"${workspaceFolder}/Userland/Libraries/LibC", "${workspaceFolder}/Userland/Libraries/LibC",
"${workspaceFolder}/Userland/Services", "${workspaceFolder}/Userland/Services",
"${workspaceFolder}/Toolchain/Local/x86_64/x86_64-pc-serenity/include/c++/**" "${workspaceFolder}/Toolchain/Local/x86_64/x86_64-serenity/include/c++/**"
], ],
"defines": ["DEBUG", "__serenity__"], "defines": ["DEBUG", "__serenity__"],
"compilerPath": "${workspaceFolder}/Toolchain/Local/x86_64/bin/x86_64-pc-serenity-g++", "compilerPath": "${workspaceFolder}/Toolchain/Local/x86_64/bin/x86_64-serenity-g++",
"cStandard": "c17", "cStandard": "c17",
"cppStandard": "c++26", "cppStandard": "c++26",
"intelliSenseMode": "linux-gcc-x86", "intelliSenseMode": "linux-gcc-x86",
@@ -70,7 +70,7 @@ following `c_cpp_properties.json` to circumvent some errors. Even with the confi
"${workspaceFolder}/Userland/Libraries", "${workspaceFolder}/Userland/Libraries",
"${workspaceFolder}/Userland/Libraries/LibC", "${workspaceFolder}/Userland/Libraries/LibC",
"${workspaceFolder}/Userland/Services", "${workspaceFolder}/Userland/Services",
"${workspaceFolder}/Toolchain/Local/x86_64/x86_64-pc-serenity/include/c++/**" "${workspaceFolder}/Toolchain/Local/x86_64/x86_64-serenity/include/c++/**"
], ],
"limitSymbolsToIncludedHeaders": true, "limitSymbolsToIncludedHeaders": true,
"databaseFilename": "${workspaceFolder}/Build/x86_64/" "databaseFilename": "${workspaceFolder}/Build/x86_64/"
+1 -1
View File
@@ -6,7 +6,7 @@ endif()
if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set(vendor "apple") set(vendor "apple")
else() else()
set(vendor "pc") set(vendor "unknown")
endif() endif()
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+1 -1
View File
@@ -25,7 +25,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang$")
# Clang doesn't add compiler_rt to the search path when compiling with -nostdlib. # Clang doesn't add compiler_rt to the search path when compiling with -nostdlib.
string(REGEX REPLACE "\\.(.*)" "" LLVM_MAJOR_VERSION "${CMAKE_CXX_COMPILER_VERSION}") string(REGEX REPLACE "\\.(.*)" "" LLVM_MAJOR_VERSION "${CMAKE_CXX_COMPILER_VERSION}")
link_directories(${TOOLCHAIN_ROOT}/lib/clang/${LLVM_MAJOR_VERSION}/lib/${SERENITY_ARCH}-pc-serenity/) link_directories(${TOOLCHAIN_ROOT}/lib/clang/${LLVM_MAJOR_VERSION}/lib/${SERENITY_ARCH}-serenity/)
endif() endif()
if ("${SERENITY_ARCH}" STREQUAL "riscv64") if ("${SERENITY_ARCH}" STREQUAL "riscv64")
+5 -5
View File
@@ -38,13 +38,13 @@ SERENITY_ARCH="${SERENITY_ARCH:-x86_64}"
if [ "$SERENITY_TOOLCHAIN" = "Clang" ]; then if [ "$SERENITY_TOOLCHAIN" = "Clang" ]; then
TOOLCHAIN_DIR="$SERENITY_SOURCE_DIR"/Toolchain/Local/clang/ TOOLCHAIN_DIR="$SERENITY_SOURCE_DIR"/Toolchain/Local/clang/
rsync -aH --update -t "$TOOLCHAIN_DIR"/lib/"$SERENITY_ARCH"-pc-serenity/* mnt/usr/lib rsync -aH --update -t "$TOOLCHAIN_DIR"/lib/"$SERENITY_ARCH"-unknown-serenity/* mnt/usr/lib
mkdir -p mnt/usr/include/"$SERENITY_ARCH"-pc-serenity mkdir -p mnt/usr/include/"$SERENITY_ARCH"-serenity
rsync -aH --update -t -r "$TOOLCHAIN_DIR"/include/c++ mnt/usr/include rsync -aH --update -t -r "$TOOLCHAIN_DIR"/include/c++ mnt/usr/include
rsync -aH --update -t -r "$TOOLCHAIN_DIR"/include/"$SERENITY_ARCH"-pc-serenity/c++ mnt/usr/include/"$SERENITY_ARCH"-pc-serenity rsync -aH --update -t -r "$TOOLCHAIN_DIR"/include/"$SERENITY_ARCH"-unknown-serenity/c++ mnt/usr/include/"$SERENITY_ARCH"-serenity
else else
rsync -aH --update -t -r "$SERENITY_SOURCE_DIR"/Toolchain/Local/"$SERENITY_ARCH"/"$SERENITY_ARCH"-pc-serenity/lib/* mnt/usr/lib rsync -aH --update -t -r "$SERENITY_SOURCE_DIR"/Toolchain/Local/"$SERENITY_ARCH"/"$SERENITY_ARCH"-serenity/lib/* mnt/usr/lib
rsync -aH --update -t -r "$SERENITY_SOURCE_DIR"/Toolchain/Local/"$SERENITY_ARCH"/"$SERENITY_ARCH"-pc-serenity/include/c++ mnt/usr/include rsync -aH --update -t -r "$SERENITY_SOURCE_DIR"/Toolchain/Local/"$SERENITY_ARCH"/"$SERENITY_ARCH"-serenity/include/c++ mnt/usr/include
fi fi
# If umask was 027 or similar when the repo was cloned, # If umask was 027 or similar when the repo was cloned,
+2 -2
View File
@@ -14,8 +14,8 @@ if [ -z "$SERENITY_KERNEL_DEBUGGER" ]; then
# GDB used to be installed directly inside the toolchain bin directory # GDB used to be installed directly inside the toolchain bin directory
PATH="$SCRIPT_DIR/../Toolchain/Local/$SERENITY_ARCH/bin:$PATH" PATH="$SCRIPT_DIR/../Toolchain/Local/$SERENITY_ARCH/bin:$PATH"
if command -v "$SERENITY_ARCH-pc-serenity-gdb" >/dev/null; then if command -v "$SERENITY_ARCH-serenity-gdb" >/dev/null; then
SERENITY_KERNEL_DEBUGGER="$SERENITY_ARCH-pc-serenity-gdb" SERENITY_KERNEL_DEBUGGER="$SERENITY_ARCH-serenity-gdb"
elif command -v "$SERENITY_ARCH-elf-gdb" >/dev/null; then elif command -v "$SERENITY_ARCH-elf-gdb" >/dev/null; then
SERENITY_KERNEL_DEBUGGER="$SERENITY_ARCH-elf-gdb" SERENITY_KERNEL_DEBUGGER="$SERENITY_ARCH-elf-gdb"
elif command -v gdb >/dev/null && gdb -ex 'set architecture' -ex 'quit' 2>&1 | grep "${SERENITY_ARCH//_/-}"; then elif command -v gdb >/dev/null && gdb -ex 'set architecture' -ex 'quit' 2>&1 | grep "${SERENITY_ARCH//_/-}"; then
+6 -6
View File
@@ -11,19 +11,19 @@ if (serenity_toolchain == "GNU") {
rebase_path("//Toolchain/Local/$serenity_arch/", root_build_dir) rebase_path("//Toolchain/Local/$serenity_arch/", root_build_dir)
toolchain_bin = toolchain_root + "bin/" toolchain_bin = toolchain_root + "bin/"
serenity_cc = toolchain_bin + serenity_arch + "-pc-serenity-gcc" serenity_cc = toolchain_bin + serenity_arch + "-serenity-gcc"
serenity_cxx = toolchain_bin + serenity_arch + "-pc-serenity-g++" serenity_cxx = toolchain_bin + serenity_arch + "-serenity-g++"
serenity_ld = serenity_cxx serenity_ld = serenity_cxx
serenity_nm = toolchain_bin + serenity_arch + "-pc-serenity-nm" serenity_nm = toolchain_bin + serenity_arch + "-serenity-nm"
serenity_objcopy = toolchain_bin + serenity_arch + "-pc-serenity-objcopy" serenity_objcopy = toolchain_bin + serenity_arch + "-serenity-objcopy"
serenity_compiler_version = "13.1.0" serenity_compiler_version = "13.1.0"
} else { } else {
assert(serenity_toolchain == "Clang", assert(serenity_toolchain == "Clang",
"Expected GNU or Clang for serenity_toolchain") "Expected GNU or Clang for serenity_toolchain")
toolchain_root = rebase_path("//Toolchain/Local/clang/", root_build_dir) toolchain_root = rebase_path("//Toolchain/Local/clang/", root_build_dir)
toolchain_bin = toolchain_root + "bin/" toolchain_bin = toolchain_root + "bin/"
serenity_cc = toolchain_bin + serenity_arch + "-pc-serenity-clang" serenity_cc = toolchain_bin + serenity_arch + "-serenity-clang"
serenity_cxx = toolchain_bin + serenity_arch + "-pc-serenity-clang++" serenity_cxx = toolchain_bin + serenity_arch + "-serenity-clang++"
serenity_ld = serenity_cxx serenity_ld = serenity_cxx
serenity_nm = toolchain_bin + "llvm-nm" serenity_nm = toolchain_bin + "llvm-nm"
serenity_objcopy = toolchain_bin + "llvm-objcopy" serenity_objcopy = toolchain_bin + "llvm-objcopy"
+3 -3
View File
@@ -170,8 +170,8 @@ config("Kernel_config") {
"-Wno-dangling-reference", "-Wno-dangling-reference",
] ]
lib_dirs = [ lib_dirs = [
"$toolchain_root/$serenity_arch-pc-serenity/lib", "$toolchain_root/$serenity_arch-serenity/lib",
"$toolchain_root/lib/gcc/$serenity_arch-pc-serenity/$serenity_compiler_version", "$toolchain_root/lib/gcc/$serenity_arch-serenity/$serenity_compiler_version",
] ]
ldflags += [ "-Wl,-z,pack-relative-relocs" ] ldflags += [ "-Wl,-z,pack-relative-relocs" ]
libs = [ "gcc" ] libs = [ "gcc" ]
@@ -187,7 +187,7 @@ config("Kernel_config") {
] ]
# FIXME: Why doesn't the cmake need this path anymore? # FIXME: Why doesn't the cmake need this path anymore?
lib_dirs = [ "$toolchain_root/lib/clang/$serenity_compiler_version/lib/$serenity_arch-pc-serenity/" ] lib_dirs = [ "$toolchain_root/lib/clang/$serenity_compiler_version/lib/$serenity_arch-serenity/" ]
libs = [ "clang_rt.builtins" ] libs = [ "clang_rt.builtins" ]
} }
+9 -4
View File
@@ -169,7 +169,7 @@ cmd_with_target() {
fi fi
JAKT_TOOLCHAIN_DIR="$SERENITY_SOURCE_DIR/Toolchain/Local/jakt" JAKT_TOOLCHAIN_DIR="$SERENITY_SOURCE_DIR/Toolchain/Local/jakt"
SUPER_BUILD_DIR="$SERENITY_SOURCE_DIR/Build/superbuild-$TARGET$TARGET_TOOLCHAIN" SUPER_BUILD_DIR="$SERENITY_SOURCE_DIR/Build/superbuild-$TARGET$TARGET_TOOLCHAIN"
JAKT_LIB_DIR="$BUILD_DIR/Root/usr/local/lib/$TARGET-pc-serenity-unknown" JAKT_LIB_DIR="$BUILD_DIR/Root/usr/local/lib/$TARGET-unknown-serenity-unknown"
else else
SUPER_BUILD_DIR="$BUILD_DIR" SUPER_BUILD_DIR="$BUILD_DIR"
CMAKE_ARGS+=("-DCMAKE_INSTALL_PREFIX=$SERENITY_SOURCE_DIR/Build/lagom-install") CMAKE_ARGS+=("-DCMAKE_INSTALL_PREFIX=$SERENITY_SOURCE_DIR/Build/lagom-install")
@@ -268,9 +268,14 @@ ensure_toolchain() {
fi fi
[ -d "$TOOLCHAIN_DIR" ] || build_toolchain [ -d "$TOOLCHAIN_DIR" ] || build_toolchain
if [[ -n "$(find "$(dirname "$TOOLCHAIN_DIR")" -type f -name '*-pc-serenity*' -print -quit)" ]]; then
die "Your toolchain contains files using the old triple name: '\$arch-pc-serenity'." \
"Please delete both your toolchain and the Build directory (run \`rm -rf Toolchain/{Build,Local} Build\`)."
fi
if [ "$TOOLCHAIN_TYPE" = "GNU" ]; then if [ "$TOOLCHAIN_TYPE" = "GNU" ]; then
local ld_version local ld_version
ld_version="$("$TOOLCHAIN_DIR"/bin/"$TARGET"-pc-serenity-ld -v)" ld_version="$("$TOOLCHAIN_DIR"/bin/"$TARGET"-serenity-ld -v)"
local expected_version="GNU ld (GNU Binutils) 2.44" local expected_version="GNU ld (GNU Binutils) 2.44"
if [ "$ld_version" != "$expected_version" ]; then if [ "$ld_version" != "$expected_version" ]; then
echo "Your toolchain has an old version of binutils installed." echo "Your toolchain has an old version of binutils installed."
@@ -461,7 +466,7 @@ if [[ "$CMD" =~ ^(build|install|image|copy-src|run|gdb|test|rebuild|recreate|kad
if [ "$TOOLCHAIN_TYPE" = "Clang" ]; then if [ "$TOOLCHAIN_TYPE" = "Clang" ]; then
ADDR2LINE="$TOOLCHAIN_DIR/bin/llvm-addr2line" ADDR2LINE="$TOOLCHAIN_DIR/bin/llvm-addr2line"
else else
ADDR2LINE="$TOOLCHAIN_DIR/bin/$TARGET-pc-serenity-addr2line" ADDR2LINE="$TOOLCHAIN_DIR/bin/$TARGET-serenity-addr2line"
fi fi
"$ADDR2LINE" -e "$BUILD_DIR/Kernel/Kernel" "$@" "$ADDR2LINE" -e "$BUILD_DIR/Kernel/Kernel" "$@"
;; ;;
@@ -476,7 +481,7 @@ if [[ "$CMD" =~ ^(build|install|image|copy-src|run|gdb|test|rebuild|recreate|kad
elif [ "$TOOLCHAIN_TYPE" = "Clang" ]; then elif [ "$TOOLCHAIN_TYPE" = "Clang" ]; then
ADDR2LINE="$TOOLCHAIN_DIR/bin/llvm-addr2line" ADDR2LINE="$TOOLCHAIN_DIR/bin/llvm-addr2line"
else else
ADDR2LINE="$TOOLCHAIN_DIR/bin/$TARGET-pc-serenity-addr2line" ADDR2LINE="$TOOLCHAIN_DIR/bin/$TARGET-serenity-addr2line"
fi fi
if [ -x "$BINARY_FILE_PATH" ]; then if [ -x "$BINARY_FILE_PATH" ]; then
"$ADDR2LINE" -e "$BINARY_FILE_PATH" "$@" "$ADDR2LINE" -e "$BINARY_FILE_PATH" "$@"
+12 -12
View File
@@ -29,8 +29,8 @@ fi
if [ "$SERENITY_TOOLCHAIN" = "Clang" ]; then if [ "$SERENITY_TOOLCHAIN" = "Clang" ]; then
export SERENITY_BUILD_DIR="${SERENITY_SOURCE_DIR}/Build/${SERENITY_ARCH}clang" export SERENITY_BUILD_DIR="${SERENITY_SOURCE_DIR}/Build/${SERENITY_ARCH}clang"
export SERENITY_TOOLCHAIN_BINDIR="${SERENITY_SOURCE_DIR}/Toolchain/Local/clang/bin" export SERENITY_TOOLCHAIN_BINDIR="${SERENITY_SOURCE_DIR}/Toolchain/Local/clang/bin"
export CC="${SERENITY_ARCH}-pc-serenity-clang" export CC="${SERENITY_ARCH}-serenity-clang"
export CXX="${SERENITY_ARCH}-pc-serenity-clang++" export CXX="${SERENITY_ARCH}-serenity-clang++"
export LD="${SERENITY_TOOLCHAIN_BINDIR}/ld.lld" export LD="${SERENITY_TOOLCHAIN_BINDIR}/ld.lld"
export AR="llvm-ar" export AR="llvm-ar"
export RANLIB="llvm-ranlib" export RANLIB="llvm-ranlib"
@@ -42,16 +42,16 @@ if [ "$SERENITY_TOOLCHAIN" = "Clang" ]; then
else else
export SERENITY_BUILD_DIR="${SERENITY_SOURCE_DIR}/Build/${SERENITY_ARCH}" export SERENITY_BUILD_DIR="${SERENITY_SOURCE_DIR}/Build/${SERENITY_ARCH}"
export SERENITY_TOOLCHAIN_BINDIR="${SERENITY_SOURCE_DIR}/Toolchain/Local/${SERENITY_ARCH}/bin" export SERENITY_TOOLCHAIN_BINDIR="${SERENITY_SOURCE_DIR}/Toolchain/Local/${SERENITY_ARCH}/bin"
export CC="${SERENITY_ARCH}-pc-serenity-gcc" export CC="${SERENITY_ARCH}-serenity-gcc"
export CXX="${SERENITY_ARCH}-pc-serenity-g++" export CXX="${SERENITY_ARCH}-serenity-g++"
export LD="${SERENITY_TOOLCHAIN_BINDIR}/${SERENITY_ARCH}-pc-serenity-ld" export LD="${SERENITY_TOOLCHAIN_BINDIR}/${SERENITY_ARCH}-serenity-ld"
export AR="${SERENITY_ARCH}-pc-serenity-ar" export AR="${SERENITY_ARCH}-serenity-ar"
export RANLIB="${SERENITY_ARCH}-pc-serenity-ranlib" export RANLIB="${SERENITY_ARCH}-serenity-ranlib"
export READELF="${SERENITY_ARCH}-pc-serenity-readelf" export READELF="${SERENITY_ARCH}-serenity-readelf"
export OBJCOPY="${SERENITY_ARCH}-pc-serenity-objcopy" export OBJCOPY="${SERENITY_ARCH}-serenity-objcopy"
export OBJDUMP="${SERENITY_ARCH}-pc-serenity-objdump" export OBJDUMP="${SERENITY_ARCH}-serenity-objdump"
export STRIP="${SERENITY_ARCH}-pc-serenity-strip" export STRIP="${SERENITY_ARCH}-serenity-strip"
export CXXFILT="${SERENITY_ARCH}-pc-serenity-c++filt" export CXXFILT="${SERENITY_ARCH}-serenity-c++filt"
fi fi
export PATH="${SERENITY_TOOLCHAIN_BINDIR}:${SERENITY_SOURCE_DIR}/Toolchain/Local/cmake/bin:${HOST_PATH}" export PATH="${SERENITY_TOOLCHAIN_BINDIR}:${SERENITY_SOURCE_DIR}/Toolchain/Local/cmake/bin:${HOST_PATH}"
+1 -1
View File
@@ -4,7 +4,7 @@ version='2.44'
useconfigure='true' useconfigure='true'
use_fresh_config_sub='true' use_fresh_config_sub='true'
configopts=( configopts=(
"--target=${SERENITY_ARCH}-pc-serenity" "--target=${SERENITY_ARCH}-serenity"
"--with-sysroot=/" "--with-sysroot=/"
"--with-build-sysroot=${SERENITY_INSTALL_ROOT}" "--with-build-sysroot=${SERENITY_INSTALL_ROOT}"
"--disable-werror" "--disable-werror"
@@ -4,33 +4,33 @@ Date: Tue, 13 Jul 2021 21:17:44 +0200
Subject: [PATCH] Add serenity toolchain information and makefile files Subject: [PATCH] Add serenity toolchain information and makefile files
--- ---
build/platform.simulator.serenity.mak | 6 ++++ build/platform.simulator.serenity.mak | 6 ++++
build/toolchain.x86_64-pc-serenity.mak | 1 + build/toolchain.x86_64-serenity.mak | 1 +
ion/src/simulator/serenity/Makefile | 43 ++++++++++++++++++++++++++ ion/src/simulator/serenity/Makefile | 43 +++++++++++++++++++++++++++
3 files changed, 50 insertions(+) 3 files changed, 50 insertions(+)
create mode 100644 build/platform.simulator.serenity.mak create mode 100644 build/platform.simulator.serenity.mak
create mode 100644 build/toolchain.x86_64-pc-serenity.mak create mode 100644 build/toolchain.x86_64-serenity.mak
create mode 100644 ion/src/simulator/serenity/Makefile create mode 100644 ion/src/simulator/serenity/Makefile
diff --git a/build/platform.simulator.serenity.mak b/build/platform.simulator.serenity.mak diff --git a/build/platform.simulator.serenity.mak b/build/platform.simulator.serenity.mak
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..0ac83c0bb06554bfa3077b9c2b67516291018e3b index 0000000000000000000000000000000000000000..70d961604f4e40d7574df56d6571a0eb7dab024d
--- /dev/null --- /dev/null
+++ b/build/platform.simulator.serenity.mak +++ b/build/platform.simulator.serenity.mak
@@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
+TOOLCHAIN = x86_64-pc-serenity +TOOLCHAIN = x86_64-serenity
+EXE = elf +EXE = elf
+ +
+EPSILON_TELEMETRY ?= 0 +EPSILON_TELEMETRY ?= 0
+ +
+SHOULD_USE_DYNAMIC_SDL = 1 +SHOULD_USE_DYNAMIC_SDL = 1
diff --git a/build/toolchain.x86_64-pc-serenity.mak b/build/toolchain.x86_64-pc-serenity.mak diff --git a/build/toolchain.x86_64-serenity.mak b/build/toolchain.x86_64-serenity.mak
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..bb49f4ed4dcec21891f94ec9c3c9f602d6f4cbcf index 0000000000000000000000000000000000000000..01f36e2c05ee2030b0c64f5d346d81040dec94fa
--- /dev/null --- /dev/null
+++ b/build/toolchain.x86_64-pc-serenity.mak +++ b/build/toolchain.x86_64-serenity.mak
@@ -0,0 +1 @@ @@ -0,0 +1 @@
+TOOLCHAIN_PREFIX = x86_64-pc-serenity +TOOLCHAIN_PREFIX = x86_64-serenity
diff --git a/ion/src/simulator/serenity/Makefile b/ion/src/simulator/serenity/Makefile diff --git a/ion/src/simulator/serenity/Makefile b/ion/src/simulator/serenity/Makefile
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..5d4bb131983ba85c79042cfa790b94e400158705 index 0000000000000000000000000000000000000000..5d4bb131983ba85c79042cfa790b94e400158705
@@ -9,7 +9,7 @@ Subject: [PATCH] Include some missing headers
2 files changed, 3 insertions(+) 2 files changed, 3 insertions(+)
diff --git a/ion/src/simulator/linux/platform_files.cpp b/ion/src/simulator/linux/platform_files.cpp diff --git a/ion/src/simulator/linux/platform_files.cpp b/ion/src/simulator/linux/platform_files.cpp
index b866fe0..cc31edc 100644 index b866fe05cc5555b6c7e74e92a26fc3a79b6d0f78..cc31edc2ba3490ae3185543e97c07d99f0c28741 100644
--- a/ion/src/simulator/linux/platform_files.cpp --- a/ion/src/simulator/linux/platform_files.cpp
+++ b/ion/src/simulator/linux/platform_files.cpp +++ b/ion/src/simulator/linux/platform_files.cpp
@@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
@@ -19,7 +19,7 @@ index b866fe0..cc31edc 100644
namespace Ion { namespace Ion {
namespace Simulator { namespace Simulator {
diff --git a/ion/src/simulator/linux/platform_images.cpp b/ion/src/simulator/linux/platform_images.cpp diff --git a/ion/src/simulator/linux/platform_images.cpp b/ion/src/simulator/linux/platform_images.cpp
index 0fb2386..94ed16c 100644 index 0fb23867bc7b85c9d5ac98722e0a043fd4d23a56..94ed16c4a0b57607b81bc009b44be9b27ab7bb97 100644
--- a/ion/src/simulator/linux/platform_images.cpp --- a/ion/src/simulator/linux/platform_images.cpp
+++ b/ion/src/simulator/linux/platform_images.cpp +++ b/ion/src/simulator/linux/platform_images.cpp
@@ -1,10 +1,12 @@ @@ -1,10 +1,12 @@
@@ -9,7 +9,7 @@ Subject: [PATCH] Don't use dynamic SDL
2 files changed, 5 insertions(+) 2 files changed, 5 insertions(+)
diff --git a/build/platform.simulator.mak b/build/platform.simulator.mak diff --git a/build/platform.simulator.mak b/build/platform.simulator.mak
index 07f1edd..9c349f8 100644 index 07f1edd9ed7da8985e01b6a792d88e5212bbc7af..9c349f81e04d622540e8344d1edbc6864431b579 100644
--- a/build/platform.simulator.mak --- a/build/platform.simulator.mak
+++ b/build/platform.simulator.mak +++ b/build/platform.simulator.mak
@@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
@@ -21,7 +21,7 @@ index 07f1edd..9c349f8 100644
SFLAGS += -fPIE SFLAGS += -fPIE
diff --git a/ion/src/simulator/external/Makefile b/ion/src/simulator/external/Makefile diff --git a/ion/src/simulator/external/Makefile b/ion/src/simulator/external/Makefile
index cf7744b..5157f3c 100644 index cf7744bf47bbf5f4232ab80ae4eb01a92e7b56ba..5157f3cee51c7579f7d6f118d674deefc63e29c0 100644
--- a/ion/src/simulator/external/Makefile --- a/ion/src/simulator/external/Makefile
+++ b/ion/src/simulator/external/Makefile +++ b/ion/src/simulator/external/Makefile
@@ -99,8 +99,12 @@ endif @@ -99,8 +99,12 @@ endif
+2 -2
View File
@@ -2,7 +2,7 @@
port=gcc port=gcc
version=15.2.0 version=15.2.0
useconfigure=true useconfigure=true
configopts=("--target=${SERENITY_ARCH}-pc-serenity" "--with-sysroot=/" "--with-build-sysroot=${SERENITY_INSTALL_ROOT}" "--enable-languages=c,c++" "--disable-lto" "--disable-nls" "--enable-shared" "--enable-default-pie" "--enable-host-shared" "--enable-threads=posix" "--enable-initfini-array" "--with-linker-hash-style=gnu") configopts=("--target=${SERENITY_ARCH}-serenity" "--with-sysroot=/" "--with-build-sysroot=${SERENITY_INSTALL_ROOT}" "--enable-languages=c,c++" "--disable-lto" "--disable-nls" "--enable-shared" "--enable-default-pie" "--enable-host-shared" "--enable-threads=posix" "--enable-initfini-array" "--with-linker-hash-style=gnu")
files=( files=(
"https://ftpmirror.gnu.org/gnu/gcc/gcc-${version}/gcc-${version}.tar.xz#438fd996826b0c82485a29da03a72d71d6e3541a83ec702df4271f6fe025d24e" "https://ftpmirror.gnu.org/gnu/gcc/gcc-${version}/gcc-${version}.tar.xz#438fd996826b0c82485a29da03a72d71d6e3541a83ec702df4271f6fe025d24e"
) )
@@ -13,7 +13,7 @@ depends=("binutils" "gmp" "mpfr" "mpc" "isl")
build() { build() {
run make "${makeopts[@]}" run make "${makeopts[@]}"
run find "./host-${SERENITY_ARCH}-pc-serenity/gcc/" -maxdepth 1 -type f -executable -exec $STRIP --strip-debug {} \; || echo run find "./host-${SERENITY_ARCH}-serenity/gcc/" -maxdepth 1 -type f -executable -exec $STRIP --strip-debug {} \; || echo
} }
install() { install() {
+1 -1
View File
@@ -2,7 +2,7 @@
port=gdb port=gdb
version=11.2 version=11.2
useconfigure=true useconfigure=true
configopts=("--target=${SERENITY_ARCH}-pc-serenity" "--with-sysroot=/" "--with-build-sysroot=${SERENITY_INSTALL_ROOT}" "--with-newlib" "--enable-languages=c,c++" "--disable-lto" "--disable-nls" "--enable-shared" "--enable-default-pie" "--enable-host-shared" "--enable-threads=posix") configopts=("--target=${SERENITY_ARCH}-serenity" "--with-sysroot=/" "--with-build-sysroot=${SERENITY_INSTALL_ROOT}" "--with-newlib" "--enable-languages=c,c++" "--disable-lto" "--disable-nls" "--enable-shared" "--enable-default-pie" "--enable-host-shared" "--enable-threads=posix")
files=( files=(
"https://ftpmirror.gnu.org/gnu/gdb/gdb-${version}.tar.xz#1497c36a71881b8671a9a84a0ee40faab788ca30d7ba19d8463c3cc787152e32" "https://ftpmirror.gnu.org/gnu/gdb/gdb-${version}.tar.xz#1497c36a71881b8671a9a84a0ee40faab788ca30d7ba19d8463c3cc787152e32"
) )
@@ -4,7 +4,7 @@ Date: Wed, 15 Apr 2020 14:23:25 +0100
Subject: [PATCH] Don't build the docs and the demo Subject: [PATCH] Don't build the docs and the demo
- docs - segfault during make :/ - docs - segfault during make :/
- demo - x86_64-pc-serenity-gcc: error: unrecognized command line option '-rdynamic' - demo - x86_64-serenity-gcc: error: unrecognized command line option '-rdynamic'
--- ---
Makefile.am | 5 ++++- Makefile.am | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-) 1 file changed, 4 insertions(+), 1 deletion(-)
@@ -20,7 +20,7 @@ index 7e2c4008cda62e8b8e2959e4d2953722f6d350db..a8df6c0617210c7d7344052e3a34c569
-SUBDIRS = config m4 term src docs man demo share -SUBDIRS = config m4 term src docs man demo share
+# Note: For the SerenityOS port of gnuplot, the following have been removed: +# Note: For the SerenityOS port of gnuplot, the following have been removed:
+# docs - segfault during make :/ +# docs - segfault during make :/
+# demo - x86_64-pc-serenity-gcc: error: unrecognized command line option '-rdynamic' +# demo - x86_64-serenity-gcc: error: unrecognized command line option '-rdynamic'
+SUBDIRS = config m4 term src man share +SUBDIRS = config m4 term src man share
EXTRA_DIST = BUGS Copyright FAQ.pdf INSTALL INSTALL.gnu \ EXTRA_DIST = BUGS Copyright FAQ.pdf INSTALL INSTALL.gnu \
+1 -1
View File
@@ -5,5 +5,5 @@
Don't build the docs and the demo Don't build the docs and the demo
- docs - segfault during make :/ - docs - segfault during make :/
- demo - x86_64-pc-serenity-gcc: error: unrecognized command line option '-rdynamic' - demo - x86_64-serenity-gcc: error: unrecognized command line option '-rdynamic'
@@ -4,17 +4,17 @@ Date: Wed, 14 Apr 2021 04:32:34 +0200
Subject: [PATCH] Stub out the gpgrt lock impl Subject: [PATCH] Stub out the gpgrt lock impl
--- ---
src/syscfg/lock-obj-pub.x86_64-pc-serenity.h | 17 +++++++++++++++++ .../lock-obj-pub.x86_64-unknown-serenity.h | 17 +++++++++++++++++
1 file changed, 17 insertions(+) 1 file changed, 17 insertions(+)
create mode 100644 src/syscfg/lock-obj-pub.x86_64-pc-serenity.h create mode 100644 src/syscfg/lock-obj-pub.x86_64-unknown-serenity.h
diff --git a/src/syscfg/lock-obj-pub.x86_64-pc-serenity.h b/src/syscfg/lock-obj-pub.x86_64-pc-serenity.h diff --git a/src/syscfg/lock-obj-pub.x86_64-unknown-serenity.h b/src/syscfg/lock-obj-pub.x86_64-unknown-serenity.h
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..f681e010c88c27bd36b78a1ccf39168e897a22ff index 0000000000000000000000000000000000000000..390b9dd12afc823e35f940085e43218393d9955b
--- /dev/null --- /dev/null
+++ b/src/syscfg/lock-obj-pub.x86_64-pc-serenity.h +++ b/src/syscfg/lock-obj-pub.x86_64-unknown-serenity.h
@@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
+## lock-obj-pub.x86_64-pc-serenity.h - NO LOCK SUPPORT +## lock-obj-pub.x86_64-unknown-serenity.h - NO LOCK SUPPORT
+## File created by gen-posix-lock-obj - DO NOT EDIT +## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h +## To be included by mkheader into gpg-error.h
+ +
+1 -1
View File
@@ -58,7 +58,7 @@ configure() {
-DCROSS_TOOLCHAIN_FLAGS_NATIVE="-DCMAKE_C_COMPILER=$CC;-DCMAKE_CXX_COMPILER=$CXX" \ -DCROSS_TOOLCHAIN_FLAGS_NATIVE="-DCMAKE_C_COMPILER=$CC;-DCMAKE_CXX_COMPILER=$CXX" \
-DHAVE_LIBRT=OFF \ -DHAVE_LIBRT=OFF \
-DLLVM_APPEND_VC_REV=OFF \ -DLLVM_APPEND_VC_REV=OFF \
-DLLVM_DEFAULT_TARGET_TRIPLE=$SERENITY_ARCH-pc-serenity \ -DLLVM_DEFAULT_TARGET_TRIPLE=$SERENITY_ARCH-serenity \
-DLLVM_ENABLE_PROJECTS="clang;lld;compiler-rt" \ -DLLVM_ENABLE_PROJECTS="clang;lld;compiler-rt" \
-DLLVM_HAVE_LIBXAR=OFF \ -DLLVM_HAVE_LIBXAR=OFF \
-DLLVM_INCLUDE_BENCHMARKS=OFF \ -DLLVM_INCLUDE_BENCHMARKS=OFF \
+1 -1
View File
@@ -11,7 +11,7 @@ if [ ${SERENITY_ARCH} = "x86_64" ]; then
M_FLAG=-m64 M_FLAG=-m64
fi fi
makeopts=("CROSS=${SERENITY_ARCH}-pc-serenity-" "HOST_CC=${HOST_CC} ${M_FLAG}") makeopts=("CROSS=${SERENITY_ARCH}-serenity-" "HOST_CC=${HOST_CC} ${M_FLAG}")
configure() { configure() {
printf "\x1b[31m\x1b[5mATTENTION: \x1b[0m\x1b[31m\x1b[1mIf this fails, install either libc6-dev-i386 or libc6-dev-amd64\x1b[0m\n" printf "\x1b[31m\x1b[5mATTENTION: \x1b[0m\x1b[31m\x1b[1mIf this fails, install either libc6-dev-i386 or libc6-dev-amd64\x1b[0m\n"
@@ -8,7 +8,7 @@ Subject: [PATCH] Include sys/select.h
1 file changed, 1 insertion(+) 1 file changed, 1 insertion(+)
diff --git a/mrbgems/mruby-io/src/io.c b/mrbgems/mruby-io/src/io.c diff --git a/mrbgems/mruby-io/src/io.c b/mrbgems/mruby-io/src/io.c
index 0469c05..0dae6ca 100644 index 0469c05454a7401501d2faea63c05118120162df..0dae6ca32e73aa8234dc9c9ce0d00abc5befe84c 100644
--- a/mrbgems/mruby-io/src/io.c --- a/mrbgems/mruby-io/src/io.c
+++ b/mrbgems/mruby-io/src/io.c +++ b/mrbgems/mruby-io/src/io.c
@@ -49,6 +49,7 @@ @@ -49,6 +49,7 @@
@@ -10,20 +10,20 @@ Subject: [PATCH] Add a build conf for serenity
diff --git a/build_config/serenity.rb b/build_config/serenity.rb diff --git a/build_config/serenity.rb b/build_config/serenity.rb
new file mode 100644 new file mode 100644
index 0000000..b38f5ee index 0000000000000000000000000000000000000000..e00103089ca9a887a512abff8c729478844a6055
--- /dev/null --- /dev/null
+++ b/build_config/serenity.rb +++ b/build_config/serenity.rb
@@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
+MRuby::CrossBuild.new('serenity') do |conf| +MRuby::CrossBuild.new('serenity') do |conf|
+ conf.toolchain :gcc + conf.toolchain :gcc
+ +
+ conf.archiver.command = "#{ENV['SERENITY_ARCH']}-pc-serenity-ar" + conf.archiver.command = "#{ENV['SERENITY_ARCH']}-serenity-ar"
+ conf.linker.command = "#{ENV['SERENITY_ARCH']}-pc-serenity-g++" + conf.linker.command = "#{ENV['SERENITY_ARCH']}-serenity-g++"
+ +
+ conf.cxx.command = "#{ENV['SERENITY_ARCH']}-pc-serenity-g++" + conf.cxx.command = "#{ENV['SERENITY_ARCH']}-serenity-g++"
+ conf.cxx.defines << (ENV['SERENITY_ARCH'].include?('64') ? 'MRB_64BIT' : 'MRB_32BIT') + conf.cxx.defines << (ENV['SERENITY_ARCH'].include?('64') ? 'MRB_64BIT' : 'MRB_32BIT')
+ +
+ conf.cc.command = "#{ENV['SERENITY_ARCH']}-pc-serenity-gcc" + conf.cc.command = "#{ENV['SERENITY_ARCH']}-serenity-gcc"
+ conf.cc.defines << (ENV['SERENITY_ARCH'].include?('64') ? 'MRB_64BIT' : 'MRB_32BIT') + conf.cc.defines << (ENV['SERENITY_ARCH'].include?('64') ? 'MRB_64BIT' : 'MRB_32BIT')
+ +
+ conf.gembox 'full-core' + conf.gembox 'full-core'
+2 -2
View File
@@ -7,7 +7,7 @@ version="${QEMU_VERSION}"
useconfigure='true' useconfigure='true'
configopts=( configopts=(
'--target-list=aarch64-softmmu,i386-softmmu,riscv64-softmmu,x86_64-softmmu' '--target-list=aarch64-softmmu,i386-softmmu,riscv64-softmmu,x86_64-softmmu'
"--cross-prefix=${SERENITY_ARCH}-pc-serenity-" "--cross-prefix=${SERENITY_ARCH}-serenity-"
'--extra-ldflags=-lm' '--extra-ldflags=-lm'
'--without-default-features' '--without-default-features'
'--disable-strip' '--disable-strip'
@@ -41,5 +41,5 @@ post_install() {
done done
} }
# We don't have '<arch>-pc-serenity-pkg-config', so just use the "normal" one. # We don't have '<arch>-serenity-pkg-config', so just use the "normal" one.
export PKG_CONFIG="pkg-config" export PKG_CONFIG="pkg-config"
+2 -2
View File
@@ -9,8 +9,8 @@ makeopts=("tcc")
configure() { configure() {
run ./configure \ run ./configure \
--cross-prefix="${SERENITY_ARCH}-pc-serenity-" \ --cross-prefix="${SERENITY_ARCH}-serenity-" \
--cpu="${SERENITY_ARCH}" \ --cpu="${SERENITY_ARCH}" \
--triplet="${SERENITY_ARCH}-pc-serenity" \ --triplet="${SERENITY_ARCH}-serenity" \
--crtprefix=/usr/lib --crtprefix=/usr/lib
} }
+1 -1
View File
@@ -36,7 +36,7 @@ post_fetch() {
} }
build() { build() {
local gcc_lib_dir="${DESTDIR}/usr/local/lib/gcc/${SERENITY_ARCH}-pc-serenity/${SERENITY_GCC_VERSION}" local gcc_lib_dir="${DESTDIR}/usr/local/lib/gcc/${SERENITY_ARCH}-serenity/${SERENITY_GCC_VERSION}"
if [ ! -f "${gcc_lib_dir}/crtbeginS.o" ] || [ ! -f "${gcc_lib_dir}/crtendS.o" ]; then if [ ! -f "${gcc_lib_dir}/crtbeginS.o" ] || [ ! -f "${gcc_lib_dir}/crtendS.o" ]; then
echo "crtbeginS.o or crtendS.o could not be found, ensure the GCC port is installed." echo "crtbeginS.o or crtendS.o could not be found, ensure the GCC port is installed."
@@ -8,7 +8,7 @@ Subject: [PATCH] build: Adjust build process for SerenityOS
1 file changed, 34 insertions(+), 1 deletion(-) 1 file changed, 34 insertions(+), 1 deletion(-)
diff --git a/build b/build diff --git a/build b/build
index f5ec57529f689fe4848592c7a5b35b221a83cf6a..965ce0265515d0c50ec32746962a87f5198c41b2 100755 index f5ec57529f689fe4848592c7a5b35b221a83cf6a..b472795f3f21c3da866822185c1b5a26f878284a 100755
--- a/build --- a/build
+++ b/build +++ b/build
@@ -19,6 +19,7 @@ case $TARGET_OS_CMAKE in @@ -19,6 +19,7 @@ case $TARGET_OS_CMAKE in
@@ -32,7 +32,7 @@ index f5ec57529f689fe4848592c7a5b35b221a83cf6a..965ce0265515d0c50ec32746962a87f5
+crt_dir=$SERENITY_INSTALL_ROOT/usr/lib +crt_dir=$SERENITY_INSTALL_ROOT/usr/lib
+msvc_lib_dir= +msvc_lib_dir=
+kernel32_lib_dir= +kernel32_lib_dir=
+gcc_dir=$SERENITY_INSTALL_ROOT/usr/local/lib/gcc/$SERENITY_ARCH-pc-serenity/$SERENITY_GCC_VERSION +gcc_dir=$SERENITY_INSTALL_ROOT/usr/local/lib/gcc/$SERENITY_ARCH-serenity/$SERENITY_GCC_VERSION
+EOF +EOF
+ +
+export ZIG_LIBC="$ROOTDIR/out/libc_installation.txt" +export ZIG_LIBC="$ROOTDIR/out/libc_installation.txt"
@@ -8,7 +8,7 @@ Subject: [PATCH] build: Remove unsupported zig linker flag -z separate-code
1 file changed, 1 insertion(+) 1 file changed, 1 insertion(+)
diff --git a/build b/build diff --git a/build b/build
index 965ce0265515d0c50ec32746962a87f5198c41b2..980d7d02d11dce3c6684d9a965f6b86b6f041d5f 100755 index b472795f3f21c3da866822185c1b5a26f878284a..e27ffac30d6263d0533d3679186c6ac287ab4d5d 100755
--- a/build --- a/build
+++ b/build +++ b/build
@@ -177,6 +177,7 @@ cmake "$ROOTDIR/llvm" \ @@ -177,6 +177,7 @@ cmake "$ROOTDIR/llvm" \
@@ -11,7 +11,7 @@ patch the version too.
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build b/build diff --git a/build b/build
index 980d7d02d11dce3c6684d9a965f6b86b6f041d5f..d26efcfeab08d2c27c14bbcf4384b1fc8a064415 100755 index e27ffac30d6263d0533d3679186c6ac287ab4d5d..aefa5a7b9bb3bc8fbba73b3bfc6a7cbd8b3f1122 100755
--- a/build --- a/build
+++ b/build +++ b/build
@@ -7,7 +7,7 @@ TARGET="$1" # Example: riscv64-linux-gnu @@ -7,7 +7,7 @@ TARGET="$1" # Example: riscv64-linux-gnu
@@ -66,8 +66,8 @@ static void check_disassembly(ReadonlySpan<NonnullOwnPtr<InstructionImpl>> expec
// Re-generate the machine code with the following commands: // Re-generate the machine code with the following commands:
// //
// cd Tests/LibDisassembly // cd Tests/LibDisassembly
// ../../Toolchain/Local/riscv64/bin/riscv64-pc-serenity-gcc -march=rv64imafd_zicsr_zifencei -fpic -mno-relax -ffreestanding -nostdlib -nostartfiles -mno-csr-check all_riscv_instructions.s -o all_riscv_instructions.elf // ../../Toolchain/Local/riscv64/bin/riscv64-serenity-gcc -march=rv64imafd_zicsr_zifencei -fpic -mno-relax -ffreestanding -nostdlib -nostartfiles -mno-csr-check all_riscv_instructions.s -o all_riscv_instructions.elf
// ../../Toolchain/Local/riscv64/bin/riscv64-pc-serenity-objcopy -O binary -j .text all_riscv_instructions.elf all_riscv_instructions.bin // ../../Toolchain/Local/riscv64/bin/riscv64-serenity-objcopy -O binary -j .text all_riscv_instructions.elf all_riscv_instructions.bin
// xxd -i all_riscv_instructions.bin // xxd -i all_riscv_instructions.bin
TEST_CASE(check_all_instructions) TEST_CASE(check_all_instructions)
{ {
+10 -10
View File
@@ -221,12 +221,12 @@ pushd "$DIR/Build/clang"
pushd llvm pushd llvm
buildstep "llvm/configure" cmake "$DIR/Tarballs/$LLVM_NAME/llvm" \ buildstep "llvm/configure" cmake "$DIR/Tarballs/$LLVM_NAME/llvm" \
-G Ninja \ -G Ninja \
-DSERENITY_x86_64-pc-serenity_SYSROOT="$BUILD/x86_64clang/Root" \ -DSERENITY_x86_64-serenity_SYSROOT="$BUILD/x86_64clang/Root" \
-DSERENITY_aarch64-pc-serenity_SYSROOT="$BUILD/aarch64clang/Root" \ -DSERENITY_aarch64-serenity_SYSROOT="$BUILD/aarch64clang/Root" \
-DSERENITY_riscv64-pc-serenity_SYSROOT="$BUILD/riscv64clang/Root" \ -DSERENITY_riscv64-serenity_SYSROOT="$BUILD/riscv64clang/Root" \
-DSERENITY_x86_64-pc-serenity_STUBS="$DIR/Stubs/x86_64" \ -DSERENITY_x86_64-serenity_STUBS="$DIR/Stubs/x86_64" \
-DSERENITY_aarch64-pc-serenity_STUBS="$DIR/Stubs/aarch64" \ -DSERENITY_aarch64-serenity_STUBS="$DIR/Stubs/aarch64" \
-DSERENITY_riscv64-pc-serenity_STUBS="$DIR/Stubs/riscv64" \ -DSERENITY_riscv64-serenity_STUBS="$DIR/Stubs/riscv64" \
-DCMAKE_INSTALL_PREFIX="$PREFIX" \ -DCMAKE_INSTALL_PREFIX="$PREFIX" \
-C "$DIR/CMake/LLVMConfig.cmake" \ -C "$DIR/CMake/LLVMConfig.cmake" \
${link_lld:+"-DLLVM_ENABLE_LLD=ON"} \ ${link_lld:+"-DLLVM_ENABLE_LLD=ON"} \
@@ -243,9 +243,9 @@ pushd "$DIR/Local/clang/bin/"
ln -s ../../mold/bin/mold ld.mold ln -s ../../mold/bin/mold ld.mold
for arch in $ARCHS; do for arch in $ARCHS; do
ln -s clang "$arch"-pc-serenity-clang ln -s clang "$arch"-serenity-clang
ln -s clang++ "$arch"-pc-serenity-clang++ ln -s clang++ "$arch"-serenity-clang++
ln -s llvm-nm "$arch"-pc-serenity-nm ln -s llvm-nm "$arch"-serenity-nm
echo "--sysroot=$BUILD/${arch}clang/Root" > "$arch"-pc-serenity.cfg echo "--sysroot=$BUILD/${arch}clang/Root" > "$arch"-unknown-serenity.cfg
done done
popd popd
+3 -3
View File
@@ -104,9 +104,9 @@ export PATH="${_DIR}/Local/${SERENITY_ARCH}/bin:${PATH}"
# These environment variables will be used by the EDK II build scripts. # These environment variables will be used by the EDK II build scripts.
export WORKSPACE="$_DIR/Build/edk2" export WORKSPACE="$_DIR/Build/edk2"
export PACKAGES_PATH="$_DIR/Tarballs/edk2:$_DIR/Tarballs/edk2-platforms:$_DIR/Tarballs/edk2-non-osi" export PACKAGES_PATH="$_DIR/Tarballs/edk2:$_DIR/Tarballs/edk2-platforms:$_DIR/Tarballs/edk2-non-osi"
export GCC5_AARCH64_PREFIX=aarch64-pc-serenity- export GCC5_AARCH64_PREFIX=aarch64-serenity-
export GCC5_RISCV64_PREFIX=riscv64-pc-serenity- export GCC5_RISCV64_PREFIX=riscv64-serenity-
export GCC5_X64_PREFIX=x86_64-pc-serenity- export GCC5_X64_PREFIX=x86_64-serenity-
mkdir -p "$WORKSPACE" mkdir -p "$WORKSPACE"
+1 -1
View File
@@ -14,7 +14,7 @@ GDB_PKG="${GDB_NAME}.tar.xz"
GDB_BASE_URL="https://ftpmirror.gnu.org/gnu/gdb" GDB_BASE_URL="https://ftpmirror.gnu.org/gnu/gdb"
ARCH=${1:-"x86_64"} ARCH=${1:-"x86_64"}
TARGET="$ARCH-pc-serenity" TARGET="$ARCH-serenity"
PREFIX="$DIR/Local/$ARCH-gdb" PREFIX="$DIR/Local/$ARCH-gdb"
echo "Building GDB $GDB_VERSION for $TARGET" echo "Building GDB $GDB_VERSION for $TARGET"
+2 -2
View File
@@ -13,7 +13,7 @@ exit_if_running_as_root "Do not run BuildGNU.sh as root, your Build directory wi
echo "$DIR" echo "$DIR"
ARCH=${ARCH:-"x86_64"} ARCH=${ARCH:-"x86_64"}
TARGET="$ARCH-pc-serenity" TARGET="$ARCH-serenity"
PREFIX="$DIR/Local/$ARCH" PREFIX="$DIR/Local/$ARCH"
BUILD="$DIR/../Build/$ARCH" BUILD="$DIR/../Build/$ARCH"
SYSROOT="$BUILD/Root" SYSROOT="$BUILD/Root"
@@ -288,6 +288,6 @@ pushd "$DIR/Build/$ARCH"
popd popd
pushd "$DIR/Local/$ARCH/$ARCH-pc-serenity/bin" pushd "$DIR/Local/$ARCH/$ARCH-serenity/bin"
buildstep "mold_symlink" ln -s ../../../mold/bin/mold ld.mold buildstep "mold_symlink" ln -s ../../../mold/bin/mold ld.mold
popd popd
+3 -3
View File
@@ -19,7 +19,7 @@ PREFIX="$DIR/Local/jakt"
VALID_TOOLCHAINS=() VALID_TOOLCHAINS=()
for ARCH in "${ARCHES[@]}"; do for ARCH in "${ARCHES[@]}"; do
TARGET="$ARCH-pc-serenity" TARGET="$ARCH-serenity"
eval "BUILD_GNU_${ARCH}=\"$DIR/../Build/$ARCH\"" eval "BUILD_GNU_${ARCH}=\"$DIR/../Build/$ARCH\""
eval "BUILD_CLANG_${ARCH}=\"$DIR/../Build/${ARCH}clang\"" eval "BUILD_CLANG_${ARCH}=\"$DIR/../Build/${ARCH}clang\""
@@ -188,8 +188,8 @@ build_for() {
TOOLCHAIN="$1" TOOLCHAIN="$1"
ARCH="$2" ARCH="$2"
TARGET="$ARCH-pc-serenity" TARGET="$ARCH-serenity"
JAKT_TARGET="$TARGET-unknown" JAKT_TARGET="$ARCH-unknown-serenity-unknown"
current_build="BUILD_${TOOLCHAIN}_${ARCH}" current_build="BUILD_${TOOLCHAIN}_${ARCH}"
current_cxx="CXX_${TOOLCHAIN}_${ARCH}" current_cxx="CXX_${TOOLCHAIN}_${ARCH}"
+1 -1
View File
@@ -1,7 +1,7 @@
set(CMAKE_SYSTEM_NAME SerenityOS) set(CMAKE_SYSTEM_NAME SerenityOS)
set(CMAKE_SYSTEM_PROCESSOR "@SERENITY_ARCH@") set(CMAKE_SYSTEM_PROCESSOR "@SERENITY_ARCH@")
set(triple @SERENITY_ARCH@-pc-serenity) set(triple @SERENITY_ARCH@-serenity)
set(TOOLCHAIN_ROOT @SERENITY_SOURCE_DIR@/Toolchain/Local/clang/) set(TOOLCHAIN_ROOT @SERENITY_SOURCE_DIR@/Toolchain/Local/clang/)
set(TOOLCHAIN_PATH ${TOOLCHAIN_ROOT}/bin) set(TOOLCHAIN_PATH ${TOOLCHAIN_ROOT}/bin)
+1 -1
View File
@@ -1,7 +1,7 @@
set(CMAKE_SYSTEM_NAME SerenityOS) set(CMAKE_SYSTEM_NAME SerenityOS)
set(CMAKE_SYSTEM_PROCESSOR "@SERENITY_ARCH@") set(CMAKE_SYSTEM_PROCESSOR "@SERENITY_ARCH@")
set(triple @SERENITY_ARCH@-pc-serenity) set(triple @SERENITY_ARCH@-serenity)
set(TOOLCHAIN_PATH @SERENITY_SOURCE_DIR@/Toolchain/Local/@SERENITY_ARCH@/bin) set(TOOLCHAIN_PATH @SERENITY_SOURCE_DIR@/Toolchain/Local/@SERENITY_ARCH@/bin)
set(TOOLCHAIN_PREFIX ${TOOLCHAIN_PATH}/${triple}-) set(TOOLCHAIN_PREFIX ${TOOLCHAIN_PATH}/${triple}-)
+1 -1
View File
@@ -31,7 +31,7 @@ else()
set(CLANG_ENABLE_CLANGD OFF CACHE BOOL "" FORCE) set(CLANG_ENABLE_CLANGD OFF CACHE BOOL "" FORCE)
endif() endif()
foreach(target x86_64-pc-serenity;aarch64-pc-serenity;riscv64-pc-serenity) foreach(target x86_64-serenity;aarch64-serenity;riscv64-serenity)
list(APPEND targets "${target}") list(APPEND targets "${target}")
set(RUNTIMES_${target}_CMAKE_BUILD_TYPE Release CACHE STRING "") set(RUNTIMES_${target}_CMAKE_BUILD_TYPE Release CACHE STRING "")
@@ -1,6 +1,6 @@
[binaries] [binaries]
c = '@SERENITY_ARCH@-pc-serenity-clang' c = '@SERENITY_ARCH@-serenity-clang'
cpp = '@SERENITY_ARCH@-pc-serenity-clang++' cpp = '@SERENITY_ARCH@-serenity-clang++'
ar = 'llvm-ar' ar = 'llvm-ar'
ranlib = 'llvm-ranlib' ranlib = 'llvm-ranlib'
pkgconfig = 'pkg-config' pkgconfig = 'pkg-config'
+4 -4
View File
@@ -1,8 +1,8 @@
[binaries] [binaries]
c = '@SERENITY_ARCH@-pc-serenity-gcc' c = '@SERENITY_ARCH@-serenity-gcc'
cpp = '@SERENITY_ARCH@-pc-serenity-g++' cpp = '@SERENITY_ARCH@-serenity-g++'
ar = '@SERENITY_ARCH@-pc-serenity-ar' ar = '@SERENITY_ARCH@-serenity-ar'
ranlib = '@SERENITY_ARCH@-pc-serenity-ranlib' ranlib = '@SERENITY_ARCH@-serenity-ranlib'
pkgconfig = 'pkg-config' pkgconfig = 'pkg-config'
[properties] [properties]
+1 -1
View File
@@ -29,7 +29,7 @@ Simple, my friend:
```sh ```sh
touch empty.cpp touch empty.cpp
Toolchain/Local/clang/bin/clang++ --target={arch}-pc-serenity -nostdlib -shared empty.cpp -o empty.so Toolchain/Local/clang/bin/clang++ --target={arch}-serenity -nostdlib -shared empty.cpp -o empty.so
# And optionally, # And optionally,
Toolchain/Local/clang/bin/llvm-strip empty.so Toolchain/Local/clang/bin/llvm-strip empty.so
``` ```