Hello everybody
Today I'm trying to build a i486-linux-musl toolchain using
Portable C Compiler instead of GCC.
Here are the steps that I've made in that precise order:
replace
${PREFIX} with
/home/michele/cross and
${TRIPLE} with
i486-linux-musl
CREATE DIRECTORIES
Code:
mkdir -p ${PREFIX}/${TRIPLE}
ln -s . ${PREFIX}/${TRIPLE}/usr
CONFIGURE ENVIRONMENT
Code:
export PATH=${PREFIX}/bin:$PATH
LINUX HEADERS
Code:
make mrproper
ARCH=i386 make headers_check
ARCH=i386 make INSTALL_HDR_PATH=${PREFIX}/${TRIPLE} headers_install
BINUTILS
Configure:
Code:
../configure --prefix=${PREFIX} --target=${TRIPLE} --disable-nls \
--disable-shared --disable-multilib
Install it:
Code:
make configure-host
make
make install
PCC
Code:
./configure --target=${TRIPLE} --prefix=${PREFIX}
make
make install
PCC-LIBS
Code:
./configure --target=${TRIPLE} --prefix=${PREFIX}
make
make install
MUSL LIBC
Code:
CC=${TRIPLE}-pcc ./configure --target=${TRIPLE} --prefix=${PREFIX} --disable-shared \
--disable-debug
make && make install
Now when I try to compile "Hello World" it gives me this herror. Do you know how could I fix that? Do you need other informations?
Code:
/home/michele/cross/i486-linux-musl/lib/crt1.o: In function `_start':
crt1.c:(.text+0x11): undefined reference to `_DYNAMIC'
/home/michele/cross/i486-linux-musl/lib//libc.a(__init_tls.o): In function `static_init_tls':
__init_tls.c:(.text+0x123): undefined reference to `_DYNAMIC'
__init_tls.c:(.text+0x12a): undefined reference to `_DYNAMIC'
i486-linux-musl-ld: a.out: hidden symbol `_DYNAMIC' isn't defined
i486-linux-musl-ld: final link failed: Bad value
error: i486-linux-musl-ld terminated with status 1
Some web pages that might help
I'm using:
- pcc-20180523
- pcc-libs-20180523
- linux-4.4.21
- binutils-2.27
- musl-1.1.19