| author | |
| committer | |
| log | f68d8060ec2c65e3062007348c0e331ffbe86f37 |
| tree | 149eef2c891e592849c1fc52e0ad9a145db35a72 |
| parent | 6a56091213a48118c8c61c0683466f0ffadf6b55 |
| parent | d110818cfe96b8038e02d49122d42070d6059197 |
| signature |
Build archives using the K_DARWIN format when targeting osx5 files changed, 4 insertions(+), 21 deletions(-)
CMakeLists.txt-2| ... | ... | @@ -6714,8 +6714,6 @@ target_link_libraries(zig0 compiler) |
| 6714 | 6714 | |
| 6715 | 6715 | if(WIN32) |
| 6716 | 6716 | set(LIBUSERLAND "${CMAKE_BINARY_DIR}/userland.lib") |
| 6717 | elseif(APPLE) | |
| 6718 | set(LIBUSERLAND "${CMAKE_BINARY_DIR}/userland.o") | |
| 6719 | 6717 | else() |
| 6720 | 6718 | set(LIBUSERLAND "${CMAKE_BINARY_DIR}/libuserland.a") |
| 6721 | 6719 | endif() |
build.zig+2-10| ... | ... | @@ -383,17 +383,9 @@ const Context = struct { |
| 383 | 383 | }; |
| 384 | 384 | |
| 385 | 385 | fn addLibUserlandStep(b: *Builder) void { |
| 386 | // Sadly macOS requires hacks to work around the buggy MACH-O linker code. | |
| 387 | const artifact = if (builtin.os == .macosx) | |
| 388 | b.addObject("userland", "src-self-hosted/stage1.zig") | |
| 389 | else | |
| 390 | b.addStaticLibrary("userland", "src-self-hosted/stage1.zig"); | |
| 386 | const artifact = b.addStaticLibrary("userland", "src-self-hosted/stage1.zig"); | |
| 391 | 387 | artifact.disable_gen_h = true; |
| 392 | if (builtin.os == .macosx) { | |
| 393 | artifact.disable_stack_probing = true; | |
| 394 | } else { | |
| 395 | artifact.bundle_compiler_rt = true; | |
| 396 | } | |
| 388 | artifact.bundle_compiler_rt = true; | |
| 397 | 389 | artifact.setTarget(builtin.arch, builtin.os, builtin.abi); |
| 398 | 390 | artifact.linkSystemLibrary("c"); |
| 399 | 391 | const libuserland_step = b.step("libuserland", "Build the userland compiler library for use in stage1"); |
src/link.cpp-8| ... | ... | @@ -776,14 +776,6 @@ static const char *get_libc_crt_file(CodeGen *parent, const char *file) { |
| 776 | 776 | } |
| 777 | 777 | |
| 778 | 778 | static Buf *build_a_raw(CodeGen *parent_gen, const char *aname, Buf *full_path, OutType child_out_type) { |
| 779 | // The Mach-O LLD code is not well maintained, and trips an assertion | |
| 780 | // when we link compiler_rt and libc.zig as libraries rather than objects. | |
| 781 | // Here we workaround this by having compiler_rt and libc.zig be objects. | |
| 782 | // TODO write our own linker. https://github.com/ziglang/zig/issues/1535 | |
| 783 | if (parent_gen->zig_target->os == OsMacOSX) { | |
| 784 | child_out_type = OutTypeObj; | |
| 785 | } | |
| 786 | ||
| 787 | 779 | CodeGen *child_gen = create_child_codegen(parent_gen, full_path, child_out_type, |
| 788 | 780 | parent_gen->libc); |
| 789 | 781 | codegen_set_out_name(child_gen, buf_create_from_str(aname)); |
src/os.cpp+1-1| ... | ... | @@ -1350,7 +1350,7 @@ static void init_rand() { |
| 1350 | 1350 | zig_panic("unable to open /dev/urandom"); |
| 1351 | 1351 | } |
| 1352 | 1352 | char bytes[sizeof(unsigned)]; |
| 1353 | size_t amt_read; | |
| 1353 | ssize_t amt_read; | |
| 1354 | 1354 | while ((amt_read = read(fd, bytes, sizeof(unsigned))) == -1) { |
| 1355 | 1355 | if (errno == EINTR) continue; |
| 1356 | 1356 | zig_panic("unable to read /dev/urandom"); |
src/zig_llvm.cpp+1| ... | ... | @@ -877,6 +877,7 @@ bool ZigLLVMWriteArchive(const char *archive_name, const char **file_names, size |
| 877 | 877 | case ZigLLVM_Linux: |
| 878 | 878 | kind = object::Archive::K_GNU; |
| 879 | 879 | break; |
| 880 | case ZigLLVM_MacOSX: | |
| 880 | 881 | case ZigLLVM_Darwin: |
| 881 | 882 | case ZigLLVM_IOS: |
| 882 | 883 | kind = object::Archive::K_DARWIN; |