Skip to content

Compilation error on both MacOS and Debian #4

Description

@anta40

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions