abhiTronix / raspberry-pi-cross-compilers

Latest GCC Cross Compiler & Native (ARM & ARM64) CI generated precompiled standalone toolchains for all Raspberry Pis. 🍇
https://sourceforge.net/projects/raspberry-pi-cross-compilers
GNU General Public License v3.0
583 stars 102 forks source link

Raspberry pi zero W Illegal instruction #91

Closed Iuliean closed 2 years ago

Iuliean commented 2 years ago

I downloaded the 8.3.0 Buster toolchain and followed the instructions from C1 from here and after compiling a simple hello world program i get Illegal instruction when i run it on my pi zero

I compiled with arm-linux-gnueabihf-g++ test.cpp -o test and with arm-linux-gnueabihf-g++ -march=armv6 -mfloat-abi=hard -mfpu=vfp test.cpp -o test

abhiTronix commented 2 years ago

I downloaded the 8.3.0 Buster toolchain

@Iuliean Which toolchain, can you paste the exact URL of the toolchain you used? Also, what's your setup, which machine you're using?

Iuliean commented 2 years ago

https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%208.3.0/

this is the toolchain i downloaded. i am compiling it on a virtual box vm which runs manjaro for a raspberry pi zero w which runs raspbian (debian 10 )

abhiTronix commented 2 years ago

after compiling a simple hello world program i get Illegal instruction when i run it on my pi zero

@Iuliean Sorry for previous comment, This is not it, you're definitely using wrong toolchain for your raspberry pi zero w, or you're not running it on it. "Illegal instruction" means you're trying to run a program that was compiled for specific processor, but instead running on a different processor. Are you sure you running it on pi zero?

https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%208.3.0/

Also, this is incomplete, I need exact Toolchain URL you used, otherwise paste the name of compressed toolchain tar.gz file you downloaded.

Iuliean commented 2 years ago

Yeah i am so sorry, i was using the wrong toolchain i didn't notice that the link redirects to a place where multiple toolchains are available and i just downloaded whatever was at the top, i downloaded the correct toolchain now and the simple hello world program works now. Thanks a lot and i am sorry

Edit: how do i install libs for it like boost do i have to manually put the files into the lib folder inside the toolchain?

abhiTronix commented 2 years ago

Edit: how do i install libs for it like boost do i have to manually put the files into the lib folder inside the toolchain?

No, you specify them in CMAKE file or you specify during configure/make command.