scizzorz/rain

Where the hell do _Unwind_* functions live?

Closed this issue · 2 comments

Apparently it's libunwind on Ubuntu and macOS, but it's in libgcc_s on Arch. libgcc_s doesn't seem to exist on macOS though - it goes by libgcc_s.1, I think.

Linking with libunwind and libgcc_s works fine on Arch and Ubuntu, but fails on macOS.
Linking with just libunwind works fine on Ubuntu and macOS, but fails on Arch.

I dunno.

Why does the first option fail on macOS? Just with like a 'file not found error'? I think an explicitly cross-platform solution is needed (e.g., is this mac? link with this, if not, link with these).

Yeah, I think it says it can't find libgcc_s.

I agree about the cross-platform solution. The idea was that macros would accomplish some of that, eg:

@linux library "gcc_s"
@macos library "gcc_s.1"

But since macro expansion/evaluation depends on the core runtime files, which depend on these libraries, it's a bit of a catch-22. Non-core Rain code could still use macros for it, but it the core runtime libraries might need to be decided by the compiler.