임베디드를 좋아하는 조금 특이한 개발자?

Beaglebone Black를 위한 crosstool-ng 빌드 방법 (v1.27.0) 본문

Embedded/Yocto Project

Beaglebone Black를 위한 crosstool-ng 빌드 방법 (v1.27.0)

Gordon_ 2025. 2. 21. 17:57

개발 환경

 OS : Ubuntu 22.04 LTS (WSL2)

 개발 보드 : beaglebone black


 

공식 홈페이지의 설치 방법을 따라 설치 하였습니다.

https://crosstool-ng.github.io/docs/install/

 

Installing crosstool-NG

Before installing crosstool-NG, you may need to install additional packages on the host OS. Specific instructions for several supported operating systems and distributions are provided here. Note that not all the dependencies are currently detected by the

crosstool-ng.github.io

 

제가 crosstool-ng 빌드시 1.25.0 이하 버전에서 자꾸 에러가 발생하여 1.27.0 버전으로 빌드하였습니다.

 

1.  필요 패키지 설치

sudo apt-get update
sudo apt-get install -y gcc g++ gperf bison flex texinfo help2man make libncurses5-dev python3-dev autoconf automake libtool libtool-bin gawk wget bzip2 xz-utils unzip patch libstdc++6 rsync git meson ninja-build

참고 : https://github.com/crosstool-ng/crosstool-ng/blob/master/testing/docker/ubuntu22.04/Dockerfile

 

crosstool-ng/testing/docker/ubuntu22.04/Dockerfile at master · crosstool-ng/crosstool-ng

A versatile (cross-)toolchain generator. Contribute to crosstool-ng/crosstool-ng development by creating an account on GitHub.

github.com

 

 

2. 소스 코드 준비

git clone https://github.com/crosstool-ng/crosstool-ng
cd ./crosstool-ng
git checkout crosstool-ng-1.27.0
./bootstrap

 

3. 메소드 설치

./configure --enable-local
make

 

4.  crosstool-ng 설정

저는 Beaglebone black을 사용하기 위한 설정을 하고 있습니다.

만약 다른 보드를 사용한다면 해당 보드에 맞추어 설정하여야 합니다.

./ct-ng arm-cortex_a8-linux-gnueabi

 

추가적인 변경사항이 있어 해당 사항은 menuconfig를 통해 변경하도록 하겠습니다.

 

./ct-ng menuconfig

 

4.1 Path and mics options -> Render the toolchain read-only 의 옵션을 해제

4.2 Target options -> Floating point를 Hardware (FPU)로 변경

 

저장후 나가도록 합니다.

 

5.  crosstool-ng 빌드

./ct-ng build

 

 

6. 정상 작동 확인

설치 위치 : ~/x-tools/arm-cortex_a8-linux-gnueabihf/bin

 

bash에서 사용하기 위해서 PATH에 해당 위치를 추가하여야 한다.

PATH=${HOME}/x-tools/arm-cortex_a8-linux-gnueabihf/bin/:$PATH

arm-cortex_a8-linux-gnueabihf-gcc --version

crosstool-ng를 통한 gcc설치 완료