1DOLLY 72TOOLCHAIN llvm-build3REQUIRES HOST runtime@04REQUIRES HOST display@05REQUIRES HOST dso@06REQUIRES HOST http@07REQUIRES HOST input@08REQUIRES HOST sockets@09REQUIRES HOST threads@01011# Build-only: the libraries of Clang, LLD and the WebAssembly backend that the12# seed compiler links, compiled inside Dolly by its own c++, then the rest of13# LLVM in the same tree for the llvm package.14FROM /v0.1.4/demos/llvm/Dollyfile-llvm-tablegen 522b41c3855d7661815d77e27505f943a285462a26d3996f2150d27f880fb59d15REQUIRES TOOL llvm-tblgen16REQUIRES TOOL clang-tblgen17REQUIRES TOOL cmake18REQUIRES TOOL make19REQUIRES TOOL python20REQUIRES TOOL cc21REQUIRES TOOL c++22REQUIRES TOOL ar23REQUIRES TOOL gzip24REQUIRES TOOL tar25REQUIRES TOOL patch26REQUIRES TOOL time27REQUIRES TOOL find28REQUIRES TOOL cp29REQUIRES TOOL mkdir30REQUIRES TOOL rm3132SOURCE /v0.1.4/dist/static/llvm/llvm-project.tar.gz 033390c4520e51f261eb7572f0a1b4a1592121a1c8c1fc0c3db4845b079a8882 /tmp/llvm-project.tar.gz33SLOP time slop -c 'gzip -dc /tmp/llvm-project.tar.gz | tar -xf - -C /'34SLOP rm /tmp/llvm-project.tar.gz35SOURCE /v0.1.4/dist/static/llvm/llvm-host-triple.patch ec739fd5932c1040d07344a8511bae4da4157ff2bcafa348f06a555b71a10981 /tmp/llvm-host-triple.patch36SLOP patch -p1 -d /tmp/llvm-project -i /tmp/llvm-host-triple.patch3738# Configured as llvm-tablegen is, and further:39# - A snapshot keeps no file times, so its Make tree cannot continue here: the40#   TableGen tools it kept run again, as the seed's native ones do.41# - The staged tree has no .git; the seed's revision is given.42# - Clang's headers define CLANG_ABI for ELF, Mach-O, Windows and Emscripten;43#   CLANG_BUILD_STATIC is their configuration for archives only.44# - LLVM's warning set includes -Wimplicit-fallthrough, whose visitor recurses45#   once per case label: SemaARM.cpp has 6,020 in a row, 1.4 MB of browser46#   stack where Chrome gives a process 950 KB.47FILE /usr/lib/llvm-build/Dolly.cmake48    set(CMAKE_BUILD_TYPE Release CACHE STRING "")49    set(CMAKE_C_FLAGS "-std=gnu17" CACHE STRING "")50    set(CMAKE_CXX_FLAGS "-include endian.h -DCLANG_BUILD_STATIC" CACHE STRING "")51    set(CMAKE_DISABLE_PRECOMPILE_HEADERS ON CACHE BOOL "")52    set(CMAKE_RULE_MESSAGES OFF CACHE BOOL "")53    set(LLVM_ENABLE_WARNINGS OFF CACHE BOOL "")54    set(LLVM_ENABLE_PROJECTS "clang;lld" CACHE STRING "")55    set(LLVM_TARGETS_TO_BUILD WebAssembly CACHE STRING "")56    set(LLVM_HOST_TRIPLE wasm64-unknown-emscripten CACHE STRING "")57    set(LLVM_DEFAULT_TARGET_TRIPLE wasm64-unknown-emscripten CACHE STRING "")58    set(LLVM_TABLEGEN /usr/bin/llvm-tblgen CACHE STRING "")59    set(CLANG_TABLEGEN /usr/bin/clang-tblgen CACHE STRING "")60    set(LLVM_FORCE_VC_REVISION 4bfd08c2d769736841ae4f5705d76fa6daa39027 CACHE STRING "")61    set(LLVM_FORCE_VC_REPOSITORY https://github.com/llvm/llvm-project.git CACHE STRING "")62    foreach(option THREADS TERMINFO LIBEDIT LIBPFM ZLIB ZSTD LIBXML2 CURL BINDINGS)63      set(LLVM_ENABLE_${option} OFF CACHE STRING "")64    endforeach()65    foreach(option TESTS EXAMPLES BENCHMARKS DOCS)66      set(LLVM_INCLUDE_${option} OFF CACHE BOOL "")67    endforeach()68    set(LLVM_BUILD_LLVM_DYLIB OFF CACHE BOOL "")69    set(LLVM_LINK_LLVM_DYLIB OFF CACHE BOOL "")70SLOP time cmake -C /usr/lib/llvm-build/Dolly.cmake -S /tmp/llvm-project/llvm -B /tmp/llvm-build7172# The seed compiler's libraries. Four jobs fit the 32-process73# cap; -k reports every failing unit of an hour's build, not only the first.74SLOP CWD /tmp/llvm-build time make -k -j4 clangFrontendTool clangCodeGen clang-resource-headers lldWasm LLVMWebAssemblyCodeGen75# The archives, Clang's resource directory, and the configured and generated76# headers a program including LLVM, Clang or LLD needs, by build-tree path.77SLOP CWD /tmp/llvm-build slop -c 'mkdir -p /usr/lib/llvm-build/lib && cp lib/*.a /usr/lib/llvm-build/lib && cp -R lib/clang /usr/lib/llvm-build/lib'78SLOP CWD /tmp/llvm-build slop -c 'for f in $(find include tools/clang/include tools/lld/include -name CMakeFiles -prune -o -type f \( -name "*.inc" -o -name "*.def" -o -name "*.h" \) -print); do mkdir -p "/usr/lib/llvm-build/${f%/*}"; cp "$f" "/usr/lib/llvm-build/$f"; done'7980FOLDER /usr/lib/llvm-build8182# LLVM itself, for the llvm package, in the same tree once the compiler's83# archives above are kept, which this leaves as they are: every library, the84# headers, llvm-config and the tools, under /usr/lib/llvm. Configured again for85# that alone: the install prefix, tools linked without their names as the86# compiler is, and no shared libraries (they link with version scripts, which87# wasm-ld has not). The objects stay as they are.88SLOP time cmake -DCMAKE_INSTALL_PREFIX=/usr/lib/llvm -DCMAKE_EXE_LINKER_FLAGS=-Wl,--strip-all \89  -DLLVM_TOOL_LTO_BUILD=OFF -DLLVM_TOOL_REMARKS_SHLIB_BUILD=OFF /tmp/llvm-build90SLOP CWD /tmp/llvm-build time make -k -j4 llvm-libraries91# Two jobs: a tool's link holds most of LLVM at once.92SLOP CWD /tmp/llvm-build time make -k -j2 install-llvm-libraries install-llvm-headers install-llvm-config \93  install-llvm-ar install-llvm-ranlib install-llvm-nm install-llvm-objdump install-llvm-readobj install-llvm-readelf \94  install-llvm-objcopy install-llvm-strip install-llvm-size install-llvm-strings install-llvm-symbolizer \95  install-llvm-addr2line install-llvm-dwarfdump install-llvm-cxxfilt install-llvm-mc install-llvm-as install-llvm-dis \96  install-llvm-link install-opt install-llc97FOLDER /usr/lib/llvm98SLOP /usr/lib/llvm/bin/llvm-config --version --targets-built99100ENTRY /bin/foreground -i /bin/slop101