authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-04-15 00:18:21-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-04-15 00:18:21-07:00
logc59241bda00376b5a6ee20ca52358329b7482f7f
tree7aad79d042ab738054c337cf99ea0f1546914756
parent553fbeba825653da8be8040be1c0b4d4fe025066

ci: better handle of -mcpu


3 files changed, 30 insertions(+), 8 deletions(-)

ci/azure/macos_script+2-2
......@@ -38,7 +38,7 @@ cmake .. \
3838 -DCMAKE_PREFIX_PATH="$PREFIX" \
3939 -DCMAKE_BUILD_TYPE=Release \
4040 -DZIG_TARGET_TRIPLE="$ARCH-native-gnu" \
41 -DZIG_TARGET_MCPU="x86_64_v2" \
41 -DZIG_TARGET_MCPU="baseline" \
4242 -DZIG_STATIC=ON
4343
4444# Now cmake will use zig as the C/C++ compiler. We reset the environment variables
......@@ -52,7 +52,7 @@ make $JOBS install
5252# Here we rebuild zig but this time using the Zig binary we just now produced to
5353# build zig1.o rather than relying on the one built with stage0. See
5454# https://github.com/ziglang/zig/issues/6830 for more details.
55cmake .. -DZIG_EXECUTABLE="$(pwd)/release/bin/zig"
55cmake .. -DZIG_EXECUTABLE="$(pwd)/release/bin/zig" -DZIG_TARGET_MCPU="x86_64_v2"
5656make $JOBS install
5757
5858release/bin/zig build test
ci/azure/windows_script+7-5
......@@ -25,18 +25,20 @@ git config core.abbrev 9
2525git fetch --unshallow || true
2626git fetch --tags
2727
28export CC="$ZIG cc"
29export CXX="$ZIG c++"
28export CC="$ZIG cc -fno-sanitize=all -target x86_64-windows-gnu -mcpu=native"
29export CXX="$ZIG c++ -fno-sanitize=all -target x86_64-windows-gnu -mcpu=native"
3030
3131mkdir build
3232cd build
3333cmake .. -DCMAKE_BUILD_TYPE=Release \
3434 "-DCMAKE_PREFIX_PATH=$PREFIX" \
3535 "-DCMAKE_INSTALL_PREFIX=$(pwd)/dist" \
36 -DCMAKE_CROSSCOMPILING=True \
37 -DCMAKE_SYSTEM_NAME="Windows" \
3638 -DZIG_OMIT_STAGE2=ON \
3739 -DZIG_STATIC=ON \
38 -DZIG_TARGET_TRIPLE="x86_64-native-gnu" \
39 -DZIG_TARGET_MCPU="x86_64_v2" \
40 -DZIG_TARGET_TRIPLE="x86_64-windows-gnu" \
41 -DZIG_TARGET_MCPU="baseline" \
4042 -GNinja
4143
4244# Now cmake will use zig as the C/C++ compiler. We reset the environment variables
......@@ -49,7 +51,7 @@ ninja install
4951# Here we rebuild zig but this time using the Zig binary we just now produced to
5052# build zig1.o rather than relying on the one built with stage0. See
5153# https://github.com/ziglang/zig/issues/6830 for more details.
52cmake .. -DZIG_EXECUTABLE="$(pwd)/dist/bin/zig.exe"
54cmake .. -DZIG_EXECUTABLE="$(pwd)/dist/bin/zig.exe" -DZIG_TARGET_MCPU="x86_64_v2"
5355ninja install
5456
5557
ci/srht/freebsd_script+21-1
......@@ -14,6 +14,13 @@ cd $HOME
1414wget -nv "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz"
1515tar xf "$CACHE_BASENAME.tar.xz"
1616
17ZIG="$PREFIX/bin/zig"
18NATIVE_LIBC_TXT="$HOME/native_libc.txt"
19$ZIG libc > "$NATIVE_LIBC_TXT"
20export ZIG_LIBC="$NATIVE_LIBC_TXT"
21export CC="$ZIG cc"
22export CXX="$ZIG c++"
23
1724cd $ZIGDIR
1825
1926# Make the `zig version` number consistent.
......@@ -35,8 +42,21 @@ cmake .. \
3542 "-DCMAKE_INSTALL_PREFIX=$(pwd)/release" \
3643 -DZIG_STATIC=ON \
3744 -DZIG_TARGET_TRIPLE="x86_64-native-gnu" \
38 -DZIG_TARGET_MCPU="x86_64_v2" \
45 -DZIG_TARGET_MCPU="baseline" \
3946 -GNinja
47
48# Now cmake will use zig as the C/C++ compiler. We reset the environment variables
49# so that installation and testing do not get affected by them.
50unset CC
51unset CXX
52unset ZIG_LIBC
53
54samu install
55
56# Here we rebuild zig but this time using the Zig binary we just now produced to
57# build zig1.o rather than relying on the one built with stage0. See
58# https://github.com/ziglang/zig/issues/6830 for more details.
59cmake .. -DZIG_EXECUTABLE="$(pwd)/release/bin/zig" -DZIG_TARGET_MCPU="x86_64_v2"
4060samu install
4161
4262# Here we skip some tests to save time.