Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error on both MacOS and Debian #4

Open
anta40 opened this issue Sep 9, 2023 · 2 comments
Open

Compilation error on both MacOS and Debian #4

anta40 opened this issue Sep 9, 2023 · 2 comments

Comments

@anta40
Copy link

anta40 commented Sep 9, 2023

On MacOS Monterey (with x86_64-elf-gcc installed):

x86_64-elf-gcc -fno-builtin -fno-pic -m32 -nostdinc -Iinclude -O -o out/bootmain.o -g -c kernel/bootmain.c
x86_64-elf-gcc -fno-builtin -fno-pic -m32 -nostdinc -Iinclude -o out/bootasm.o -c kernel/bootasm.S
x86_64-elf-ld -m elf_i386 -nodefaultlibs -N -e start -Ttext 0x7C00 -o out/bootblock.o out/bootasm.o out/bootmain.o
x86_64-elf-ld: Error: unable to disambiguate: -nodefaultlibs (did you mean --nodefaultlibs ?)
make: *** [out/bootblock] Error 1

Modified Makefile:

# Cross-compiling (e.g., on Mac OS X)
# TOOLPREFIX = /opt/cross/bin/x86_64-elf-
TOOLPREFIX=x86_64-elf-

And on Debian 12. Makefile is't modified at all, and already have gcc-multilib installed:

gcc -fno-builtin -fno-pic -m32 -nostdinc -Iinclude -O -o out/bootmain.o -g -c kernel/bootmain.c
gcc -fno-builtin -fno-pic -m32 -nostdinc -Iinclude -o out/bootasm.o -c kernel/bootasm.S
ld -m elf_i386 -nodefaultlibs -N -e start -Ttext 0x7C00 -o out/bootblock.o out/bootasm.o out/bootmain.o
@jwhitehorn
Copy link
Member

To confirm, are you trying to build this natively one your machine? Or are you using the bundled build.sh script? I ask because the toolchain for building this OS is specific versions and built with specific options.

@anta40
Copy link
Author

anta40 commented Aug 30, 2024

Yes, without using docker. Only using make

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants