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

Add GCC #105

Open
pawelostr opened this issue Nov 14, 2020 · 21 comments
Open

Add GCC #105

pawelostr opened this issue Nov 14, 2020 · 21 comments

Comments

@pawelostr
Copy link

The official name of the app
GCC

Proposed App Status
Native - not yet.
Rosetta - no idea.

Related Issue Tracker Link or discussion
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96168

An Official App Download Link
https://gcc.gnu.org/

Additional context

@ThatGuySam
Copy link
Owner

Thanks for the App Request!

Next, we'll need to have it next on Rosetta to or find a confirmation that someone already has

@pawelostr
Copy link
Author

pawelostr commented Nov 24, 2020

Zrzut ekranu 2020-11-24 o 11 03 13

Works using Rosetta (and what's interesting, file $(which gcc) says gcc is universal binary so should work natively, but I'll test that some time later).

Edit: and I'm a little weirded out by clang appearing as on Linux it says gcc, but I guess that's normal on macs?

@ThatGuySam
Copy link
Owner

We'll go with "✳️ Yes, runs via Rosetta 2" for now but leave this issue open until native ARM Support is released publicly

@ThatGuySam
Copy link
Owner

ThatGuySam commented Nov 24, 2020

This is ready to add to the list.

Feel free to make a pull request using the App Addition Template otherwise I'll add it when time permits.

@fabiojmendes
Copy link

fabiojmendes commented Dec 23, 2020

Just to add to this discussion, the GCC ARM Embedded (used for micro controllers and embedded devices) also works fine using rosetta.

@fabiojmendes
Copy link

fabiojmendes commented Dec 23, 2020

@pawelostr

Edit: and I'm a little weirded out by clang appearing as on Linux it says gcc, but I guess that's normal on macs?

The gcc that ships with the command line tools is just a wrapper to clang. You should change your PATH variable to point to the new gcc installed by homebrew.

Here's what I got by running gcc --version:

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.28)
Target: arm64-apple-darwin20.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Macports has a native version of gcc for the devel branch (gcc 11)

$ file /opt/local/bin/gcc-mp-devel 
/opt/local/bin/gcc-mp-devel: Mach-O 64-bit executable arm64

$ gcc-mp-devel --version
gcc-mp-devel (MacPorts gcc-devel 11-20201205_0) 11.0.0 20201205 (experimental)
Copyright (C) 2020 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.

@ThatGuySam
Copy link
Owner

@fabiojmendes Drop a screenshot for GCC ARM Embedded and we'll go ahead and add it to the list.

Be sure to include the App, Activity Monitor showing the app details, and About this Mac so we can see the exact OS version.

You can find an example on #358

@fabiojmendes
Copy link

Screen Shot 2020-12-23 at 1 22 06 PM

@harryzcy
Copy link

Native support is still a work in progress. This repo tracks that: https://github.com/iains/gcc-darwin-arm64.

@SeanMollet
Copy link

For the arm-none-eabi version of GCC for building embedded stuff, I've got a working m1 build. https://github.com/SeanMollet/arm-none-eabi-gcc-aarch64-macosx

@SeanMollet
Copy link

SeanMollet commented May 16, 2021

@ThatGuySam I've got an M1 build for this specific gcc: https://doesitarm.com/app/gcc-arm-embedded/ Screenshot attached.
Screen Shot 2021-05-16 at 10 44 15 AM

@ThatGuySam
Copy link
Owner

Updated!

https://doesitarm.com/app/gcc-arm-embedded/

Thanks for the screenshots @SeanMollet!

@moffpage
Copy link

Are GCC and GCC-ARM-embedded different products?

@ThatGuySam
Copy link
Owner

@moffpage Do you know if GCC-ARM-embedded is Apple Silicon native yet?

@moffpage
Copy link

Um, the comment before mine literally updates the info on that regard: https://doesitarm.com/app/gcc-arm-embedded/

@SeanMollet
Copy link

@moffpage GCC is the "GNU Compiler Collection", it comprises many, many compilers. There isn't currently one that can build things for MacOS arm. I built one that can build things for embedded arm devices that runs on MacOS arm. So, yes, GCC and GCC-ARM-Embedded are different "products".

@moffpage
Copy link

Thanks for clarifying!

@sidcha
Copy link

sidcha commented Feb 20, 2022

@SeanMollet, @ThatGuySam,

  1. What is the current status of gcc-arm for M1? I see doesitarm.com claiming "full native M1 support" but the binaries from developers.arm.com (and by extension the homebrew provided version) still ship x86_64 ones.
  2. Is the cask in https://github.com/SeanMollet/arm-none-eabi-gcc-aarch64-macosx being maintained?
  3. Last - what does doesitarm.com track generally? Is it the availability of a package in native M1 arch (via established package manager, or download sites) or just the a possibility of being able to build one yourself is enough to call a "full support"?

@SeanMollet
Copy link

SeanMollet commented Feb 20, 2022

@sidcha

  1. Arm isn't building it for some reason. I am.
  2. Yes. I noticed recently that there's a new release, I'll probably build it and put out an update in a week or two
  3. I'm not the person to answer that.

Here's my take: I made the necessary changes to get it to build on M1, documented them and built a binary with it. I make both the resulting binary and the requisite bits and documentation required for you to build it yourself available if you don't trust my binary.

If we were talking about a consumer app, I would say the line belongs at "signed binary distributed by the author." But, we're talking about an embedded C compiler here. This is something used by people that know how to build software. So, having a repo available that builds and works correctly on M1 is probably sufficient. A pre-built binary bundle is a bonus.

@sidcha
Copy link

sidcha commented Feb 20, 2022

@SeanMollet, Thanks for your efforts and the answers. I resorted to building from source (with your instructions); not that I don't trust you, your binaries weren't signed. Perhaps you could sign future releases?

I will wait for @ThatGuySam to answer 3/ then :)

@ThatGuySam
Copy link
Owner

ThatGuySam commented Feb 26, 2022

Last - what does doesitarm.com track generally? Is it the availability of a package in native M1 arch (via established package manager, or download sites) or just the a possibility of being able to build one yourself is enough to call a "full support"?

@sidcha I try to track against what most of the community and users of the specific software would consider "ARM Native" and not assume what I consider "ARM Native" is the same as the people who actually use the software.

If people that use the software mostly build from source every time and that's working then yes.

If people that use the software only get it through DMG or even the Mac App Store then I'll try to go off that.

One example is OBS, there are "ARM Native" builds but Youtube and Twitch streamers wouldn't consider that fully native.

Generally, if the software publisher distributes an ARM-compatible version it's likely considered "ARM Native"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants