clarify the purpose of this project
[nyanglibc.git] / make / csu.sh
blob660a27af546846f90b155eb315b970f222978406
1 printf "\
2 CSU*****************************************************************************\n"
3 # ../sysdeps/unix/sysv/linux/x86_64/sysdep.S is empty
4 pie_shared_fns="\
5 check_fds \
6 init-first \
7 dso_handle \
8 errno \
9 errno-loc \
10 gmon-start \
11 libc-start \
12 start \
13 static-reloc \
14 version \
15 sysdep \
17 pie_fns="\
18 $pie_shared_fns \
19 abi-note \
20 crti \
21 crtn \
22 elf-init \
23 init \
24 libc-tls \
26 shared_fns="\
27 $pie_shared_fns \
28 unwind-resume \
30 nonshared_fns="\
31 elf-init \
33 mkdir -p $build_dir/csu
34 for fn in $pie_fns
36 printf "ASSEMBLING PIE $fn\n"
37 $as $src_dir/csu/$fn.s -o $build_dir/csu/$fn.o
38 done
39 for fn in $shared_fns
41 printf "ASSEMBLING SHARED $fn\n"
42 $as $src_dir/csu/$fn.shared.s -o $build_dir/csu/$fn.os
43 done
44 for fn in $nonshared_fns
46 printf "ASSEMBLING NONSHARED $fn\n"
47 $as $src_dir/csu/$fn.nonshared.s -o $build_dir/csu/$fn.oS
48 done
49 #-------------------------------------------------------------------------------
50 printf "LD LINKING crt1.o\n"
51 # we remove eh
52 $ld -m elf_x86_64 \
53 --dynamic-linker=/lib64/ld-linux-x86-64.so.2 \
54 -o $build_dir/csu/crt1.o \
55 -r \
56 $build_dir/csu/start.o \
57 $build_dir/csu/abi-note.o \
58 $build_dir/csu/init.o \
59 $build_dir/csu/static-reloc.o
60 #-------------------------------------------------------------------------------
61 printf "LD LINKING Scrt1.o\n"
62 # we remove eh
63 $ld -m elf_x86_64 \
64 --dynamic-linker=/lib64/ld-linux-x86-64.so.2 \
65 -o $build_dir/csu/Scrt1.o \
66 -r \
67 $build_dir/csu/start.os \
68 $build_dir/csu/abi-note.o \
69 $build_dir/csu/init.o
70 #-------------------------------------------------------------------------------
71 printf "LD LINKING rcrt1.o\n"
72 # we remove eh
73 $ld -m elf_x86_64 \
74 --dynamic-linker=/lib64/ld-linux-x86-64.so.2 \
75 -o $build_dir/csu/rcrt1.o \
76 -r \
77 $build_dir/csu/start.o \
78 $build_dir/csu/abi-note.o \
79 $build_dir/csu/init.o
80 #-------------------------------------------------------------------------------
81 # Mcrt1.o is "null"
82 printf ".text\n" | $as --64 -o $build_dir/csu/Mcrt1.o -
83 #-------------------------------------------------------------------------------
84 printf 'LD LINKING gcrt1.o\n'
85 $ld -m elf_x86_64 \
86 --dynamic-linker=/lib64/ld-linux-x86-64.so.2 \
87 -r \
88 -o $build_dir/csu/gcrt1.o \
89 $build_dir/csu/Scrt1.o \
90 $build_dir/csu/gmon-start.os \
91 $build_dir/csu/static-reloc.os
92 #-------------------------------------------------------------------------------
93 printf 'LD LINKING grctr1.o\n'
94 $ld -m elf_x86_64 \
95 --dynamic-linker=/lib64/ld-linux-x86-64.so.2 \
96 -o $build_dir/csu/grcrt1.o \
97 -r \
98 $build_dir/csu/rcrt1.o \
99 $build_dir/csu/gmon-start.o
100 #-------------------------------------------------------------------------------
101 printf 'CREATING LIBC csu/stamp.o\n'
102 printf 'csu/init-first.o csu/libc-start.o csu/sysdep.o csu/version.o csu/check_fds.o csu/libc-tls.o csu/elf-init.o csu/dso_handle.o csu/errno.o csu/errno-loc.o\n' > $build_dir/csu/stamp.o
103 #-------------------------------------------------------------------------------
104 printf 'CREATING LIBC csu/stamp.os\n'
105 printf 'csu/init-first.os csu/libc-start.os csu/sysdep.os csu/version.os csu/check_fds.os csu/dso_handle.os csu/unwind-resume.os csu/errno.os csu/errno-loc.os\n' > $build_dir/csu/stamp.os
106 #-------------------------------------------------------------------------------
107 printf 'CREATING LIBC csu/stamp.oS\n'
108 printf 'csu/elf-init.oS\n' > $build_dir/csu/stamp.oS