!252 llvm平行宇宙计划:修复使用clang构建遇到的错误

From: @chenxi-mao 
Reviewed-by: @xiezhipeng1 
Signed-off-by: @xiezhipeng1
This commit is contained in:
openeuler-ci-bot 2023-06-05 02:44:43 +00:00 committed by Gitee
commit 5f848e0a95
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -3,7 +3,7 @@ Summary: Interpreter of the Python3 programming language
URL: https://www.python.org/
Version: 3.10.9
Release: 3
Release: 4
License: Python-2.0
%global branchversion 3.10
@ -201,15 +201,26 @@ topdir=$(pwd)
%global optimizations_flag "--disable-optimizations"
%endif
%if "%toolchain" == "clang"
%global extension_cflags "-gdwarf-4"
%global extension_ldflags ""
%global build_ldflags ""
%global build_cflags "-gdwarf-4"
%else
%global extension_cflags ""
%global extension_ldflags ""
%endif
export CFLAGS="%{extension_cflags} -D_GNU_SOURCE -fPIC -fwrapv -fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2"
export CFLAGS_NODIST="%{build_cflags} -D_GNU_SOURCE -fPIC -fwrapv"
export CXXFLAGS="%{extension_cxxflags} -D_GNU_SOURCE -fPIC -fwrapv"
export CPPFLAGS="$(pkg-config --cflags-only-I libffi)"
export OPT="%{extension_cflags} -D_GNU_SOURCE -fPIC -fwrapv"
%if "%toolchain" == "clang"
export LINKCC="clang"
%else
export LINKCC="gcc"
%endif
export CFLAGS="$CFLAGS $(pkg-config --cflags openssl)"
export LDFLAGS="%{extension_ldflags} -g $(pkg-config --libs-only-L openssl)"
export LDFLAGS_NODIST="%{build_ldflags} -g $(pkg-config --libs-only-L openssl)"
@ -237,6 +248,9 @@ pushd ${DebugBuildDir}
--with-valgrind \
%endif
--without-ensurepip \
%if "%toolchain" == "gcc"
--with-lto \
%endif
--with-pydebug
%make_build EXTRA_CFLAGS="$CFLAGS -Og"
@ -266,7 +280,9 @@ pushd ${OptimizedBuildDir}
--with-valgrind \
%endif
--without-ensurepip \
%if "%toolchain" == "gcc"
--with-lto \
%endif
%{optimizations_flag}
%make_build EXTRA_CFLAGS="$CFLAGS"
@ -804,6 +820,12 @@ export BEP_GTDLIST="$BEP_GTDLIST_TMP"
%{_mandir}/*/*
%changelog
* Thu Jun 01 2023 Chenxi Mao <chenxi.mao@suse.com> - 3.10.9-4
- Type:enhancement
- CVE:NA
- SUG:NA
- DESC:Support build python via clang.
* Thu Apr 06 2023 shixuantong <shixuantong1@huawei.com> - 3.10.9-3
- Type:CVE
- CVE:CVE-2023-24329