Update kernel recipe for GS segment TLS

This commit is contained in:
Jeremy Soller 2021-02-28 09:53:10 -07:00
parent 4c52a95cec
commit 86ed70defd
No known key found for this signature in database
GPG Key ID: E988B49EE78A7FB1
3 changed files with 23 additions and 3 deletions

View File

@ -6,8 +6,9 @@ randd
vesad T T G
stdio display:1
ps2d us
ramfs logging
pcid /etc/pcid/initfs.toml
redoxfs --uuid $REDOXFS_UUID file
redoxfs --uuid $REDOXFS_UUID file $REDOXFS_BLOCK
cd file:
export PATH file:/bin
run.d /etc/init.d

17
recipes/kernel/kernel_ld.sh Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -ex
LD="$1"
shift
if "${LD}" -z use-gs-for-tls 2>&1 |
grep "warning: -z use-gs-for-tls ignored" &> /dev/null
then
echo "Please update your prefix:" >&2
echo " rm -rf prefix" >&2
echo " make prefix" >&2
exit 1
fi
exec "${LD}" -z use-gs-for-tls "$@"

View File

@ -5,15 +5,17 @@ function recipe_build {
export INITFS_FOLDER="$(realpath ../sysroot)"
mkdir -pv "$INITFS_FOLDER/etc"
cp -v "$(realpath ../init.rc)" "$INITFS_FOLDER/etc/init.rc"
xargo rustc \
cargo rustc \
--lib \
--target "${ARCH}-unknown-none" \
--release \
-Z build-std=core,alloc \
-- \
-C soft-float \
-C debuginfo=2 \
-C lto \
--emit link=libkernel.a
"${LD}" \
../kernel_ld.sh "${LD}" \
--gc-sections \
-z max-page-size=0x1000 \
-T "linkers/${ARCH}.ld" \