diff options
| -rw-r--r-- | files/aleksa-gcc-11.2.0.diff | 67 | ||||
| -rw-r--r-- | files/crt0.s | 31 | ||||
| -rwxr-xr-x | setup.sh | 59 |
3 files changed, 72 insertions, 85 deletions
diff --git a/files/aleksa-gcc-11.2.0.diff b/files/aleksa-gcc-11.2.0.diff index 3373721..fbbedbb 100644 --- a/files/aleksa-gcc-11.2.0.diff +++ b/files/aleksa-gcc-11.2.0.diff @@ -1,6 +1,19 @@ -diff '--color=auto' -ruN ../../gcc-11.2.0/fixincludes/mkfixinc.sh ./gcc-11.2.0/fixincludes/mkfixinc.sh ---- ../../gcc-11.2.0/fixincludes/mkfixinc.sh 2021-07-28 08:55:06.644278372 +0200 -+++ ./gcc-11.2.0/fixincludes/mkfixinc.sh 2022-01-11 18:37:07.379567018 +0100 +diff '--color=auto' -ruN ../gcc-11.2.0/config.sub gcc-11.2.0/config.sub +--- ../gcc-11.2.0/config.sub 2021-07-28 08:55:06.620278039 +0200 ++++ gcc-11.2.0/config.sub 2022-01-21 22:02:55.149012099 +0100 +@@ -1725,7 +1725,8 @@ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ +- | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx*) ++ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* \ ++ | aleksa*) + ;; + # This one is extra strict with allowed versions + sco3.2v2 | sco3.2v[4-9]* | sco5v6*) +diff '--color=auto' -ruN ../gcc-11.2.0/fixincludes/mkfixinc.sh gcc-11.2.0/fixincludes/mkfixinc.sh +--- ../gcc-11.2.0/fixincludes/mkfixinc.sh 2021-07-28 08:55:06.644278372 +0200 ++++ gcc-11.2.0/fixincludes/mkfixinc.sh 2022-01-21 22:02:55.145678766 +0100 @@ -11,6 +11,7 @@ # Check for special fix rules for particular targets @@ -9,9 +22,9 @@ diff '--color=auto' -ruN ../../gcc-11.2.0/fixincludes/mkfixinc.sh ./gcc-11.2.0/f i?86-*-cygwin* | \ i?86-*-mingw32* | \ x86_64-*-mingw32* | \ -diff '--color=auto' -ruN ../../gcc-11.2.0/gcc/config/aleksa.h ./gcc-11.2.0/gcc/config/aleksa.h ---- ../../gcc-11.2.0/gcc/config/aleksa.h 1970-01-01 01:00:00.000000000 +0100 -+++ ./gcc-11.2.0/gcc/config/aleksa.h 2022-01-11 18:31:15.382909005 +0100 +diff '--color=auto' -ruN ../gcc-11.2.0/gcc/config/aleksa.h gcc-11.2.0/gcc/config/aleksa.h +--- ../gcc-11.2.0/gcc/config/aleksa.h 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-11.2.0/gcc/config/aleksa.h 2022-01-21 22:02:55.145678766 +0100 @@ -0,0 +1,28 @@ +/* Useful if you wish to make target-specific GCC changes. */ +#undef TARGET_ALEKSA @@ -41,9 +54,9 @@ diff '--color=auto' -ruN ../../gcc-11.2.0/gcc/config/aleksa.h ./gcc-11.2.0/gcc/c + builtin_assert ("system=unix"); \ + builtin_assert ("system=posix"); \ + } while(0); -diff '--color=auto' -ruN ../../gcc-11.2.0/gcc/config.gcc ./gcc-11.2.0/gcc/config.gcc ---- ../../gcc-11.2.0/gcc/config.gcc 2021-07-28 08:55:07.000283339 +0200 -+++ ./gcc-11.2.0/gcc/config.gcc 2022-01-11 18:30:02.532910796 +0100 +diff '--color=auto' -ruN ../gcc-11.2.0/gcc/config.gcc gcc-11.2.0/gcc/config.gcc +--- ../gcc-11.2.0/gcc/config.gcc 2021-07-28 08:55:07.000283339 +0200 ++++ gcc-11.2.0/gcc/config.gcc 2022-01-21 22:02:55.149012099 +0100 @@ -686,6 +686,12 @@ # Common parts for widely ported systems. @@ -70,9 +83,9 @@ diff '--color=auto' -ruN ../../gcc-11.2.0/gcc/config.gcc ./gcc-11.2.0/gcc/config aarch64*-*-elf | aarch64*-*-fuchsia* | aarch64*-*-rtems*) tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h" tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-elf-raw.h" -diff '--color=auto' -ruN ../../gcc-11.2.0/libgcc/config.host ./gcc-11.2.0/libgcc/config.host ---- ../../gcc-11.2.0/libgcc/config.host 2021-07-28 08:55:08.752307785 +0200 -+++ ./gcc-11.2.0/libgcc/config.host 2022-01-11 18:33:33.522905613 +0100 +diff '--color=auto' -ruN ../gcc-11.2.0/libgcc/config.host gcc-11.2.0/libgcc/config.host +--- ../gcc-11.2.0/libgcc/config.host 2021-07-28 08:55:08.752307785 +0200 ++++ gcc-11.2.0/libgcc/config.host 2022-01-21 22:02:55.149012099 +0100 @@ -356,6 +356,14 @@ esac @@ -88,9 +101,20 @@ diff '--color=auto' -ruN ../../gcc-11.2.0/libgcc/config.host ./gcc-11.2.0/libgcc aarch64*-*-elf | aarch64*-*-rtems*) extra_parts="$extra_parts crtbegin.o crtend.o crti.o crtn.o" extra_parts="$extra_parts crtfastmath.o" -diff '--color=auto' -ruN ../../gcc-11.2.0/libstdc++-v3/crossconfig.m4 ./gcc-11.2.0/libstdc++-v3/crossconfig.m4 ---- ../../gcc-11.2.0/libstdc++-v3/crossconfig.m4 2021-07-28 08:55:09.228314429 +0200 -+++ ./gcc-11.2.0/libstdc++-v3/crossconfig.m4 2022-01-11 18:32:31.719573793 +0100 +diff '--color=auto' -ruN ../gcc-11.2.0/libgcc/libgcov.h gcc-11.2.0/libgcc/libgcov.h +--- ../gcc-11.2.0/libgcc/libgcov.h 2021-07-28 08:55:08.812308622 +0200 ++++ gcc-11.2.0/libgcc/libgcov.h 2022-01-21 22:03:55.409011142 +0100 +@@ -183,6 +183,7 @@ + #endif + + #include "gcov-io.h" ++#include <stdint.h> + + /* Structures embedded in coveraged program. The structures generated + by write_profile must match these. */ +diff '--color=auto' -ruN ../gcc-11.2.0/libstdc++-v3/crossconfig.m4 gcc-11.2.0/libstdc++-v3/crossconfig.m4 +--- ../gcc-11.2.0/libstdc++-v3/crossconfig.m4 2021-07-28 08:55:09.228314429 +0200 ++++ gcc-11.2.0/libstdc++-v3/crossconfig.m4 2022-01-21 22:02:55.149012099 +0100 @@ -5,6 +5,12 @@ AC_DEFUN([GLIBCXX_CROSSCONFIG],[ # Base decisions on target environment. @@ -104,16 +128,3 @@ diff '--color=auto' -ruN ../../gcc-11.2.0/libstdc++-v3/crossconfig.m4 ./gcc-11.2 arm*-*-symbianelf*) # This is a freestanding configuration; there is nothing to do here. ;; -diff '--color=auto' -ruN ../../gcc-11.2.0/config.sub ./gcc-11.2.0/config.sub ---- ../../gcc-11.2.0/config.sub 2021-07-28 08:55:06.620278039 +0200 -+++ ./gcc-11.2.0/config.sub 2022-01-11 18:41:19.216227511 +0100 -@@ -1725,7 +1725,8 @@ - | skyos* | haiku* | rdos* | toppers* | drops* | es* \ - | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ - | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ -- | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx*) -+ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* \ -+ | aleksa*) - ;; - # This one is extra strict with allowed versions - sco3.2v2 | sco3.2v[4-9]* | sco5v6*) diff --git a/files/crt0.s b/files/crt0.s deleted file mode 100644 index 8c735f1..0000000 --- a/files/crt0.s +++ /dev/null @@ -1,31 +0,0 @@ -.section .text - -.global _start -_start: - # Set up end of the stack frame linked list. - movl $0, %ebp - pushl %ebp # rip=0 - pushl %ebp # rbp=0 - movl %esp, %ebp - - # We need those in a moment when we call main. - pushl %esi - pushl %edi - - # Prepare signals, memory allocation, stdio and such. -# call initialize_standard_library - - # Run the global constructors. - call _init - - # Restore argc and argv. - popl %edi - popl %esi - - # Run main - call main - - # Terminate the process with the exit code. - movl %eax, %edi -# call exit -.size _start, . - _start @@ -19,34 +19,34 @@ download() extract() { - if [ ! -d "./$BINUTILS" ]; then - tar xzvf "./$BINUTILS.tar.gz" + if [ ! -d "$BINUTILS" ]; then + tar xzvf "$BINUTILS.tar.gz" fi - if [ ! -d "./$GCC" ]; then - tar xzvf "./$GCC.tar.gz" + if [ ! -d "$GCC" ]; then + tar xzvf "$GCC.tar.gz" fi } patch_gnu() { - mkdir -p "./mine" - cd "./mine" || exit + mkdir -p "mine" + cd "mine" || exit - if [ ! -d "./$BINUTILS" ]; then - cp -r "../$BINUTILS" . + if [ ! -d "$BINUTILS" ]; then + cp -rv "../$BINUTILS" . patch -p0 < "../files/aleksa-$BINUTILS.diff" - cd "./$BINUTILS/ld" || exit + cd "$BINUTILS/ld" || exit sed -i "s/2.69/2.71/" "Makefile.am" aclocal automake cd "../.." fi - if [ ! -d "./$GCC" ]; then - cp -r "../$GCC" . + if [ ! -d "$GCC" ]; then + cp -rv "../$GCC" . patch -p0 < "../files/aleksa-$GCC.diff" - cd "./$GCC/libstdc++-v3" || exit + cd "$GCC/libstdc++-v3" || exit sed -i "s/2.69/2.71/" "../config/override.m4" autoreconf cd "../.." @@ -57,8 +57,12 @@ patch_gnu() install_headers() { - if [ ! -d "mykernel" ]; then - git clone https://github.com/aleksav013/mykernel + if [ -d "mykernel" ]; then + cd "mykernel" || exit + git pull + cd ".." + else + git clone "https://github.com/aleksav013/mykernel" fi cd "mykernel" || exit @@ -102,23 +106,26 @@ build_gcc() --enable-languages=c,c++ fi - make -j4 all-gcc - make -j4 all-target-libgcc - + make -j4 all-gcc all-target-libgcc make -k check || true - - make install-gcc - make install-target-libgcc + make install-gcc install-target-libgcc cd "../../.." } -additions() +setup_compiler() { - GCC_INCLUDE=$(i686-aleksa-gcc --print-file-name=) + if [ -d "mykernel" ]; then + cd "mykernel" || exit + git pull + cd ".." + else + git clone "https://github.com/aleksav013/mykernel" + fi - i686-aleksa-as files/crt0.s -o "$GCC_INCLUDE/crt0.o" - touch "$GCC_INCLUDE/libc.a" + cd "mykernel" || exit + ./scripts/setup_compiler.sh + cd ".." } main() @@ -126,10 +133,10 @@ main() download extract patch_gnu - install_headers build_binutils + install_headers build_gcc - additions + setup_compiler } main |
