kosmas12 / kOS

A test operating system made for fun
GNU General Public License v2.0
0 stars 1 forks source link

Error when compiling. #4

Open abdul8117 opened 2 years ago

abdul8117 commented 2 years ago

Full output:

mkdir -p /home/abdul/kOS-test/kOS/sysroot/usr/include cp -R --preserve=timestamps include/. /home/abdul/kOS-test/kOS/sysroot/usr/include/. mkdir -p /home/abdul/kOS-test/kOS/sysroot/usr/include cp -R --preserve=timestamps include/. /home/abdul/kOS-test/kOS/sysroot/usr/include/. mkdir -p /home/abdul/kOS-test/kOS/sysroot/usr/include clang --sysroot=/home/abdul/kOS-test/kOS/sysroot -isystem=/usr/include -MD -c stdio/printf.c -o stdio/printf.libk.o -std=gnu11 -O2 -g -m32 -target i386-none-elf -nostdlib -Wall -Wextra -pedantic -ffreestanding -Wall -Wextra -Dis_libc -Iinclude -D__is_libk cp -R --preserve=timestamps include/. /home/abdul/kOS-test/kOS/sysroot/usr/include/. clang --sysroot=/home/abdul/kOS-test/kOS/sysroot -isystem=/usr/include -MD -c stdio/putchar.c -o stdio/putchar.libk.o -std=gnu11 -O2 -g -m32 -target i386-none-elf -nostdlib -Wall -Wextra -pedantic -ffreestanding -Wall -Wextra -Dis_libc -Iinclude -Dis_libk clang --sysroot=/home/abdul/kOS-test/kOS/sysroot -isystem=/usr/include -MD -c stdio/puts.c -o stdio/puts.libk.o -std=gnu11 -O2 -g -m32 -target i386-none-elf -nostdlib -Wall -Wextra -pedantic -ffreestanding -Wall -Wextra -D__is_libc -Iinclude -Dis_libk clang --sysroot=/home/abdul/kOS-test/kOS/sysroot -isystem=/usr/include -MD -c stdlib/abort.c -o stdlib/abort.libk.o -std=gnu11 -O2 -g -m32 -target i386-none-elf -nostdlib -Wall -Wextra -pedantic -ffreestanding -Wall -Wextra -Dis_libc -Iinclude -D__is_libk clang --sysroot=/home/abdul/kOS-test/kOS/sysroot -isystem=/usr/include -MD -c string/memcmp.c -o string/memcmp.libk.o -std=gnu11 -O2 -g -m32 -target i386-none-elf -nostdlib -Wall -Wextra -pedantic -ffreestanding -Wall -Wextra -Dis_libc -Iinclude -Dis_libk clang --sysroot=/home/abdul/kOS-test/kOS/sysroot -isystem=/usr/include -MD -c string/memcpy.c -o string/memcpy.libk.o -std=gnu11 -O2 -g -m32 -target i386-none-elf -nostdlib -Wall -Wextra -pedantic -ffreestanding -Wall -Wextra -D__is_libc -Iinclude -Dis_libk clang --sysroot=/home/abdul/kOS-test/kOS/sysroot -isystem=/usr/include -MD -c string/memmove.c -o string/memmove.libk.o -std=gnu11 -O2 -g -m32 -target i386-none-elf -nostdlib -Wall -Wextra -pedantic -ffreestanding -Wall -Wextra -Dis_libc -Iinclude -D__is_libk clang --sysroot=/home/abdul/kOS-test/kOS/sysroot -isystem=/usr/include -MD -c string/memset.c -o string/memset.libk.o -std=gnu11 -O2 -g -m32 -target i386-none-elf -nostdlib -Wall -Wextra -pedantic -ffreestanding -Wall -Wextra -Dis_libc -Iinclude -Dis_libk clang --sysroot=/home/abdul/kOS-test/kOS/sysroot -isystem=/usr/include -MD -c string/strlen.c -o string/strlen.libk.o -std=gnu11 -O2 -g -m32 -target i386-none-elf -nostdlib -Wall -Wextra -pedantic -ffreestanding -Wall -Wextra -D__is_libc -Iinclude -Dis_libk ar rcs libk.a stdio/printf.libk.o stdio/putchar.libk.o stdio/puts.libk.o stdlib/abort.libk.o string/memcmp.libk.o string/memcpy.libk.o string/memmove.libk.o string/memset.libk.o string/strlen.libk.o mkdir -p /home/abdul/kOS-test/kOS/sysroot/usr/lib cp libk.a /home/abdul/kOS-test/kOS/sysroot/usr/lib mkdir -p /home/abdul/kOS-test/kOS/sysroot/usr/include clang --sysroot=/home/abdul/kOS-test/kOS/sysroot -isystem=/usr/include -MD -c arch/i386/crti.S -o arch/i386/crti.o -O2 -g -m32 -target i386-none-elf -nostdlib -Wall -Wextra -pedantic -ffreestanding -Wall -Wextra -Dis_kernel -Iinclude clang --sysroot=/home/abdul/kOS-test/kOS/sysroot -isystem=/usr/include -MD -c arch/i386/bootloader.S -o arch/i386/bootloader.o -O2 -g -m32 -target i386-none-elf -nostdlib -Wall -Wextra -pedantic -ffreestanding -Wall -Wextra -D__is_kernel -Iinclude clang --sysroot=/home/abdul/kOS-test/kOS/sysroot -isystem=/usr/include -MD -c -Wall -Wextra -pedantic arch/i386/terminalio.c -o arch/i386/terminalio.o -std=gnu11 -O2 -g -m32 -target i386-none-elf -nostdlib -Wall -Wextra -pedantic -ffreestanding -Wall -Wextra -Dis_kernel -Iinclude cp -R --preserve=timestamps include/. /home/abdul/kOS-test/kOS/sysroot/usr/include/. clang --sysroot=/home/abdul/kOS-test/kOS/sysroot -isystem=/usr/include -MD -c -Wall -Wextra -pedantic kernel/kernel.c -o kernel/kernel.o -std=gnu11 -O2 -g -m32 -target i386-none-elf -nostdlib -Wall -Wextra -pedantic -ffreestanding -Wall -Wextra -Dis_kernel -Iinclude clang --sysroot=/home/abdul/kOS-test/kOS/sysroot -isystem=/usr/include -MD -c -Wall -Wextra -pedantic kernel/gdt/gdt.c -o kernel/gdt/gdt.o -std=gnu11 -O2 -g -m32 -target i386-none-elf -nostdlib -Wall -Wextra -pedantic -ffreestanding -Wall -Wextra -D__is_kernel -Iinclude clang --sysroot=/home/abdul/kOS-test/kOS/sysroot -isystem=/usr/include -MD -c kernel/gdt/gdtflush.S -o kernel/gdt/gdtflush.o -O2 -g -m32 -target i386-none-elf -nostdlib -Wall -Wextra -pedantic -ffreestanding -Wall -Wextra -Dis_kernel -Iinclude clang --sysroot=/home/abdul/kOS-test/kOS/sysroot -isystem=/usr/include -MD -c -Wall -Wextra -pedantic irq/idt.c -o irq/idt.o -std=gnu11 -O2 -g -m32 -target i386-none-elf -nostdlib -Wall -Wextra -pedantic -ffreestanding -Wall -Wextra -Dis_kernel -Iinclude clang --sysroot=/home/abdul/kOS-test/kOS/sysroot -isystem=/usr/include -MD -c irq/loadidt.S -o irq/loadidt.o -O2 -g -m32 -target i386-none-elf -nostdlib -Wall -Wextra -pedantic -ffreestanding -Wall -Wextra -D__is_kernel -Iinclude clang --sysroot=/home/abdul/kOS-test/kOS/sysroot -isystem=/usr/include -MD -c irq/readwriteport.S -o irq/readwriteport.o -O2 -g -m32 -target i386-none-elf -nostdlib -Wall -Wextra -pedantic -ffreestanding -Wall -Wextra -Dis_kernel -Iinclude clang --sysroot=/home/abdul/kOS-test/kOS/sysroot -isystem=/usr/include -MD -c keyboard/kbhandler.S -o keyboard/kbhandler.o -O2 -g -m32 -target i386-none-elf -nostdlib -Wall -Wextra -pedantic -ffreestanding -Wall -Wextra -Dis_kernel -Iinclude clang --sysroot=/home/abdul/kOS-test/kOS/sysroot -isystem=/usr/include -MD -c -Wall -Wextra -pedantic keyboard/keyboard.c -o keyboard/keyboard.o -std=gnu11 -O2 -g -m32 -target i386-none-elf -nostdlib -Wall -Wextra -pedantic -ffreestanding -Wall -Wextra -D__is_kernel -Iinclude clang --sysroot=/home/abdul/kOS-test/kOS/sysroot -isystem=/usr/include -MD -c arch/i386/crtn.S -o arch/i386/crtn.o -O2 -g -m32 -target i386-none-elf -nostdlib -Wall -Wextra -pedantic -ffreestanding -Wall -Wextra -Dis_kernel -Iinclude clang --sysroot=/home/abdul/kOS-test/kOS/sysroot -isystem=/usr/include -Wl,-Tarch/i386/linker.ld -o kOS.bin -O2 -g -m32 -target i386-none-elf -nostdlib -Wall -Wextra -pedantic -ffreestanding -Wall -Wextra arch/i386/crti.o arch/i386/bootloader.o arch/i386/terminalio.o kernel/kernel.o kernel/gdt/gdt.o kernel/gdt/gdtflush.o irq/idt.o irq/loadidt.o irq/readwriteport.o keyboard/kbhandler.o keyboard/keyboard.o -nostdlib -lk arch/i386/crtn.o /usr/bin/ld: cannot find -lk collect2: error: ld returned 1 exit status clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) make: *** [Makefile:60: kOS.bin] Error 1

ExoSkye commented 2 years ago

I'm getting this same error on my host system, I'm now running it in a debian stable docker image (with clang, gcc, build-essential etc) and it builds fine

It might be an issue with the version of clang since my host is clang-12 whilst clang-11 on debian builds it fine

kosmas12 commented 2 years ago

Thank you both for bringing this into my attention, I'll try to look further into this!

ExoSkye commented 2 years ago

I believe that the issue is both to do with that I was using lld and the version issue