On Darwin, it is apparently Oracle's intention to be hostile towards builds of Clang which are not by Apple. see https://github.com/oracle/graal/issues/12041 If you want native-image to both work on Darwin and use the nix-provided CC then you must pass it the flags to disable toolchain checking entirely. Since the flags are mandatory for functionality, they should be part of the wrapper.