Commit fc61ff20 authored by Kevin Wolf's avatar Kevin Wolf

libc: Vollständige libc.so bauen

* libc: Anstatt wie bisher zwei separate Bibliotheken src/lib/library.a
  und src/modules/lib/library.a zu bauen, wird die Bibliothek aus
  src/lib/ jetzt nicht mehr direkt gegen Programme gelinkt, sondern in
  die library.{a,so} integriert. Damit ist libc.so vollständig genug,
  dass auch lbuilds dagegen linken können.
Signed-off-by: Kevin Wolf's avatarKevin Wolf <kevin@tyndur.org>
parent 1e93fb81
......@@ -62,7 +62,7 @@ if [ -d include ]; then
fi
FPCINCLUDES=`echo $INCLUDES | sed -e 's#-I \?\([^ ]\+\)#-Fi\1#g'`
if [ -d lib ]; then
if [ -d lib ] && [ ! -f lib/.libdirs_ignore ] ; then
if [ -f lib/prt0.asm ]; then
LIBDIRS="`pwd`/lib/prt0.o $LIBDIRS"
fi
......
......@@ -9,5 +9,5 @@ $LOST_TOOLS_OBJCOPY -B i386:i386 -I binary -O elf32-i386 rm_trampoline.o rm_tram
rm rm_trampoline.o
echo "LD $1/kernel/tyndur2"
$LOST_TOOLS_LD -otyndur2.krn -Tkernel.ld header.o --start-group !(header).o */*.o $KERNEL/*.o $KERNEL/*/!(rm_trampoline).o $KERNEL/lostio/*/*.o $2 --end-group
$LOST_TOOLS_LD -otyndur2.krn -Tkernel.ld header.o --start-group !(header).o */*.o $KERNEL/*.o $KERNEL/*/!(rm_trampoline).o $KERNEL/lostio/*/*.o $LOST_BUILDMK_ROOT/src/lib/library.a $2 --end-group
mv tyndur2.krn $1/kernel/tyndur2
......@@ -2,8 +2,8 @@ shopt -s extglob
echo "AR library.a"
source $LOST_BUILDMK_ROOT/config.sh
$LOST_TOOLS_AR rs library.a !(weak_stubs).o */*.o */*/*.o
$LOST_TOOLS_AR rs library.a !(weak_stubs).o */*.o */*/*.o $LOST_BUILDMK_ROOT/src/lib/{*.o,*/*.o,*/*/*.o}
echo "LD library.so"
$LOST_TOOLS_LD -shared -soname=libc -olibrary.so *.o */*.o */*/*.o $LIB_GCC
$LOST_TOOLS_LD -shared -soname=libc -olibrary.so --whole-archive library.a weak_stubs.o --no-whole-archive $LIB_GCC
$LOST_TOOLS_STRIP -s library.so -o $1/system/libc.so
......@@ -26,6 +26,11 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdlib.h>
#include <stdbool.h>
#include <types.h>
#include <errno.h>
/* Diese Funktionen und Variablen sind dazu gedacht, vom Programm überladen
* zu werden. Wir definieren hier leere Stubs, um in Programmen, die die
* entsprechenden Funktionen nicht benutzen, Undefined References zu
......@@ -35,3 +40,32 @@ asm(".global __start_tmslang\n"
"__start_tmslang:\n"
".global __stop_tmslang\n"
"__stop_tmslang:\n");
__attribute__((weak))
vaddr_t loader_allocate_mem(size_t size)
{
abort();
return NULL;
}
__attribute__((weak))
bool loader_assign_mem(pid_t process, vaddr_t dest_address,
vaddr_t src_address, size_t size)
{
abort();
return false;
}
__attribute__((weak))
int loader_get_library(const char* name, void** image, size_t* size)
{
abort();
return -ENOSYS;
}
__attribute__((weak))
bool loader_create_thread(pid_t process, vaddr_t address)
{
abort();
return false;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment