diff --git a/python3.spec b/python3.spec index 59952e4cc7f90a6d9b8e70966a41275ea372fee7..d1f7d4c7f8dab185e9df5173081031cd12067bc5 100644 --- a/python3.spec +++ b/python3.spec @@ -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 - 3.10.9-4 +- Type:enhancement +- CVE:NA +- SUG:NA +- DESC:Support build python via clang. + * Thu Apr 06 2023 shixuantong - 3.10.9-3 - Type:CVE - CVE:CVE-2023-24329