Page 1 of 1

Can't Build ld (OS-Specific Toolchain)

Posted: Sat Mar 13, 2021 2:22 am
by SKC
Hi.
I'm currently trying to create a toolchain for my OS (following the tutorial from the wiki), and making ld fails:

Code: Select all

make[2]: Entering directory '/home/skc/src/build-binutils/ld'
Makefile:1646: *** multiple target patterns.  Stop.
make[2]: Leaving directory '/home/skc/src/build-binutils/ld'
make[1]: *** [Makefile:7213: all-ld] Error 2
make[1]: Leaving directory '/home/skc/src/build-binutils'
make: *** [Makefile:853: all] Error 2
I have no idea why this happens. It looks like the rest of the building process goes fine. I also tried building on Cygwin (my main environment is WSL) but the same thing happened (so it's probably not because I'm using Windows).
What am I doing wrong?
My build script:

Code: Select all

export PREFIX="$HOME/opt/HardOS_Cross"
export TARGET=x86_64-hardos
export PATH="$PREFIX/bin:$PATH"
export SYSROOT="$HOME/HardOS/sysroot"

clear

cd $HOME/src

rm -R -f build-binutils
mkdir build-binutils
cd build-binutils
../binutils-2.36.1/configure --target=$TARGET --prefix=$PREFIX --with-sysroot=$SYSROOT --disable-werror
make # fails here
Thanks in advance to anyone who helps me with this.

Re: Can't Build ld (OS-Specific Toolchain)

Posted: Sat Mar 13, 2021 2:30 am
by kzinti
I am not sure if binutils will be happy with "x86_64-hardos". Try "x86_64-hardos-elf" just for kick. It looks like "x86_64-hardos" is matching multiple targets and binutils doesn't know what to do.

I use "x86_64-rainbow-elf" and have no problems (binutils 2.35).

Re: Can't Build ld (OS-Specific Toolchain)

Posted: Sat Mar 13, 2021 2:47 am
by SKC
Changed it, same result.