📄 toolchain-flags
字号:
#!/bin/sh## Check whether linker can handle cross-segment @segrel():#CPPFLAGS=""CC=$1OBJDUMP=$2READELF=$3dir=$(dirname $0)tmp=${TMPDIR:-/tmp}out=$tmp/out$$# Check whether cross-segment segment-relative relocs work fine. We need# that for building the gate DSO:$CC -nostdlib -static -Wl,-T$dir/check-segrel.lds $dir/check-segrel.S -o $outres=$($OBJDUMP --full --section .rodata $out | fgrep 000 | cut -f3 -d' ')rm -f $outif [ $res != 00000a00 ]; then CPPFLAGS="$CPPFLAGS -DHAVE_BUGGY_SEGREL" cat >&2 <<EOFwarning: your linker cannot handle cross-segment segment-relative relocations. please upgrade to a newer version (it is safe to use this linker, but the kernel will be bigger than strictly necessary).EOFfi# Check whether .align inside a function works as expected.$CC -c $dir/check-text-align.S -o $out$READELF -u $out | fgrep -q 'prologue(rlen=12)'res=$?rm -f $outif [ $res -eq 0 ]; then CPPFLAGS="$CPPFLAGS -DHAVE_WORKING_TEXT_ALIGN"fiif ! $CC -c $dir/check-model.c -o $out 2>&1 | grep __model__ | grep -q attribthen CPPFLAGS="$CPPFLAGS -DHAVE_MODEL_SMALL_ATTRIBUTE"firm -f $out# Check whether assembler supports .serialize.{data,instruction} directive.$CC -c $dir/check-serialize.S -o $out 2>/dev/nullres=$?rm -f $outif [ $res -eq 0 ]; then CPPFLAGS="$CPPFLAGS -DHAVE_SERIALIZE_DIRECTIVE"fiecho $CPPFLAGS
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -