Can't compile the Meaty Skeleton tutorial (Cygwin)
Can't compile the Meaty Skeleton tutorial (Cygwin)
I am trying to compile the Meaty Skeleton on my cross-compiler.It is failing to compile because it can't find the include files.
I am using a gcc 4.9.2 with a binutils 2.25.0 ,for the target i686-elf.I have downloaded the Meaty Skeleton from the Git repository.
I am compiling this in Windows 8.1.
I suspect that the sysroot option on my compiler is not working properly.
Error log:
$ ./build.sh
make: Entering directory '/cygdrive/c/Users/****/SpartanOS/libc'
mkdir -p /cygdrive/c/Users/****/SpartanOS/sysroot/usr/include
cp -RTv include /cygdrive/c/Users/****/SpartanOS/sysroot/usr/include
«include/stdlib.h» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/stdlib.h»
«include/string.h» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/string.h»
«include/sys/cdefs.h» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/sys/cdefs.h»
«include/stdio.h» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/stdio.h»
«include/Makefile» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/Makefile»
make: Leaving directory '/cygdrive/c/Users/****/SpartanOS/libc'
make: Entering directory '/cygdrive/c/Users/****/SpartanOS/kernel'
mkdir -p /cygdrive/c/Users/****/SpartanOS/sysroot/usr/include
cp -RTv include /cygdrive/c/Users/****/SpartanOS/sysroot/usr/include
«include/kernel/tty.h» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/kernel/tty.h»
«include/kernel/vga.h» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/kernel/vga.h»
make: Leaving directory '/cygdrive/c/Users/****/SpartanOS/kernel'
make: Entering directory '/cygdrive/c/Users/****/SpartanOS/libc'
mkdir -p /cygdrive/c/Users/****/SpartanOS/sysroot/usr/include
cp -RTv include /cygdrive/c/Users/****/SpartanOS/sysroot/usr/include
«include/stdlib.h» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/stdlib.h»
«include/string.h» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/string.h»
«include/sys/cdefs.h» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/sys/cdefs.h»
«include/stdio.h» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/stdio.h»
«include/Makefile» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/Makefile»
i686-elf-gcc --sysroot=/cygdrive/c/Users/****/SpartanOS/sysroot -isystem=/usr/include -c stdio/putchar.c -o stdio/putchar.libk.o -std=gnu11 -O2 -g -Wall -Wextra -ffreestanding -fbuiltin -D__is_myos_libc -Iinclude -D__is_myos_kernel
stdio/putchar.c:4:24: fatal error: kernel/tty.h: No such file or directory
#include <kernel/tty.h>
^
compilation terminated.
Makefile:72: recipe for target 'stdio/putchar.libk.o' failed
make: *** [stdio/putchar.libk.o] Error 1
make: Leaving directory '/cygdrive/c/Users/****/SpartanOS/libc'
Please help me as I do not know what to do to solve this.
I am using a gcc 4.9.2 with a binutils 2.25.0 ,for the target i686-elf.I have downloaded the Meaty Skeleton from the Git repository.
I am compiling this in Windows 8.1.
I suspect that the sysroot option on my compiler is not working properly.
Error log:
$ ./build.sh
make: Entering directory '/cygdrive/c/Users/****/SpartanOS/libc'
mkdir -p /cygdrive/c/Users/****/SpartanOS/sysroot/usr/include
cp -RTv include /cygdrive/c/Users/****/SpartanOS/sysroot/usr/include
«include/stdlib.h» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/stdlib.h»
«include/string.h» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/string.h»
«include/sys/cdefs.h» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/sys/cdefs.h»
«include/stdio.h» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/stdio.h»
«include/Makefile» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/Makefile»
make: Leaving directory '/cygdrive/c/Users/****/SpartanOS/libc'
make: Entering directory '/cygdrive/c/Users/****/SpartanOS/kernel'
mkdir -p /cygdrive/c/Users/****/SpartanOS/sysroot/usr/include
cp -RTv include /cygdrive/c/Users/****/SpartanOS/sysroot/usr/include
«include/kernel/tty.h» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/kernel/tty.h»
«include/kernel/vga.h» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/kernel/vga.h»
make: Leaving directory '/cygdrive/c/Users/****/SpartanOS/kernel'
make: Entering directory '/cygdrive/c/Users/****/SpartanOS/libc'
mkdir -p /cygdrive/c/Users/****/SpartanOS/sysroot/usr/include
cp -RTv include /cygdrive/c/Users/****/SpartanOS/sysroot/usr/include
«include/stdlib.h» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/stdlib.h»
«include/string.h» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/string.h»
«include/sys/cdefs.h» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/sys/cdefs.h»
«include/stdio.h» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/stdio.h»
«include/Makefile» -> «/cygdrive/c/Users/****/SpartanOS/sysroot/usr/include/Makefile»
i686-elf-gcc --sysroot=/cygdrive/c/Users/****/SpartanOS/sysroot -isystem=/usr/include -c stdio/putchar.c -o stdio/putchar.libk.o -std=gnu11 -O2 -g -Wall -Wextra -ffreestanding -fbuiltin -D__is_myos_libc -Iinclude -D__is_myos_kernel
stdio/putchar.c:4:24: fatal error: kernel/tty.h: No such file or directory
#include <kernel/tty.h>
^
compilation terminated.
Makefile:72: recipe for target 'stdio/putchar.libk.o' failed
make: *** [stdio/putchar.libk.o] Error 1
make: Leaving directory '/cygdrive/c/Users/****/SpartanOS/libc'
Please help me as I do not know what to do to solve this.
If some of you people keep insisting on having backwards compatibitity with the stone age, we'll have stone tools forever.
My Hobby OS: https://github.com/heatd/Onyx
My Hobby OS: https://github.com/heatd/Onyx
Re: Can't compile the Meaty Skeleton tutorial
Seems like the include paths are not set properly.
Re: Can't compile the Meaty Skeleton tutorial
Shouldn't the --sysroot and -isystem options work as include paths?
If some of you people keep insisting on having backwards compatibitity with the stone age, we'll have stone tools forever.
My Hobby OS: https://github.com/heatd/Onyx
My Hobby OS: https://github.com/heatd/Onyx
Re: Can't compile the Meaty Skeleton tutorial
Do you have any unexpected spaces or special characters in the path, perhaps?
Re: Can't compile the Meaty Skeleton tutorial
No.I even copied the whole folder to C:/, ran the build script and it still gave me the error.
If some of you people keep insisting on having backwards compatibitity with the stone age, we'll have stone tools forever.
My Hobby OS: https://github.com/heatd/Onyx
My Hobby OS: https://github.com/heatd/Onyx
Re: Can't compile the Meaty Skeleton tutorial
Try pass --verbose to the compiler. Also please use code tags for your logs. Also, unless your identity actually needs to be hidden, please don't censor the output, I can help much better if I get the true data and I know it is the case.
Note: Meaty Skeleton was not designed with cygwin in mind. Any other cygwin users, please try and see if it works for you? But it's not designed to work on Windows, but I did not expect issues like this.
Note: Meaty Skeleton was not designed with cygwin in mind. Any other cygwin users, please try and see if it works for you? But it's not designed to work on Windows, but I did not expect issues like this.
Re: Can't compile the Meaty Skeleton tutorial (Cygwin)
Here is the log with the --verbose option.And thanks for the tips.I am new to the osdev forums
Code: Select all
$ ./build.sh
make: Entering directory '/cygdrive/c/Users/Pedro/SpartanOS/libc'
mkdir -p /cygdrive/c/Users/Pedro/SpartanOS/sysroot/usr/include
cp -RTv include /cygdrive/c/Users/Pedro/SpartanOS/sysroot/usr/include
«include/stdlib.h» -> «/cygdrive/c/Users/Pedro/SpartanOS/sysroot/usr/include/stdlib.h»
«include/string.h» -> «/cygdrive/c/Users/Pedro/SpartanOS/sysroot/usr/include/string.h»
«include/sys/cdefs.h» -> «/cygdrive/c/Users/Pedro/SpartanOS/sysroot/usr/include/sys/cdefs.h»
«include/stdio.h» -> «/cygdrive/c/Users/Pedro/SpartanOS/sysroot/usr/include/stdio.h»
«include/Makefile» -> «/cygdrive/c/Users/Pedro/SpartanOS/sysroot/usr/include/Makefile»
make: Leaving directory '/cygdrive/c/Users/Pedro/SpartanOS/libc'
make: Entering directory '/cygdrive/c/Users/Pedro/SpartanOS/kernel'
Using built-in specs.
COLLECT_GCC=C:\Users\Pedro\Desktop\OSDev\i686-elf\bin\i686-elf-gcc.exe
COLLECT_LTO_WRAPPER=c:/users/pedro/desktop/osdev/i686-elf/bin/../libexec/gcc/i686-elf/4.9.2/lto-wrapper.exe
Using built-in specs.
COLLECT_GCC=C:\Users\Pedro\Desktop\OSDev\i686-elf\bin\i686-elf-gcc.exe
COLLECT_LTO_WRAPPER=c:/users/pedro/desktop/osdev/i686-elf/bin/../libexec/gcc/i686-elf/4.9.2/lto-wrapper.exe
mkdir -p /cygdrive/c/Users/Pedro/SpartanOS/sysroot/usr/include
cp -RTv include /cygdrive/c/Users/Pedro/SpartanOS/sysroot/usr/include
«include/kernel/tty.h» -> «/cygdrive/c/Users/Pedro/SpartanOS/sysroot/usr/include/kernel/tty.h»
«include/kernel/vga.h» -> «/cygdrive/c/Users/Pedro/SpartanOS/sysroot/usr/include/kernel/vga.h»
make: Leaving directory '/cygdrive/c/Users/Pedro/SpartanOS/kernel'
make: Entering directory '/cygdrive/c/Users/Pedro/SpartanOS/libc'
mkdir -p /cygdrive/c/Users/Pedro/SpartanOS/sysroot/usr/include
cp -RTv include /cygdrive/c/Users/Pedro/SpartanOS/sysroot/usr/include
«include/stdlib.h» -> «/cygdrive/c/Users/Pedro/SpartanOS/sysroot/usr/include/stdlib.h»
«include/string.h» -> «/cygdrive/c/Users/Pedro/SpartanOS/sysroot/usr/include/string.h»
«include/sys/cdefs.h» -> «/cygdrive/c/Users/Pedro/SpartanOS/sysroot/usr/include/sys/cdefs.h»
«include/stdio.h» -> «/cygdrive/c/Users/Pedro/SpartanOS/sysroot/usr/include/stdio.h»
«include/Makefile» -> «/cygdrive/c/Users/Pedro/SpartanOS/sysroot/usr/include/Makefile»
i686-elf-gcc --sysroot=/cygdrive/c/Users/Pedro/SpartanOS/sysroot -isystem=/usr/include -c stdio/putchar.c -o stdio/putchar.libk.o -std=gnu11 -O2 -g -Wall -Wextra --verbose -ffreestanding -fbuiltin -D__is_myos_libc -Iinclude -D__is_myos_kernel
Using built-in specs.
COLLECT_GCC=C:\Users\Pedro\Desktop\OSDev\i686-elf\bin\i686-elf-gcc.exe
Target: i686-elf
Configured with: ../gcc-4.9.2/configure --target=i686-elf --prefix=/c/Users/Pedro/Desktop/OSDev/cross-gcc/i686-elf-binutils-2.25.0/bin --disable-nls --enable-languages=c,c++ --without-headers --with-gnu-as=C:/Users/Pedro/Desktop/OSDev/cross-gcc/i686-elf/bin/i686-elf-as.exe --with-gnu-ld=C:/Users/Pedro/Desktop/OSDev/cross-gcc/i686-elf/bin/i686-elf-ld.exe --with-gcc --with-libgcc --disable-werror --disable-target-optspace : (reconfigured) ../gcc-4.9.2/configure --target=i686-elf --prefix=/c/Users/Pedro/Desktop/OSDev/cross-gcc/i686-elf-binutils-2.25.0/bin --disable-nls --enable-languages=c,c++ --without-headers --disable-werror : (reconfigured) ../gcc-4.9.2/configure --target=i686-elf --prefix=/c/Users/Pedro/Desktop/OSDev/i686-elf --disable-nls --enable-languages=c,c++ --without-headers --disable-werror : (reconfigured) ../gcc-4.9.2/configure --target=i686-elf --prefix=/c/Users/Pedro/Desktop/OSDev/i686-elf --disable-nls --enable-languages=c,c++ --without-headers --disable-werror --disable-target-optspace : (reconfigured) ../gcc-4.9.2/configure --target=i686-elf --prefix=/c/Users/Pedro/Desktop/OSDev/i686-elf --disable-nls --enable-languages=c,c++ --without-headers --disable-werror --with-gnu-as=C:/Users/Pedro/Desktop/OSDev/i686-elf/bin/i686-elf-as.exe --with-gnu-ld=C:/Users/Pedro/Desktop/OSDev/i686-elf/bin/i686-elf-ld.exe --with-libgcc --with-sysroot --disable-target-optspace : (reconfigured) ../gcc-4.9.2/configure --target=i686-elf --prefix=/c/Users/Pedro/Desktop/OSDev/i686-elf --disable-nls --enable-languages=c,c++ --without-headers --disable-werror --with-gnu-as=C:/Users/Pedro/Desktop/OSDev/i686-elf/bin/i686-elf-as.exe --with-gnu-ld=C:/Users/Pedro/Desktop/OSDev/i686-elf/bin/i686-elf-ld.exe --with-libgcc --with-sysroot=C:/Users/Pedro/SpartanOS/sysroot/usr/include --disable-target-optspace : (reconfigured) ../gcc-4.9.2/configure --target=i686-elf --prefix=/c/Users/Pedro/Desktop/OSDev/i686-elf --disable-nls --enable-languages=c,c++ --without-headers --disable-werror --with-gnu-as=C:/Users/Pedro/Desktop/OSDev/i686-elf/bin/i686-elf-as.exe --with-gnu-ld=C:/Users/Pedro/Desktop/OSDev/i686-elf/bin/i686-elf-ld.exe --disable-target-optspace
Thread model: single
gcc version 4.9.2 (GCC)
COLLECT_GCC_OPTIONS='-isystem' '=/usr/include' '-c' '-o' 'stdio/putchar.libk.o' '-std=gnu11' '-O2' '-g' '-Wall' '-Wextra' '-v' '-ffreestanding' '-fbuiltin' '-D' '__is_myos_libc' '-I' 'include' '-D' '__is_myos_kernel' '-mtune=generic' '-march=pentiumpro'
c:/users/pedro/desktop/osdev/i686-elf/bin/../libexec/gcc/i686-elf/4.9.2/cc1.exe -quiet -v -I include -iprefix c:\users\pedro\desktop\osdev\i686-elf\bin\../lib/gcc/i686-elf/4.9.2/ -isysroot /cygdrive/c/Users/Pedro/SpartanOS/sysroot -D __is_myos_libc -D __is_myos_kernel -isystem =/usr/include stdio/putchar.c -quiet -dumpbase putchar.c -mtune=generic -march=pentiumpro -auxbase-strip stdio/putchar.libk.o -g -O2 -Wall -Wextra -std=gnu11 -version -ffreestanding -fbuiltin -o C:\Cygwin32\tmp\ccVZOPg0.s
GNU C (GCC) version 4.9.2 (i686-elf)
compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version 3.1.2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/cygdrive/c/Users/Pedro/SpartanOS/sysroot/usr/include"
ignoring nonexistent directory "c:\users\pedro\desktop\osdev\i686-elf\bin\../lib/gcc/i686-elf/4.9.2/../../../../i686-elf/include"
ignoring duplicate directory "c:/Users/Pedro/Desktop/OSDev/i686-elf/lib/gcc/../../lib/gcc/i686-elf/4.9.2/include"
ignoring nonexistent directory "/cygdrive/c/Users/Pedro/SpartanOS/sysrootc:/Users/Pedro/Desktop/OSDev/i686-elf/lib/gcc/i686-elf/4.9.2/../../../../include"
ignoring duplicate directory "c:/Users/Pedro/Desktop/OSDev/i686-elf/lib/gcc/../../lib/gcc/i686-elf/4.9.2/include-fixed"
ignoring nonexistent directory "c:/Users/Pedro/Desktop/OSDev/i686-elf/lib/gcc/../../lib/gcc/i686-elf/4.9.2/../../../../i686-elf/include"
ignoring nonexistent directory "/cygdrive/c/Users/Pedro/SpartanOS/sysrootC:/MinGW/msys/1.0/include"
#include "..." search starts here:
#include <...> search starts here:
include
c:\users\pedro\desktop\osdev\i686-elf\bin\../lib/gcc/i686-elf/4.9.2/include
c:\users\pedro\desktop\osdev\i686-elf\bin\../lib/gcc/i686-elf/4.9.2/include-fixed
End of search list.
GNU C (GCC) version 4.9.2 (i686-elf)
compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version 3.1.2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: ae65586f6fcaf73aac628afe58d22baf
stdio/putchar.c:4:24: fatal error: kernel/tty.h: No such file or directory
#include <kernel/tty.h>
^
compilation terminated.
Makefile:72: recipe for target 'stdio/putchar.libk.o' failed
make: *** [stdio/putchar.libk.o] Error 1
make: Leaving directory '/cygdrive/c/Users/Pedro/SpartanOS/libc'
If some of you people keep insisting on having backwards compatibitity with the stone age, we'll have stone tools forever.
My Hobby OS: https://github.com/heatd/Onyx
My Hobby OS: https://github.com/heatd/Onyx
Re: Can't compile the Meaty Skeleton tutorial (Cygwin)
I think your include paths were not set properly when you ran the compiler.
I recommend that you try adding something like '-I include/' based on where your "kernel" header directory (where "tty.h" is inside) is located.
hope that's helpful.
I recommend that you try adding something like '-I include/' based on where your "kernel" header directory (where "tty.h" is inside) is located.
When you use the "<>" brackets in the '#include' directive, gcc looks through the include paths, and since it is unable to find 'kernel/tty.h' in the include paths, you should add it.stdio/putchar.c:4:24: fatal error: kernel/tty.h: No such file or directory
#include <kernel/tty.h>
^
compilation terminated.
Makefile:72: recipe for target 'stdio/putchar.libk.o' failed
make: *** [stdio/putchar.libk.o] Error 1
hope that's helpful.
Joonyoung Lee
Student at 한성과학고등학교(Hansung Science High School) & Ambitious OSDever
Arcrascent OS | Source <-- My OSDev Project
“One of my most productive days was throwing away 1000 lines of code.” - Ken Thompson
Student at 한성과학고등학교(Hansung Science High School) & Ambitious OSDever
Arcrascent OS | Source <-- My OSDev Project
“One of my most productive days was throwing away 1000 lines of code.” - Ken Thompson
Re: Can't compile the Meaty Skeleton tutorial (Cygwin)
Thanks! It worked. But i think that the problem was in here:
The second path is for some reason mixed with the first path.
Code: Select all
ignoring nonexistent directory"c:/Users/Pedro/SpartanOS/sysrootC:/MinGW/msys/1.0/include"
If some of you people keep insisting on having backwards compatibitity with the stone age, we'll have stone tools forever.
My Hobby OS: https://github.com/heatd/Onyx
My Hobby OS: https://github.com/heatd/Onyx
Re: Can't compile the Meaty Skeleton tutorial (Cygwin)
I'm more worried about:
But the output above claims it does exist. I think the problem is that your GCC doesn't like /cygdrive paths somehow.
It also tried to look for C:/MinGW/msys/1.0/include inside the sysroot, which doesn't make sense. Perhaps your cross-compiler somehow targets cygwin partially? Or perhaps that path came from the environment (see C_INCLUDE_PATH and such) in a weird way?
Code: Select all
ignoring nonexistent directory "/cygdrive/c/Users/Pedro/SpartanOS/sysroot/usr/include"
It also tried to look for C:/MinGW/msys/1.0/include inside the sysroot, which doesn't make sense. Perhaps your cross-compiler somehow targets cygwin partially? Or perhaps that path came from the environment (see C_INCLUDE_PATH and such) in a weird way?