win build fix 4
This commit is contained in:
13
patches/mingw/clang-cpuidex.patch
Normal file
13
patches/mingw/clang-cpuidex.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/include/psdk_inc/intrin-impl.h b/include/psdk_inc/intrin-impl.h
|
||||
index 0267f93a2..0c9db2e6a 100644
|
||||
--- a/include/psdk_inc/intrin-impl.h
|
||||
+++ b/include/psdk_inc/intrin-impl.h
|
||||
@@ -2016,7 +2016,7 @@ void __cpuid(int CPUInfo[4], int InfoType) {
|
||||
#define __INTRINSIC_DEFINED___cpuid
|
||||
#endif /* __INTRINSIC_PROLOG */
|
||||
|
||||
-#if (!defined(__GNUC__) || __GNUC__ < 11)
|
||||
+#if (!defined(__GNUC__) || __GNUC__ < 11) && !defined(__clang__)
|
||||
#if __INTRINSIC_PROLOG(__cpuidex)
|
||||
void __cpuidex(int CPUInfo[4], int, int);
|
||||
#if !__has_builtin(__cpuidex)
|
||||
@@ -26,6 +26,14 @@ flags_datetime="-D__DATE__=\"\\\"$CURRENT_DATE\\\"\" -D__TIME__=\"\\\"$CURRENT_T
|
||||
MINGW_SYSROOT="$(x86_64-w64-mingw32-g++ -print-sysroot)"
|
||||
flags_sysroot="--sysroot=$MINGW_SYSROOT"
|
||||
|
||||
# Fix mingw-w64 headers for clang: skip redefining __cpuidex when clang already
|
||||
# provides one via its cpuid.h.
|
||||
if [ -f "$PATCH_DIR/mingw/clang-cpuidex.patch" ]; then
|
||||
cd "$MINGW_SYSROOT"
|
||||
patch -N -p1 < "$PATCH_DIR/mingw/clang-cpuidex.patch" || true
|
||||
cd /p2pool
|
||||
fi
|
||||
|
||||
flags_libs="--target=x86_64-pc-windows-gnu $flags_sysroot -Os -flto -Wl,/timestamp:$BUILD_TIMESTAMP -fuse-ld=lld -w $flags_size $flags_datetime"
|
||||
|
||||
flags_p2pool="--target=x86_64-pc-windows-gnu $flags_sysroot -Wl,/timestamp:$BUILD_TIMESTAMP -fuse-ld=lld -femulated-tls -Wno-unused-command-line-argument -Wno-unknown-attributes $flags_size $flags_datetime"
|
||||
|
||||
Reference in New Issue
Block a user