WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: compiling with clang/rust on piCore  (Read 158 times)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 15531
compiling with clang/rust on piCore
« on: March 09, 2026, 07:14:25 AM »
Here's a fix for compiling with clang/rust on piCore when clang complains it cannot find /usr/local/include/c++/14.2.0/new

It seems that the problem occurs because clang thinks it's compiling for armv7l-unknown-linux-gnueabihf whereas rust thinks it's compiling for armv7-unknown-linux-gnueabihf.

The work around involves adjusting things as per https://forum.tinycorelinux.net/index.php/topic,28061

..and then creating a file such that:
Code: [Select]
cat clang++
#!/bin/bash
arr=()
for arg; do
if [ "$arg" == "--target=armv7-unknown-linux-gnueabihf" ]; then
arg="--target=armv7l-unknown-linux-gnueabihf"
fi
arr+=("$arg")
done
/usr/local/bin/clang++.real "${arr[@]}"

..and then:
Code: [Select]
chmod +x clang++
cd /usr/local/bin
sudo mv clang++ clang++.real
cd ~
sudo cp clang++ /usr/local/bin