mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-03 09:48:29 +00:00
Get us closer to building busybox
This change undefines __linux__ and adds APIs like clock_settime(). The gosh darned getopt_long() API has been reintroduced, thanks to OpenBSD.
This commit is contained in:
parent
5ac522f0de
commit
0409096658
52 changed files with 914 additions and 37 deletions
|
@ -72,7 +72,8 @@ PREDEF="-include libc/integral/normalize.inc"
|
|||
CCFLAGS="-fdata-sections -ffunction-sections -fno-pie -mno-tls-direct-seg-refs -mno-red-zone -fportcosmo"
|
||||
CFLAGS=
|
||||
CPPFLAGS="-nostdinc -iquote $COSMO -isystem $COSMOS/include -isystem $COSMO/libc/isystem"
|
||||
LDFLAGS="-static -no-pie -nostdlib -fuse-ld=bfd -Wl,-melf_x86_64 -Wl,--gc-sections -L$COSMOS/lib -Wl,-T,$COSMO/o/$MODE/ape/public/ape.lds $COSMO/o/$MODE/ape/ape-no-modify-self.o $COSMO/o/$MODE/libc/crt/crt.o"
|
||||
LDFLAGS="-static -no-pie -nostdlib -fuse-ld=bfd -Wl,-melf_x86_64"
|
||||
APEFLAGS="-L$COSMOS/lib -Wl,--gc-sections -Wl,-T,$COSMO/o/$MODE/ape/public/ape.lds $COSMO/o/$MODE/ape/ape-no-modify-self.o $COSMO/o/$MODE/libc/crt/crt.o"
|
||||
LDLIBS="$COSMO/o/$MODE/cosmopolitan.a"
|
||||
|
||||
CC="$COSMO/o/third_party/gcc/bin/x86_64-linux-musl-gcc"
|
||||
|
@ -115,6 +116,7 @@ FIRST=1
|
|||
OUTPUT=
|
||||
INTENT=ld
|
||||
NEED_OUTPUT=
|
||||
RELOCATABLE=0
|
||||
FRAME=-fno-omit-frame-pointer
|
||||
for x; do
|
||||
if [ $FIRST -eq 1 ]; then
|
||||
|
@ -133,6 +135,8 @@ for x; do
|
|||
OPT=$x
|
||||
elif [ x"$x" = x"-c" ]; then
|
||||
INTENT=cc
|
||||
elif [ x"$x" = x"-r" ]; then
|
||||
RELOCATABLE=1
|
||||
elif [ x"$x" = x"-E" ]; then
|
||||
INTENT=cpp
|
||||
elif [ x"$x" = x"-o" ]; then
|
||||
|
@ -156,6 +160,10 @@ for x; do
|
|||
set -- "$@" "$x"
|
||||
done
|
||||
|
||||
if [ $RELOCATABLE -eq 1 ]; then
|
||||
APEFLAGS=
|
||||
fi
|
||||
|
||||
if [ x"$MODE" = x"nox87" ]; then
|
||||
CCFLAGS="$CCFLAGS -mlong-double-64"
|
||||
fi
|
||||
|
@ -170,7 +178,8 @@ if [ $INTENT = cpp ]; then
|
|||
elif [ $INTENT = cc ]; then
|
||||
set -- $PLATFORM $PREDEF $CCFLAGS $CFLAGS $CPPFLAGS "$@" $FRAME
|
||||
else
|
||||
set -- $PLATFORM $PREDEF $LDFLAGS $CFLAGS $CPPFLAGS "$@" $LDLIBS -Wl,-z,common-page-size=4096 -Wl,-z,max-page-size=4096 $FRAME
|
||||
set -- $PLATFORM $PREDEF $LDFLAGS $APEFLAGS $CFLAGS $CPPFLAGS "$@" \
|
||||
$LDLIBS -Wl,-z,common-page-size=4096 -Wl,-z,max-page-size=4096 $FRAME
|
||||
fi
|
||||
|
||||
set -- "$CC" "$@"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue