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 .. \...@@ -38,7 +38,7 @@ cmake .. \
38 -DCMAKE_PREFIX_PATH="$PREFIX" \38 -DCMAKE_PREFIX_PATH="$PREFIX" \
39 -DCMAKE_BUILD_TYPE=Release \39 -DCMAKE_BUILD_TYPE=Release \
40 -DZIG_TARGET_TRIPLE="$ARCH-native-gnu" \40 -DZIG_TARGET_TRIPLE="$ARCH-native-gnu" \
41 -DZIG_TARGET_MCPU="x86_64_v2" \41 -DZIG_TARGET_MCPU="baseline" \
42 -DZIG_STATIC=ON42 -DZIG_STATIC=ON
4343
44# Now cmake will use zig as the C/C++ compiler. We reset the environment variables44# Now cmake will use zig as the C/C++ compiler. We reset the environment variables
...@@ -52,7 +52,7 @@ make $JOBS install...@@ -52,7 +52,7 @@ make $JOBS install
52# Here we rebuild zig but this time using the Zig binary we just now produced to52# Here we rebuild zig but this time using the Zig binary we just now produced to
53# build zig1.o rather than relying on the one built with stage0. See53# build zig1.o rather than relying on the one built with stage0. See
54# https://github.com/ziglang/zig/issues/6830 for more details.54# 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"
56make $JOBS install56make $JOBS install
5757
58release/bin/zig build test58release/bin/zig build test
ci/azure/windows_script+7-5
...@@ -25,18 +25,20 @@ git config core.abbrev 9...@@ -25,18 +25,20 @@ git config core.abbrev 9
25git fetch --unshallow || true25git fetch --unshallow || true
26git fetch --tags26git fetch --tags
2727
28export CC="$ZIG cc"28export CC="$ZIG cc -fno-sanitize=all -target x86_64-windows-gnu -mcpu=native"
29export CXX="$ZIG c++"29export CXX="$ZIG c++ -fno-sanitize=all -target x86_64-windows-gnu -mcpu=native"
3030
31mkdir build31mkdir build
32cd build32cd build
33cmake .. -DCMAKE_BUILD_TYPE=Release \33cmake .. -DCMAKE_BUILD_TYPE=Release \
34 "-DCMAKE_PREFIX_PATH=$PREFIX" \34 "-DCMAKE_PREFIX_PATH=$PREFIX" \
35 "-DCMAKE_INSTALL_PREFIX=$(pwd)/dist" \35 "-DCMAKE_INSTALL_PREFIX=$(pwd)/dist" \
36 -DCMAKE_CROSSCOMPILING=True \
37 -DCMAKE_SYSTEM_NAME="Windows" \
36 -DZIG_OMIT_STAGE2=ON \38 -DZIG_OMIT_STAGE2=ON \
37 -DZIG_STATIC=ON \39 -DZIG_STATIC=ON \
38 -DZIG_TARGET_TRIPLE="x86_64-native-gnu" \40 -DZIG_TARGET_TRIPLE="x86_64-windows-gnu" \
39 -DZIG_TARGET_MCPU="x86_64_v2" \41 -DZIG_TARGET_MCPU="baseline" \
40 -GNinja42 -GNinja
4143
42# Now cmake will use zig as the C/C++ compiler. We reset the environment variables44# Now cmake will use zig as the C/C++ compiler. We reset the environment variables
...@@ -49,7 +51,7 @@ ninja install...@@ -49,7 +51,7 @@ ninja install
49# Here we rebuild zig but this time using the Zig binary we just now produced to51# Here we rebuild zig but this time using the Zig binary we just now produced to
50# build zig1.o rather than relying on the one built with stage0. See52# build zig1.o rather than relying on the one built with stage0. See
51# https://github.com/ziglang/zig/issues/6830 for more details.53# 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"
53ninja install55ninja install
5456
5557
ci/srht/freebsd_script+21-1
...@@ -14,6 +14,13 @@ cd $HOME...@@ -14,6 +14,13 @@ cd $HOME
14wget -nv "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz"14wget -nv "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz"
15tar xf "$CACHE_BASENAME.tar.xz"15tar 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
17cd $ZIGDIR24cd $ZIGDIR
1825
19# Make the `zig version` number consistent.26# Make the `zig version` number consistent.
...@@ -35,8 +42,21 @@ cmake .. \...@@ -35,8 +42,21 @@ cmake .. \
35 "-DCMAKE_INSTALL_PREFIX=$(pwd)/release" \42 "-DCMAKE_INSTALL_PREFIX=$(pwd)/release" \
36 -DZIG_STATIC=ON \43 -DZIG_STATIC=ON \
37 -DZIG_TARGET_TRIPLE="x86_64-native-gnu" \44 -DZIG_TARGET_TRIPLE="x86_64-native-gnu" \
38 -DZIG_TARGET_MCPU="x86_64_v2" \45 -DZIG_TARGET_MCPU="baseline" \
39 -GNinja46 -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"
40samu install60samu install
4161
42# Here we skip some tests to save time.62# Here we skip some tests to save time.