Can't build kernel on one computer, but can on another.
Posted: Sun Jan 28, 2018 10:04 am
I have a main desktop computer, and an laptop. They're both running the exact same operating system (manjaro linux), and I have the exact same cross compiler installed (i686-elf-gcc, from the AUR).
My problem only occurs when building on my laptop.
My makefile runs a few commands to compile my kernel. It first assembles the main assembly, which works fine.
It then tries to compile the main C file, with the following command:
For some reason, this doesn't work, and throws the following error:
First of all, I'm not really sure why these are assembler messages. I know that somewhere down the line my C code will be assembled, but it seems odd to me.
It also seems weird that it compiles fine on my main computer, but not my laptop.
I can provide the source files if necessary, but it's difficult to find a relevant piece of code. The entire source is available at https://github.com/j4cobgarby/atomic-kernel, if that helps.
My problem only occurs when building on my laptop.
My makefile runs a few commands to compile my kernel. It first assembles the main assembly, which works fine.
It then tries to compile the main C file, with the following command:
Code: Select all
i686-elf-gcc -c kern.c -o build/kern.o -std=gnu99 -ffreestanding -O2 -Wall -Wextra
Code: Select all
/tmp/ccLtKHxr.s: Assembler messages:
/tmp/ccLtKHxr.s:52: Error: invalid instruction suffix for `push'
/tmp/ccLtKHxr.s:55: Error: invalid instruction suffix for `push'
/tmp/ccLtKHxr.s:57: Error: register save offset not a multiple of 8
/tmp/ccLtKHxr.s:74: Error: invalid instruction suffix for `pop'
/tmp/ccLtKHxr.s:78: Error: invalid instruction suffix for `pop'
/tmp/ccLtKHxr.s:99: Error: invalid instruction suffix for `push'
/tmp/ccLtKHxr.s:102: Error: invalid instruction suffix for `push'
/tmp/ccLtKHxr.s:104: Error: register save offset not a multiple of 8
/tmp/ccLtKHxr.s:185: Error: invalid instruction suffix for `push'
/tmp/ccLtKHxr.s:194: Error: invalid instruction suffix for `pop'
/tmp/ccLtKHxr.s:197: Error: invalid instruction suffix for `pop'
make: *** [Makefile:4: all] Error 1
It also seems weird that it compiles fine on my main computer, but not my laptop.
I can provide the source files if necessary, but it's difficult to find a relevant piece of code. The entire source is available at https://github.com/j4cobgarby/atomic-kernel, if that helps.