1DOLLY 82TOOLCHAIN zig-llvm-build3REQUIRES HOST runtime@045# Build-only: Zig 0.17 compiled to C as upstream's CMake build makes zig2 for6# LLVM, zig1 (upstream's zig1.wasm, run by WAMR as in zig-build) with7# upstream's stage1/config.zig.in, and cc's objects of it. zig-llvm links8# them with LLVM.9FROM /Dollyfile-system-build 0c72e09eba84571d4f8634cf6e7507eb1be1b9b8aa1fae61f6b0ec884b26b6fb10REQUIRES HEADER libc11REQUIRES TOOL   cc12REQUIRES TOOL   tar13REQUIRES TOOL   cp14REQUIRES TOOL   rm1516SOURCE /dist/static/zig-llvm/zig.tar 6196a5c65f4c4a07972bdcf9b9a308c490103bcde7c847fa6c6aed0258fbeb25 /tmp/zig.tar17SOURCE /dist/static/zig-llvm/wamr.tar d5d0e05cf074e3f4167bc0430342a39f69666d3e27ee09c748f2a2a22299dfea /tmp/wamr.tar18SLOP tar -xf /tmp/zig.tar -C /19SLOP tar -xf /tmp/wamr.tar -C /2021# WAMR requires a BUILD_TARGET; zig1 binds only raw natives, so the target22# selects no native calling convention here.23SLOP CWD /tmp/wamr/core cc \24  -O2 \25  -std=gnu99 \26  -fno-strict-aliasing \27  -w \28  -D_PLATFORM_WASI_TYPES_H \29  -DBH_PLATFORM_DOLLY \30  -DBUILD_TARGET_X86_64 \31  -DBH_MALLOC=wasm_runtime_malloc \32  -DBH_FREE=wasm_runtime_free \33  -DWA_MALLOC=wasm_runtime_malloc \34  -DWA_FREE=wasm_runtime_free \35  -DWASM_ENABLE_INTERP=1 \36  -DWASM_ENABLE_FAST_INTERP=1 \37  -DWASM_ENABLE_LABELS_AS_VALUES=0 \38  -DWASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS=0 \39  -DWASM_ENABLE_BULK_MEMORY=1 \40  -DWASM_ENABLE_BULK_MEMORY_OPT=1 \41  -DWASM_ENABLE_SHRUNK_MEMORY=1 \42  -DWASM_DISABLE_HW_BOUND_CHECK=1 \43  -DWASM_DISABLE_STACK_HW_BOUND_CHECK=1 \44  -DWASM_DISABLE_WRITE_GS_BASE=1 \45  -DWASM_DISABLE_WAKEUP_BLOCKING_OP=1 \46  -DWASM_ENABLE_SHARED_MEMORY=0 \47  -DWASM_ENABLE_MULTI_MODULE=0 \48  -DWASM_ENABLE_MINI_LOADER=0 \49  -DWASM_ENABLE_REF_TYPES=0 \50  -DWASM_ENABLE_SIMD=0 \51  -DWASM_ENABLE_EXTENDED_CONST_EXPR=0 \52  -DWASM_ENABLE_MEMORY64=0 \53  -I /tmp/wamr \54  -I /tmp/zig/stage1 \55  -I shared/platform/include \56  -I shared/utils \57  -I shared/mem-alloc \58  -I iwasm/include \59  -I iwasm/common \60  -I iwasm/interpreter \61  /tmp/wamr/zig1.c \62  /tmp/wamr/wamr-platform.c \63  shared/mem-alloc/mem_alloc.c \64  shared/mem-alloc/ems/ems_alloc.c \65  shared/mem-alloc/ems/ems_gc.c \66  shared/mem-alloc/ems/ems_hmu.c \67  shared/mem-alloc/ems/ems_kfc.c \68  shared/utils/bh_assert.c \69  shared/utils/bh_bitmap.c \70  shared/utils/bh_common.c \71  shared/utils/bh_hashmap.c \72  shared/utils/bh_leb128.c \73  shared/utils/bh_list.c \74  shared/utils/bh_log.c \75  shared/utils/bh_queue.c \76  shared/utils/bh_vector.c \77  shared/utils/runtime_timer.c \78  iwasm/common/wasm_application.c \79  iwasm/common/wasm_blocking_op.c \80  iwasm/common/wasm_c_api.c \81  iwasm/common/wasm_exec_env.c \82  iwasm/common/wasm_loader_common.c \83  iwasm/common/wasm_memory.c \84  iwasm/common/wasm_native.c \85  iwasm/common/wasm_runtime_common.c \86  iwasm/common/wasm_shared_memory.c \87  iwasm/common/arch/invokeNative_general.c \88  iwasm/interpreter/wasm_interp_fast.c \89  iwasm/interpreter/wasm_loader.c \90  iwasm/interpreter/wasm_runtime.c \91  -o /tmp/zig/zig19293# /tmp/zig/config.zig is upstream's configuration of zig2 for an LLVM build.94SLOP CWD / /tmp/zig/zig1 \95  /tmp/zig/stage1/zig1.wasm \96  /usr/lib/zig \97  build-exe \98  -target wasm64-emscripten \99  -mcpu=generic+atomics \100  -fsingle-threaded \101  -OReleaseSmall \102  -ofmt=c \103  -lc \104  --name zig2 \105  -femit-bin=tmp/zig/zig2.c \106  --dep build_options \107  -Mroot=tmp/zig/src/main.zig \108  -Mbuild_options=tmp/zig/config.zig109SLOP CWD / /tmp/zig/zig1 \110  /tmp/zig/stage1/zig1.wasm \111  /usr/lib/zig \112  build-obj \113  -target wasm64-emscripten \114  -mcpu=generic+atomics \115  -fsingle-threaded \116  -OReleaseSmall \117  -ofmt=c \118  --name compiler_rt \119  -femit-bin=tmp/zig/compiler_rt.c \120  -Mroot=usr/lib/zig/compiler_rt.zig121122# As zig-build compiles the C zig1 emits (zig.h's pointer types and its123# unrecognized wasm memory builtins).124SLOP CWD /tmp/zig cc -c -O2 -std=c99 -fno-strict-aliasing -Wno-incompatible-pointer-types \125  '-Dzig_unimplemented()=(__builtin_trap(),0)' -I /usr/lib/zig -o zig2.o zig2.c126SLOP CWD /tmp/zig cc -c -O2 -std=c99 -fno-strict-aliasing -Wno-incompatible-pointer-types \127  -I /usr/lib/zig -o compiler_rt.o compiler_rt.c128# What zig-llvm compiles and links: zigcpp's sources and the two objects.129SLOP mkdir -p /usr/lib/zig-llvm-build130SLOP CWD /tmp/zig cp zig2.o compiler_rt.o src/zig_llvm.cpp src/zig_llvm.h src/zig_llvm-ar.cpp src/zig_clang_driver.cpp src/zig_clang_cc1_main.cpp src/zig_clang_cc1as_main.cpp /usr/lib/zig-llvm-build131SLOP rm -rf /tmp/zig /tmp/wamr /tmp/zig.tar /tmp/wamr.tar132FOLDER /usr/lib/zig-llvm-build133FOLDER /usr/lib/zig134FILE /usr/share/licenses/zig/LICENSE135