Skip to content

Commit fd8666c

Browse files
committed
static llvm
1 parent 5097ac5 commit fd8666c

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.github/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ COPY --from=stage1 /root/.cache/deno /root/.cache/deno
1616

1717
# libc6-dev: platform specific c-headers that LLVM doesn’t provide
1818
# libgcc-8-dev: provides the c runtime `crtbeginS.o`
19-
RUN apt-get update && apt-get install --yes libc6-dev libgcc-8-dev
19+
# libstdc++-8-dev: TODO remove
20+
RUN apt-get update && apt-get install --yes libc6-dev libgcc-8-dev libstdc++-8-dev
2021

2122
ENV PKGX_DIST_URL="https://dist.pkgx.dev/v2"

projects/llvm.org/build.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { BuildOptions, env_include, Path, run, SemVer, unarchive } from "brewkit
1212

1313
export default async function build({ prefix, version, tag, deps }: BuildOptions) {
1414
await unarchive(
15-
`https://github.com/llvm/llvm-project/releases/download/${tag}/llvm-project-${version}.src.tar.gz`,
15+
`https://github.com/llvm/llvm-project/releases/download/${tag}/llvm-project-${version}.src.tar.xz`,
1616
);
1717

1818
// build what is provided by GNU “bintools”
@@ -39,11 +39,15 @@ export default async function build({ prefix, version, tag, deps }: BuildOptions
3939
platform_specific_cmake_args += `
4040
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON
4141
-DCMAKE_C_COMPILER_TARGET=x86_64-unknown-linux-gnu
42-
-DLLVM_ENABLE_RUNTIMES=compiler-rt
42+
#-DLLVM_ENABLE_RUNTIMES=compiler-rt
4343
-DCOMPILER_RT_BUILD_XRAY=OFF
4444
-DCOMPILER_RT_BUILD_LIBFUZZER=OFF
4545
-DZLIB_INCLUDE_DIR=-I${deps['zlib.net'].prefix}/include
46-
"-DZLIB_LIBRARY=-L${deps['zlib.net'].prefix}/lib -lz"
46+
"-DZLIB_LIBRARY=-L${deps['zlib.net'].prefix}/lib -lz"
47+
48+
# statically link against llvm’s own libc++ rather than dynamically against GNU libstdc++
49+
-DLLVM_ENABLE_LIBCXX=ON
50+
-DLLVM_STATIC_LINK_CXX_STDLIB=ON
4751
`;
4852

4953
extra_targets = "compiler-rt";

0 commit comments

Comments
 (0)