Commit 11973a7f authored by Kevin Wolf's avatar Kevin Wolf
Browse files

Buildsystem: libc in src/modules/c dynamisch linken


+ libc: Zusätzlich zur statischen Bibliothek auch eine dynamische bauen

+ modules/c/*: Die libc dynamisch linken
Signed-off-by: Kevin Wolf's avatarKevin Wolf <kevin@tyndur.org>
parent cc75edf9
No related merge requests found
Showing with 56 additions and 6 deletions
+56 -6
......@@ -69,7 +69,11 @@ if [ -d lib ]; then
if [ -f lib/crt0.c ]; then
LIBDIRS="`pwd`/lib/crt0.o $LIBDIRS"
fi
LIBDIRS="`pwd`/lib/library.a $LIBDIRS"
if (grep library.so lib/Makefile.all > /dev/null 2>&1); then
LIBDIRS="`pwd`/lib/library.so $LIBDIRS"
else
LIBDIRS="`pwd`/lib/library.a $LIBDIRS"
fi
fi
if [ -f "user-$LOST_ARCH.ld" ]; then
......@@ -146,7 +150,12 @@ EOF
fi
if [ -f Makefile.all ]; then
echo -e \\tLOST_BUILDMK_ROOT="$LOST_BUILDMK_ROOT" LDSCRIPT="'$LDSCRIPT'" bash Makefile.all '$(BUILD_ROOT)' \'$LIBDIRS $LIB_GCC\' \'$LOST_BUILDMK_ROOT\' >> Makefile
if [ -z "$ENABLE_SHARED" ]; then
LOCAL_LIBDIRS="$(echo "$LIBDIRS" | sed -e 's/\.so/\.a/g')"
else
LOCAL_LIBDIRS="$LIBDIRS"
fi
echo -e \\tLOST_BUILDMK_ROOT="$LOST_BUILDMK_ROOT" LDSCRIPT="'$LDSCRIPT'" bash Makefile.all '$(BUILD_ROOT)' \'$LOCAL_LIBDIRS $LIB_GCC\' \'$LOST_BUILDMK_ROOT\' >> Makefile
fi
cat <<EOF >> Makefile
......@@ -255,7 +264,7 @@ done
cat <<EOF >> Makefile
clean_objs:
rm -f *.o *.a *.mod *.ppu link.res ppas.sh `basename \`pwd\``
rm -f *.o *.a *.so *.mod *.ppu link.res ppas.sh `basename \`pwd\``
softclean: clean_objs
for file in *; do if [ -f "\$\$file/Makefile" -a \( ! -f "\$\$file/.nobuild" -o -f "\$\$file/.ignorenobuild" \) ]; then \$(MAKE) -sC "\$\$file" softclean; fi done
......
export ENABLE_SHARED=1
shopt -s extglob
echo "AR library.a"
source $LOST_BUILDMK_ROOT/config.sh
$LOST_TOOLS_AR rs library.a *.o */*.o */*/*.o
$LOST_TOOLS_AR rs library.a !(weak_stubs).o */*.o */*/*.o
echo "LD library.so"
$LOST_TOOLS_LD -shared -soname=libc -olibrary.so *.o */*.o */*/*.o $LIB_GCC
$LOST_TOOLS_STRIP -s library.so -o $1/system/libc.so
cp *.o ..
cp *.o ..
/*
* Copyright (c) 2017 The tyndur Project. All rights reserved.
*
* This code is derived from software contributed to the tyndur Project
* by Kevin Wolf.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* 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
* vermeiden. */
asm(".global __start_tmslang\n"
"__start_tmslang:\n"
".global __stop_tmslang\n"
"__stop_tmslang:\n");
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