export CLFS_TARGET=arm-linux-gnueabi
export CLFS_HOST=aarch64-cross-linux-gnu
# binutils
../configure \
--prefix=/cross-tools \
--target=arm-linux-gnueabi \
--with-sysroot=${CLFS} \
--with-arch=armv7l \
--with-float=soft \
--disable-nls \
--enable-gprofng=no \
--disable-werror
make -j4
make install
# Install the Linux kernel headers
make ARCH=arm INSTALL_HDR_PATH=/cross-tools/arm-linux-gnueabi headers_install
# Build gcc (first phase)
../configure \
--prefix=/cross-tools \
--target=arm-linux-gnueabi \
--prefix=/cross-tools \
--build=${CLFS_HOST} \
--host=${CLFS_HOST} \
--with-sysroot=${CLFS} \
--enable-languages=c,c++ \
--with-glibc-version=2.37 \
--with-arch=armv7 \
--with-float=soft \
--with-newlib \
--without-headers \
--enable-default-pie \
--enable-default-ssp \
--disable-nls \
--disable-shared \
--disable-multilib \
--disable-threads \
--disable-libatomic \
--disable-libgomp \
--disable-libquadmath \
--disable-libssp \
--disable-libvtv \
--disable-libstdcxx \
--disable-werror
make -j4 all-gcc
make install-gcc
# glibc
BUILD_CC="gcc" \
CC="${CLFS_TARGET}-gcc" \
AR="${CLFS_TARGET}-ar" \
RANLIB="${CLFS_TARGET}-ranlib" \
ASFLAGS="-mcpu=cortex-m3 -mthumb -mno-thumb-interwork -mfpu=vfp -msoft-float -mfix-cortex-m3-ldrd" \
../configure \
--prefix=/tools \
--host=${CLFS_TARGET} \
--build=${CLFS_HOST} \
--enable-kernel=3.2 \
--with-binutils=/cross-tools/bin \
--with-headers=/tools/include \
--enable-obsolete-rpc
make install-bootstrap-headers=yes install-headers
export CLFS=/mnt/clfs
moutn -v -t ext4 /dev/<xxx> $CLFS
https://blog.jgosmann.de/posts/2021/02/07/a-guide-to-crosscompiling-applications/
https://wiki.osdev.org/GCC_Cross-Compiler
https://gist.github.com/rikka0w0/612149263721050f69acdc0497bf9fb8
'Cross Linux From Scratch' 카테고리의 다른 글
[실패]라즈베리파이 4 B 크로스 툴체인/리눅스/파일시스템 (0) | 2023.03.17 |
---|