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

Building from source #29

Open
fauxpark opened this issue Jun 20, 2022 · 4 comments
Open

Building from source #29

fauxpark opened this issue Jun 20, 2022 · 4 comments

Comments

@fauxpark
Copy link
Contributor

I've been tinkering with building binutils, newlib and gcc from source, to match homebrew-avr.
So far I've got 2/3 going, but before I continue I was wondering if there was any interest in me adding them to the repo. Would be handy for when GHA eventually adds M1 runners.

@ladislas
Copy link
Member

Thanks @fauxpark for working on that!

I was trying to do the same, but it seemed way too complicated so I gave up. A few take aways:

With all that, it might not be necessary to invest in building from source.
They only reason I wanted to do so in the first place was to be able to have newer GCC versions, but it seems that this is now covered.

I've also been using ARM GCC 10 on an Apple M1 for a few months now, and even if it's using Rosetta 2, it's already way faster than on a high end Intel Macbook Pro 16 machine.

With all that said, if you still wish to proceed, I'll be happy to review and merge. In this case, it would be nice to have both formulae separated: from ARM and build from source.

@fauxpark
Copy link
Contributor Author

It is a little complex, mainly because there is something of a circular dependency between newlib and GCC, as a result a "minimal" GCC must be built first in order to build newlib, then GCC. This part was not so much of a problem for me as I could draw on the Arch and MSYS2 build scripts. I've already had a little experience fixing up the ARM and AVR toolchains on MSYS2. In fact the hardest part for me was figuring out how to translate some of the bash-isms to Ruby 😄

Personally I think it's worth having formulae that can be built from source, for a few reasons:

  • It would mirror the AVR repo, in that it has discrete formulae for binutils, a selection of GCC versions, and avr-libc.
  • It allows finer control over the build if necessary; I couldn't find a complete build script for the precompiled ARM toolchain, only a .txt file containing the configure flags, which is helpful but not the whole story.
  • The bottle filesize should be a little smaller (I think). The toolchain from ARM appears to build and have its own versions of isl, mpfr, etc. A minor thing, but since Homebrew already has all of these as separate formulae, they won't need to be built as well.

@ladislas
Copy link
Member

@fauxpark any news on that? :)

@fauxpark
Copy link
Contributor Author

Sorry, I ran into some issue building GCC 10 and haven't had the time (or, I suspect, the knowledge) to investigate. I can make a draft PR for others to poke at, if you'd like?

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

2 participants