Skip to content

Commit 346c3b0

Browse files
committed
address review feedback
Signed-off-by: Joel Dice <[email protected]>
1 parent 4ffc23d commit 346c3b0

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

eng/native/gen-buildsys.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ for i in "${@:6}"; do
5959
esac
6060
done
6161

62-
cmake_extra_defines=()
62+
cmake_extra_defines=
6363
if [[ "$CROSSCOMPILE" == "1" ]]; then
6464
platform="$(uname -s | tr '[:upper:]' '[:lower:]')"
6565
# OSX doesn't use rootfs
@@ -71,17 +71,17 @@ if [[ "$CROSSCOMPILE" == "1" ]]; then
7171
TARGET_BUILD_ARCH="$host_arch"
7272
export TARGET_BUILD_ARCH
7373

74-
cmake_extra_defines+=("-C" "$scriptroot/tryrun.cmake")
74+
cmake_extra_defines="$cmake_extra_defines -C $scriptroot/tryrun.cmake"
7575

7676
if [[ "$platform" == "darwin" ]]; then
77-
cmake_extra_defines+=("-DCMAKE_SYSTEM_NAME=Darwin")
77+
cmake_extra_defines="$cmake_extra_defines -DCMAKE_SYSTEM_NAME=Darwin"
7878
else
79-
cmake_extra_defines+=("-DCMAKE_TOOLCHAIN_FILE=$scriptroot/../common/cross/toolchain.cmake")
79+
cmake_extra_defines="$cmake_extra_defines -DCMAKE_TOOLCHAIN_FILE=$scriptroot/../common/cross/toolchain.cmake"
8080
fi
8181
fi
8282

8383
if [[ "$host_arch" == "armel" ]]; then
84-
cmake_extra_defines+=("-DARM_SOFTFP=1")
84+
cmake_extra_defines="$cmake_extra_defines -DARM_SOFTFP=1"
8585
fi
8686

8787
if ! cmake_command=$(command -v cmake); then
@@ -93,6 +93,7 @@ if [[ "$scan_build" == "ON" && -n "$SCAN_BUILD_COMMAND" ]]; then
9393
cmake_command="$SCAN_BUILD_COMMAND $cmake_command"
9494
fi
9595

96+
cmake_extra_defines_wasm=()
9697
if [[ "$host_arch" == "wasm" ]]; then
9798
if [[ "$target_os" == "browser" ]]; then
9899
cmake_command="emcmake $cmake_command"
@@ -102,7 +103,7 @@ if [[ "$host_arch" == "wasm" ]]; then
102103
exit 1
103104
fi
104105

105-
cmake_extra_defines+=("-DCLR_CMAKE_TARGET_OS=wasi" "-DCLR_CMAKE_TARGET_ARCH=wasm" "-DWASI_SDK_PREFIX=$WASI_SDK_PATH" "-DCMAKE_TOOLCHAIN_FILE=$WASI_SDK_PATH/share/cmake/wasi-sdk.cmake" "-DCMAKE_CROSSCOMPILING_EMULATOR=node --experimental-wasm-bigint --experimental-wasi-unstable-preview1")
106+
cmake_extra_defines_wasm=("-DCLR_CMAKE_TARGET_OS=wasi" "-DCLR_CMAKE_TARGET_ARCH=wasm" "-DWASI_SDK_PREFIX=$WASI_SDK_PATH" "-DCMAKE_TOOLCHAIN_FILE=$WASI_SDK_PATH/share/cmake/wasi-sdk.cmake" "-DCMAKE_CROSSCOMPILING_EMULATOR=node --experimental-wasm-bigint --experimental-wasi-unstable-preview1")
106107
else
107108
echo "target_os was not specified"
108109
exit 1
@@ -114,7 +115,8 @@ $cmake_command \
114115
-G "$generator" \
115116
"-DCMAKE_BUILD_TYPE=$buildtype" \
116117
"-DCMAKE_INSTALL_PREFIX=$__CMakeBinDir" \
117-
"${cmake_extra_defines[@]}" \
118+
$cmake_extra_defines \
119+
"${cmake_extra_defines_wasm[@]}" \
118120
$__UnprocessedCMakeArgs \
119121
-S "$1" \
120122
-B "$2"

src/coreclr/jit/llvmlssa.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,8 +1636,10 @@ class ShadowStackAllocator
16361636
template <typename... TArgs>
16371637
void PrintFormatted(char** pBuffer, const char* format, TArgs... args)
16381638
{
1639+
#ifdef __clang__
16391640
#pragma clang diagnostic push
16401641
#pragma clang diagnostic ignored "-Wformat-security"
1642+
#endif // __clang__
16411643
if (pBuffer == nullptr)
16421644
{
16431645
printf(format, args...);
@@ -1646,7 +1648,9 @@ class ShadowStackAllocator
16461648
{
16471649
*pBuffer += sprintf(*pBuffer, format, args...);
16481650
}
1651+
#ifdef __clang__
16491652
#pragma clang diagnostic pop
1653+
#endif // __clang__
16501654
}
16511655

16521656
void PrintAction(const AllocationAction& action, char** pBuffer = nullptr)

src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,8 @@ The .NET Foundation licenses this file to you under the MIT license.
391391
Condition="'$(EMSDK)' == '' and '$(_targetOS)' == 'browser'" />
392392
<Error Text="Wasi SDK not found, not compiling to WebAssembly. To enable WebAssembly compilation, install Wasi SDK and ensure the WASI_SDK_PATH environment variable points to the directory containing share/wasi-sysroot"
393393
Condition="'$(WASI_SDK_PATH)' == '' and '$(_targetOS)' == 'wasi'" />
394+
<Warning Text="The WASI SDK version is too low. Please use WASI SDK 22 or newer with a 64 bit Clang."
395+
Condition="!Exists('$(WASI_SDK_PATH)/VERSION')" />
394396
</Target>
395397

396398
<Target Name="CompileWasmObjects"

0 commit comments

Comments
 (0)