MacOSX compatibility

- Implemented some syscall for MacOSX
- tested on : El Capitan 10.11 x86_64
- make self hosted test run on macosx
- modified run_test so it does not fail when parseh throws
  warnings (most of them are related to buildin types from
  gcc that arent defined in header files and unions)
- making -mmacosx-version-min and -mios-version-min works like
  gcc (command line paramers have precedence over enviroment variables)
This commit is contained in:
alter
2016-09-12 01:01:06 -03:00
committed by Andrew Kelley
parent 06f2f4d64b
commit cf9b21c09f
11 changed files with 285 additions and 51 deletions

View File

@@ -388,9 +388,21 @@ int main(int argc, char **argv) {
fprintf(stderr, "-mmacosx-version-min and -mios-version-min options not allowed together\n");
return EXIT_FAILURE;
}
if((g->zig_target.os == ZigLLVM_Darwin ||
g->zig_target.os == ZigLLVM_MacOSX ||
g->zig_target.os == ZigLLVM_IOS) &&
(!mmacosx_version_min &&
!mios_version_min &&
!g->mmacosx_version_min &&
!g->mios_version_min) && target) {
zig_panic("unable to determine -mmacosx-version-min or -mios-version-min");
}
if (mmacosx_version_min) {
codegen_set_mmacosx_version_min(g, buf_create_from_str(mmacosx_version_min));
}
if (mios_version_min) {
codegen_set_mios_version_min(g, buf_create_from_str(mios_version_min));
}