From 6fe50d71712a276759630e52cc1366e017b77432 Mon Sep 17 00:00:00 2001 From: xwx1135370 Date: Fri, 30 Aug 2024 14:46:19 +0800 Subject: [PATCH] [R&D][Build][Windows] Fix windows platform compilation failure Issue:https://gitee.com/openharmony/third_party_llvm-project/issues/IANNB9 Test: Compile LLVM toolchain for Windows platform Signed-off-by: xwx1135370 --- llvm-build/MakeLiblzma | 2 +- llvm-build/build.py | 4 +--- llvm-build/python_builder.py | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/llvm-build/MakeLiblzma b/llvm-build/MakeLiblzma index 681fa4e1304f..157d73ae3637 100644 --- a/llvm-build/MakeLiblzma +++ b/llvm-build/MakeLiblzma @@ -25,7 +25,7 @@ LDFLAGS := -shared -fuse-ld=lld -Wl,-z,relro,-z,now -Wl,-z,noexecstack TARGET := liblzma.so else ifeq ($(TARGET_TRIPLE),windows-x86_64) -CFLAGS := --target=x86_64-pc-windows-gnu --sysroot=$(SYSROOT) -D_7ZIP_ST -Wall -Werror -Wno-empty-body -Wno-enum-conversion -Wno-logical-op-parentheses -Wno-self-assign -fPIC -fstack-protector-strong +CFLAGS := --target=x86_64-pc-windows-gnu --sysroot=$(SYSROOT) -D_7ZIP_ST -Wall -Werror -Wno-empty-body -Wno-enum-conversion -Wno-logical-op-parentheses -Wno-self-assign -fPIC LDFLAGS := -shared -fuse-ld=lld --rtlib=compiler-rt -Wl,--out-implib=liblzma.dll.a TARGET := liblzma.dll TARGET_A := liblzma.dll.a diff --git a/llvm-build/build.py b/llvm-build/build.py index e7d073143120..90c454453b99 100755 --- a/llvm-build/build.py +++ b/llvm-build/build.py @@ -1161,8 +1161,7 @@ class LlvmCore(BuildUtils): '-Wl,--high-entropy-va'] ldflags.extend(ldflag) - cflag = ['-fstack-protector-strong', - '-stdlib=libc++', + cflag = ['-stdlib=libc++', '--target=x86_64-pc-windows-gnu', '-fdata-sections', '-D_LARGEFILE_SOURCE', @@ -2227,7 +2226,6 @@ class LlvmLibs(BuildUtils): cflags = ['--target=x86_64-pc-windows-gnu'] cflags.extend(('-I', os.path.join(windows_sysroot, 'include'))) - cflags.append('-fstack-protector-strong') ldflags = ['-fuse-ld=lld', '--rtlib=compiler-rt'] diff --git a/llvm-build/python_builder.py b/llvm-build/python_builder.py index 92190baac7b8..e7f8e26c04db 100755 --- a/llvm-build/python_builder.py +++ b/llvm-build/python_builder.py @@ -225,7 +225,6 @@ class MinGWPythonBuilder(PythonBuilder): cflags = [ f'-target {self.target_platform}', f'--sysroot={self._mingw_install_dir}', - f'-fstack-protector-strong', ] return cflags -- Gitee