| author | |
| committer | |
| log | 266b2de1505ed64f05260c7057b9b563a2161e48 |
| tree | eb459bd1658ae80ccd056d4e0a237185dd17285d |
| parent | f5657b5552ea1219706c79f67bd0620767ecc4ec |
3 files changed, 2 insertions(+), 20 deletions(-)
CMakeLists.txt-2| ... | @@ -6707,8 +6707,6 @@ target_link_libraries(zig0 compiler) | ... | @@ -6707,8 +6707,6 @@ target_link_libraries(zig0 compiler) |
| 6707 | 6707 | ||
| 6708 | if(WIN32) | 6708 | if(WIN32) |
| 6709 | set(LIBUSERLAND "${CMAKE_BINARY_DIR}/userland.lib") | 6709 | set(LIBUSERLAND "${CMAKE_BINARY_DIR}/userland.lib") |
| 6710 | elseif(APPLE) | ||
| 6711 | set(LIBUSERLAND "${CMAKE_BINARY_DIR}/userland.o") | ||
| 6712 | else() | 6710 | else() |
| 6713 | set(LIBUSERLAND "${CMAKE_BINARY_DIR}/libuserland.a") | 6711 | set(LIBUSERLAND "${CMAKE_BINARY_DIR}/libuserland.a") |
| 6714 | endif() | 6712 | endif() |
build.zig+2-10| ... | @@ -385,17 +385,9 @@ const Context = struct { | ... | @@ -385,17 +385,9 @@ const Context = struct { |
| 385 | }; | 385 | }; |
| 386 | 386 | ||
| 387 | fn addLibUserlandStep(b: *Builder) void { | 387 | fn addLibUserlandStep(b: *Builder) void { |
| 388 | // Sadly macOS requires hacks to work around the buggy MACH-O linker code. | 388 | const artifact = b.addStaticLibrary("userland", "src-self-hosted/stage1.zig"); |
| 389 | const artifact = if (builtin.os == .macosx) | ||
| 390 | b.addObject("userland", "src-self-hosted/stage1.zig") | ||
| 391 | else | ||
| 392 | b.addStaticLibrary("userland", "src-self-hosted/stage1.zig"); | ||
| 393 | artifact.disable_gen_h = true; | 389 | artifact.disable_gen_h = true; |
| 394 | if (builtin.os == .macosx) { | 390 | artifact.bundle_compiler_rt = true; |
| 395 | artifact.disable_stack_probing = true; | ||
| 396 | } else { | ||
| 397 | artifact.bundle_compiler_rt = true; | ||
| 398 | } | ||
| 399 | artifact.setTarget(builtin.arch, builtin.os, builtin.abi); | 391 | artifact.setTarget(builtin.arch, builtin.os, builtin.abi); |
| 400 | artifact.linkSystemLibrary("c"); | 392 | artifact.linkSystemLibrary("c"); |
| 401 | const libuserland_step = b.step("libuserland", "Build the userland compiler library for use in stage1"); | 393 | 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,14 +776,6 @@ static const char *get_libc_crt_file(CodeGen *parent, const char *file) { |
| 776 | } | 776 | } |
| 777 | 777 | ||
| 778 | static Buf *build_a_raw(CodeGen *parent_gen, const char *aname, Buf *full_path, OutType child_out_type) { | 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 | CodeGen *child_gen = create_child_codegen(parent_gen, full_path, child_out_type, | 779 | CodeGen *child_gen = create_child_codegen(parent_gen, full_path, child_out_type, |
| 788 | parent_gen->libc); | 780 | parent_gen->libc); |
| 789 | codegen_set_out_name(child_gen, buf_create_from_str(aname)); | 781 | codegen_set_out_name(child_gen, buf_create_from_str(aname)); |