tweak llvm+rust

This commit is contained in:
Max Howell 2022-08-27 11:58:16 -04:00
parent 4f7bce0f85
commit ba3dbb1122
2 changed files with 15 additions and 19 deletions

View file

@ -19,20 +19,6 @@ build:
python.org: 3 python.org: 3
working-directory: build working-directory: build
script: |- script: |-
if test {{ hw.target }} = x86_64-unknown-linux-gnu; then
# required to build something that works on linux/x86-64
ARGS="$ARGS
-DCLANG_DEFAULT_CXX_STDLIB=libstdc++
-DCLANG_DEFAULT_RTLIB=libgcc
-DCOMPILER_RT_INCLUDE_TESTS=OFF
-DCOMPILER_RT_USE_LIBCXX=OFF"
fi
# without this macOS programs typically wont link to core symbols
if test {{ hw.platform }} = darwin; then
ARGS="$ARGS -DDEFAULT_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
fi
cmake \ cmake \
../llvm \ ../llvm \
-G Ninja \ -G Ninja \
@ -71,9 +57,17 @@ build:
- -DLLVM_ENABLE_PROJECTS='lld;clang' - -DLLVM_ENABLE_PROJECTS='lld;clang'
- -DLLVM_INCLUDE_DOCS=OFF - -DLLVM_INCLUDE_DOCS=OFF
- -DLLVM_INCLUDE_TESTS=OFF - -DLLVM_INCLUDE_TESTS=OFF
# without this deno wont build on darwin/aarch64 # the default is `ld` however clang when handling linking itself
# with it nothing seems to break # internally passes flags that, in fact, expect `lld`
#NOTE yes this is an issue even if `ld` is in fact a symlink to `lld`
- -DCLANG_DEFAULT_LINKER=lld - -DCLANG_DEFAULT_LINKER=lld
linux/x86-64:
ARGS:
# required to build something that works on linux/x86-64
- -DCLANG_DEFAULT_CXX_STDLIB=libstdc++
- -DCLANG_DEFAULT_RTLIB=libgcc
- -DCOMPILER_RT_INCLUDE_TESTS=OFF
- -DCOMPILER_RT_USE_LIBCXX=OFF"
test: test:
fixture: | fixture: |
#include <stdio.h> #include <stdio.h>

View file

@ -45,6 +45,7 @@ build:
./configure $ARGS ./configure $ARGS
make install make install
mv ./build/{{ hw.target }}/stage0/bin/cargo {{ prefix }}/bin/cargo mv ./build/{{ hw.target }}/stage0/bin/cargo {{ prefix }}/bin/cargo
rm -rf {{prefix}}/share/doc
#TODO ^^ build cargo properly #TODO ^^ build cargo properly
env: env:
ARGS: ARGS:
@ -52,6 +53,7 @@ build:
- --prefix={{ prefix }} - --prefix={{ prefix }}
- --enable-ninja - --enable-ninja
- --enable-optimize - --enable-optimize
- --disable-docs # docs are online
test: test:
script: | script: |
rustc $FIXTURE -o hello rustc $FIXTURE -o hello