I am having trouble getting the i386-elf binutils configured

I am trying to add the nix packages binutils-unwrapped-all-targets because I need to use the i386-elf-ld linker and the i386-elf-gcc compiler. So I simply add pkgs.binutils-unwrapped-all-targets to my replit.nix but when I reload the shell i get the error error: attribute 'binutils-unwrapped-all-targets' missing, at /home/runner/QEMU/replit.nix:11:3 (use '--show-trace' to show detailed location information)
This does not happen to other packages found on the nix search page https://search.nixos.org/packages?query=
Is the issue with replit, nix or the way I have my project configured? (Probably the way I have it setup because I don’t have a lot of experience with nix)
Here is a link to the repl https://replit.com/@Maaz25/QEMU?v=1
If it is simply a issue that cannot be easily fixed is there any work around such that I can use the i386-elf-ld linker and the i386-elf-gcc compiler?

It looks like you were able to get binutils-unwrapped installed in your replit.nix file successfully. Do you need to use binutils-unwrapped-all-targets in particular?

I find out a way around the issue with gcc -fno-pie -fno-stack-protector -ffreestanding -m32 -march=i386 -g -c “kernel.c” -o “kernel.o” and ld -m elf_i386 -o “full_kernel.bin” -Ttext 0x1000 “kernel_entry.o” “kernel.o” --oformat binary

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.