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

Error: unable to disambiguate: -no-PIE #275

Open
jkanavas opened this issue Jan 26, 2024 · 0 comments
Open

Error: unable to disambiguate: -no-PIE #275

jkanavas opened this issue Jan 26, 2024 · 0 comments

Comments

@jkanavas
Copy link

Linker -no-PIE argument causes error.

MAKEFILE:

all: run

kernel.bin: kernel-entry.o kernel.o
	ld -no-PIE -m elf_i386 -o $@ -Ttext 0x1000 $^ --oformat binary

kernel-entry.o: kernel/kernel-entry.s
	nasm $< -f elf -o $@

kernel.o: kernel/kernel.c
	gcc -ffreestanding -c $< -m32 -fno-PIC -o $@

boot_record.bin: bootloader/boot_record.s
	nasm $< -f bin -o $@

os-image.bin: boot_record.bin kernel.bin
	cat $^ > $@

run: os-image.bin
	qemu-system-i386 -fda $<

clean:
	$(RM) *.bin

OUTPUT:

ld -no-PIE -m elf_i386 -o kernel.bin -Ttext 0x1000 kernel-entry.o kernel.o --oformat binary
ld: Error: unable to disambiguate: -no-PIE (did you mean --no-PIE ?)
make: *** [makefile:4: kernel.bin] Error 1

No, --no-PIE doesn't work either.

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

1 participant