(wasn’t sure if this fits here or the issue tracker, so asking as question).
Wondering if there is a particular reason why
crystal/iconv doesn’t allow
libiconv to be used?
The specific code: crystal/iconv.cr at master · crystal-lang/crystal · GitHub
Checks that only under win32
lib_iconv will be used, otherwise it falls back to whatever c/platform is defined.
For the case of macOS, that will be the bundled iconv.
You might be wondering why am I asking this question?
I’ve been trying to cross-compile to macOS from Linux. I was able to successfully produce valid executables thanks to Zig CC being used as Mach-O linker.
However, the symbols it looks for
_iconv which are not part of macOS libc (if we can call it that way)
Wondering if is ok to adjust the macro to something like
flag?(:use_libiconv) || flag?(:win32)?
Here are some relevant threads about this on Zig itself:
- cross compile to x86_64-macos get error: "ld64.lld: error: Unable to find library for -liconv" · Issue #9725 · ziglang/zig · GitHub
- use case: cross-compiling to macOS with a dependency on iconv · Issue #10485 · ziglang/zig · GitHub
Any comments on why this could be a bad idea, before I submit a PR with support for this?
Thank you in advance for your time reading all this!