2021-03-02 18:58:11 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Copyright maxcodehack, 2021
|
|
|
|
# ld options for build for KolibriOS
|
|
|
|
|
|
|
|
# We start w/o param?
|
|
|
|
if [ -z "$*" ]
|
|
|
|
then
|
|
|
|
echo "kld: no input files"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# KLIBC variable exists?
|
|
|
|
if [ -z "$KLIBC" ]
|
|
|
|
then
|
|
|
|
echo "kld: KLIBC variable not set"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# LD Flags for KolibriOS
|
|
|
|
FLAGS="-m elf_i386 -nostdlib"
|
|
|
|
|
|
|
|
# And, execute ld:
|
2021-03-04 20:46:14 +01:00
|
|
|
ld $FLAGS -L$KLIBC/lib -T$KLIBC/static.lds $KLIBC/lib/crt0.o $*
|