I'm going through the tutorial on making an OS on http://wiki.osdev.org/Bare_Bones. When I try to link boot.o and kernel.o using this command: i686-elf-gcc -T linker.ld -o myos.bin -ffreestanding -O2 -nostdlib boot.o kernel.o -lgcc , I just get this error:
collect2: fatal error: cannot find 'ld'
compilation terminated.
I just installed fresh Ubuntu 15.10 that with gcc-5.2.1 and binutils-2.25.1 . I have searched the internet for answers but nothing helped.
i686-elf-ld
instead. – Sidingi686-elf-ld
command, it says it cannot find command. Any other suggestions? @Katherine It says this: COLLECT_GCC=i686-elf-gcc COLLECT_LTO_WRAPPER=$HOME/opt/cross/libexec/gcc/i686-elf/5.2.0/lto-wrapper Target: i686-elf Configured with: ../gcc-5.2.0/configure --target=i686-elf --prefix=$HOME/opt/cross --disable-nls --enable-languages=c,c++ --without-headers Thread model: single gcc version 5.2.0 (GCC) So, what exactly am I trying to see? – Lita-fuse-ld=bfd
when calling gcc to change to the bfd linker. – LoftPATH
. If you add-debug
flag to the lowestcollect2
invocation, I saw that it was not actually looking for the binaryld
, but instead a bunch of other ld-like names (real-ld
,collect-ld
,ld.lld
, etc.) It just so happens that I wanted to useld.lld
provided in my toolchain, so adding it to the search PATH allowed collect2 to use my toolchain's ld.lld. – Andvari