Okay!
Let's try to solve it.
Could you show me the result of the following command for analysis?
find /usr -type f -iname '*cc1*'
Git Clone URL: | https://aur.archlinux.org/arm-linux-gnueabihf-linaro-bin.git (read-only, click to copy) |
---|---|
Package Base: | arm-linux-gnueabihf-linaro-bin |
Description: | The GNU Compiler Collection- cross compiler and binutils for ARMv7 EABI hard float target (Linaro) |
Upstream URL: | https://snapshots.linaro.org/gnu-toolchain |
Keywords: | arm cross-compile |
Licenses: | GPL, LGPL |
Groups: | arm-linux-gnueabihf-toolchain-linaro-bin |
Conflicts: | arm-linux-gnueabihf-binutils, arm-linux-gnueabihf-gcc |
Provides: | arm-linux-gnueabihf-binutils, arm-linux-gnueabihf-gcc |
Replaces: | arm-linux-gnueabihf-binutils, arm-linux-gnueabihf-gcc |
Submitter: | curlywei |
Maintainer: | curlywei |
Last Packager: | curlywei |
Votes: | 0 |
Popularity: | 0.000000 |
First Submitted: | 2024-06-08 15:39 (UTC) |
Last Updated: | 2024-06-14 10:54 (UTC) |
Okay!
Let's try to solve it.
Could you show me the result of the following command for analysis?
find /usr -type f -iname '*cc1*'
Hi @curlywei,
sorry, i was doing other tests and pasted the wrong line, the error is still there even with g++
$ arm-linux-gnueabihf-g++ hello.c -o hello_arm
arm-linux-gnueabihf-g++: fatal error: cannot execute ‘cc1plus’: execvp: No such file or directory
compilation terminated.
I've tried with packages arm-linux-gnueabihf-gcc49-linaro-bin
or arm-linux-gnueabi-gcc75-linaro-bin
and works as expected.
Hi @konez2k,
To compile C/C++ code,
you should use arm-linux-gnueabihf-g++
instead of arm-linux-gnueabihf-cpp
.
cpp
stands for the C/C++ preprocessor.
It is commonly used as in arm-linux-gnueabihf-cpp hello.c
,
which parse macros likes #define VAR stuff
.
test code:
#include <stdio.h>
int main() {
printf("Hello, arm!\n");
return 0;
}
build:
$ arm-linux-gnueabihf-cpp hello.c -o hello_arm
arm-linux-gnueabihf-cpp: fatal error: cannot execute ‘cc1’: execvp: No such file or directory
compilation terminated.
version:
$ arm-linux-gnueabihf-cpp --version
arm-linux-gnueabihf-cpp (GCC) 14.0.0 20230605 (experimental) [master revision c7fe7ad612bb6aac1d078d215d5700ec4ef70e3c]
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Hi @Nobody_8194, @maddie:
Sorry for the late reply.
Could you share your test code and the build command?
Everything worked fine in my tests.
$ arm-linux-gnueabihf-g++ -static t.cc -o t.elf
$ qemu-arm-static ./t.elf
Hello, ARM cross-compilation!
//t.cc
#include <iostream>
int main() {
std::cout << "Hello, ARM cross-compilation!" << std::endl;
return 0;
}
$ arm-linux-gnueabihf-g++ --version
arm-linux-gnueabihf-g++ (GCC) 14.0.0 20230605 (experimental) [master revision c7fe7ad612bb6aac1d078d215d5700ec4ef70e3c]
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Maybe try reinstalling the x86-64 version of gcc/g++ after installing arm-linux-gnueabihf-linaro-bin.
sudo pacman -Syu gcc g++
Same problem, cc1/cc1plus not found when compiling...
I had no issue installing it but failed to compile the code:
arm-linux-gnueabihf-g++ src/main.cpp -o test
arm-linux-gnueabihf-g++: fatal error: cannot execute ‘cc1plus’: execvp: No such file or directory
The same for C code as cc1 is not found either.
Since Linaro provide gcc, glibc and binutils as necessary tools for cross-compile, I reduce these tools into a package and maintain this package to keep it up to date.
These AUR package are compatible:
Therefore, I will remove old packages that I maintain from the AUR such as:
arm-linux-gnueabihf-gcc75-linaro-bin
arm-linux-gnueabihf-gcc13-linaro-bin
arm-linux-gnueabihf-gcc14-linaro-bin
Pinned Comments
curlywei commented on 2024-06-08 15:50 (UTC) (edited on 2024-06-08 15:57 (UTC) by curlywei)
Since Linaro provide gcc, glibc and binutils as necessary tools for cross-compile, I reduce these tools into a package and maintain this package to keep it up to date.
These AUR package are compatible:
Therefore, I will remove old packages that I maintain from the AUR such as:
arm-linux-gnueabihf-gcc75-linaro-bin
arm-linux-gnueabihf-gcc13-linaro-bin
arm-linux-gnueabihf-gcc14-linaro-bin