-
Notifications
You must be signed in to change notification settings - Fork 8
NuttX archive
Henryk Paluch edited this page Mar 29, 2024
·
1 revision
Content that does not work but may be find useful as reference...
Problem: requires: mips-elf-gcc
- but there is one in: https://aur.archlinux.org/packages/mips-elf-gcc
- trying modified build from PKBUILD:
- be sure that you have powerfull machine
sudo apt-get install autoconf automake libtool gcc binutils make tmux git \
g++ libgmp-dev libmpc-dev libmpfr-dev
mkdir ~/gcc
cd ~/gcc
git clone https://aur.archlinux.org/mips-elf-gcc.git
# we will use build instructions from this:
cat mips-elf-gcc/PKGBUILD
cd ~/gcc
pkgver=12.2.0
curl -fLO https://ftp.gnu.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz
# you need big and fast disk for build
sudo mkdir /mnt/gcc
sudo chown `id -un`:`id -gn` /mnt/gcc
tar xf gcc-$pkgver.tar.xz -C /mnt/gcc
_target=mips-elf
cd /mnt/gcc/gcc-$pkgver
Created build-script /mnt/gcc/build_me.sh
with contents:
#!/bin/bash
set -euo pipefail
set -x
pkgver=12.2.0
_target=mips-elf
prefix=/opt/gcc-$pkgver
cd `dirname $0`
cd gcc-$pkgver
./configure \
--target=$_target \
--prefix=$prefix \
--with-sysroot=$prefix/$_target \
--enable-languages=c,c++ \
--enable-plugins \
--disable-nls \
--disable-threads \
--disable-multilib \
--disable-shared \
--with-gnu-as \
--with-gnu-ld
make all-gcc -j`nproc` "inhibit_libc=true"
sudo make install-gcc
exit 0
After run there should exist:
/opt/gcc-12.2.0/bin/mips-elf-gcc
To build pic32mx version again try:
cd ~/nuttxspace/pic32mx/nuttx
export PATH=/opt/gcc-12.2.0/bin:$PATH
make
CC: clock/clock.c as: unrecognized option '-EL'
make[1]: *** [Makefile:61: clock.o] Error 2
# you can append V=1 to see real commands:
make V=1
mips-elf-gcc -c -fno-common -Wall -Wstrict-prototypes -Wshadow -Wundef -Wno-attributes -Wno-unknown-pragmas -O2 -fno-strict-aliasing -fomit-frame-pointer -ffunction-sections -fdata-sections -mlong32 -membedded-data -msoft-float -march=m4k -EL -isystem /home/azureuser/nuttxspace/pic32mx/nuttx/include -D__NuttX__ -DNDEBUG -D__KERNEL__ -pipe -I /home/azureuser/nuttxspace/pic32mx/nuttx/sched clock/clock.c -o clock.o
Trying:
mkdir -p ~/gcc
cd ~/gcc
curl -fLOJ https://sourceforge.net/projects/pinguinoide/files/linux/pinguino-linux64-gcc-mips-elf.tar.lzma/download
tar xf pinguino-linux64-gcc-mips-elf.tar.lzma
sudo rm -rf /opt/p32
sudo mv p32 /opt
sudo chown -R root:root /opt/p32
sudo ln -s /opt/p32/bin/mips-elf-cc /opt/p32/bin/mips-elf-gcc
...
Copyright © Henryk Paluch. All rights reserved.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License