lvgl / lv_platformio

PlatformIO project example for LVGL
MIT License
264 stars 92 forks source link

Why does GCC compiler using ARM64 format on Apple silicon compile X86_64 format? #58

Closed CNSTJiatongLee closed 14 hours ago

CNSTJiatongLee commented 10 months ago

I set platform=native on Mac M1 and it compiles using my native gcc compiler. Why is my native gcc compiler in ARM64 format and able to compile x86_64 files? This caused an error when linking to sdl2 in arm64 format that homebrew downloaded

iShot_2024-01-27_23 56 29 iShot_2024-01-27_23 57 00 iShot_2024-01-27_23 57 40
tylerwowen commented 9 months ago

I ran into the same problem.

For my situation, the Platform IO installed was Darwin_x86_64. It is because platform IO's builtin python is Intel for some reason.

pio  system info
--------------------------  ---------------------------------------------
PlatformIO Core             6.1.13
Python                      3.11.7-final.0
System Type                 darwin_x86_64

To fix, I did the following

  1. Uninstall the PlatformIO ID extension from VSCode.
  2. Change VSCode config "platformio-ide.useBuiltinPython": false (default was true)
  3. Exit VSCode.
  4. Remove the $HOME/.platformio created by the PlatformIO IDE
  5. Reinstall the PlatformIO. Now I got the right version.
pio  system info
--------------------------  ---------------------------------------------
PlatformIO Core             6.1.13
Python                      3.9.6-final.0
System Type                 darwin_arm64
navanchauhan commented 9 months ago

Just in case someone else stumbles upon this issue. I gave up on using the VSCode IDE and instead just installed paltformio via homebrew

brew install platformio

I also had to change python to python3 in the platformio.ini file (Or, you can set an alias from python -> python)

fbiego commented 14 hours ago

Closing this issue as it’s resolved