Elektrine lite

← Feed

@revk@toot.me.uk

2026-07-21 07:55 UTC

I have generally managed to use gcc on mac, but now it is all broken. So annoying. The Man clang does not handle nested functions even gnu99, so I brew installed the native arm gcc, which is a good start. But it cannot find err.h and no amount of googling is helping me find it. It should be standard clib stuff. Any clues welcome - what formulae or whatever it is called do I need to install? #macos #clib #brew #homebrew

Replies (6)

  • @brouhaha@mastodon.social 2026-07-21 23:32

    @revk@toot.me.uk I knew GCC had the nested functions extension, and I've sometimes been tempted to use it, but I've resisted in the interest of portability. I used nested functions a fairly bit in Pascal and Ada. I am slightly curious as to whether the GCC implementation uses a display vector, or a static link in the stack frame. But not curious enough to actually try it myself. Good luck with your GCC on Mac issues. Sorry I don't have any advice on that.

    Open ##4028180

  • @revk@toot.me.uk 2026-07-21 11:09

    OK, I think I am stuck. Looks like issue with gcc may be Apple not doing intel / rosetta stone or some such, so need arm gcc. But looks like glibc in brew is not arm, so build from source, OK But that needs linux-headers But that says it needs Linux Arrrrg!

    Open ##5121023

  • @revk@toot.me.uk 2026-07-23 14:39

    Looks like gcc-16 works, if not for PATH set by ESP IDF for as that is cross compiler, FFS.

    Open ##5121029

  • @kris@todon.eu 2026-07-21 08:03

    @revk@toot.me.uk Maybe too much novelty budget for you, but i would strongly recommend looking at the zig build system. It is very good at multi-platform stuff, and even effortless cross-compiling. Check out this organization if you want examples on how it's done https://github.com/allyourcodebase

    Open ##5121030

  • @madkiwi@mastodon.world 2026-07-21 09:17

    @revk@toot.me.uk I believe that the Apple gcc doesn't supported nested functions. The brew installed gcc-16 does support nested functions. I presume you just ran, 'brew install gcc' ? Can you confirm that its been installed correctly, gcc-16 -v

    Open ##5121031

  • @trode@hachyderm.io 2026-07-23 14:21

    @revk@toot.me.uk Macports is going to have better support for compilers and related tool than homebrew. You might consider that

    Open ##5121033