Compile Error
TheWeirdDev opened this issue ยท 9 comments
I get this error too, when building on my laptop but not when building on my main computer.
I'm not sure why it happens, but I'm trying to fix it.
Update: it seems the problem is in fact the cross-compiler on the AUR. Funnily enough, the reason it was successfully building on my main computer is because on my main computer I had a different cross-compiler in my $PATH, which I'd forgotten about. It should be fixed soon
Whoops - didn't mean to close it yet
@alireza6677 I was right about the problem. To get it to build properly you need to use a different cross-compiler, I'd suggest this toolchain. I've updated the README to reflect this. Thanks for the issue - I had the same problem on my laptop, but it's good to know it wasn't a problem with that alone.
@j4cobgarby I can confirm that this compiler works well. Thanks for helping out.
@j4cobgarby Actually in ArchLinux you can compile it with the default gcc
package, using -m32
flag.
@alireza6677 no problem :)
And is that right? I had no idea that would work, I wonder if that works on other platforms too. I'll add that to the README in my next push
I think the ArchLinux packagers merged the two gcc
and gcc-multilib
packages into a single package a few months ago, that might be the reason it works. On the other distributions it might not work.
Also i tried to compile the latest changes with the default gcc and it gave me this error:
kern.c:(.text+0x86): undefined reference to `__stack_chk_fail_local'
/usr/bin/ld: dist/kern.elf: hidden symbol `__stack_chk_fail_local' isn't defined
/usr/bin/ld: final link failed: Bad value
adding -fno-stack-protector
flag solved the problem but i don't know what was causing it.
The other cross compiler worked well without showing any errors.
@alireza6677 ah, okay. It'll probably be best to stick with i686-elf-gcc, then :)