Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
CNSTJiatongLee opened this issue Jan 27, 2024 · 3 comments

Comments

@CNSTJiatongLee
Copy link

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

@CNSTJiatongLee CNSTJiatongLee changed the title Why do x86_64 files appear when compiling in native environment on MAC Silicon Why does GCC compiler using ARM64 format on Apple silicon compile X86_64 format? Jan 27, 2024
@tylerwowen
Copy link

tylerwowen commented Mar 1, 2024

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
Copy link

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
Copy link
Collaborator

fbiego commented Dec 3, 2024

Closing this issue as it’s resolved

@fbiego fbiego closed this as completed Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants