Support build python3 via clang
1. Switch dwarf from 5 to 4 2. Disable LTO because rpm-configs doesn't ready for LTO 3. Switch toolchain to clang Signed-off-by: Chenxi Mao <chenxi.mao@suse.com>
This commit is contained in:
parent
3bd445c6ab
commit
057662df20
24
python3.spec
24
python3.spec
@ -3,7 +3,7 @@ Summary: Interpreter of the Python3 programming language
|
|||||||
URL: https://www.python.org/
|
URL: https://www.python.org/
|
||||||
|
|
||||||
Version: 3.10.9
|
Version: 3.10.9
|
||||||
Release: 3
|
Release: 4
|
||||||
License: Python-2.0
|
License: Python-2.0
|
||||||
|
|
||||||
%global branchversion 3.10
|
%global branchversion 3.10
|
||||||
@ -201,15 +201,26 @@ topdir=$(pwd)
|
|||||||
%global optimizations_flag "--disable-optimizations"
|
%global optimizations_flag "--disable-optimizations"
|
||||||
%endif
|
%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_cflags ""
|
||||||
%global extension_ldflags ""
|
%global extension_ldflags ""
|
||||||
|
%endif
|
||||||
|
|
||||||
export CFLAGS="%{extension_cflags} -D_GNU_SOURCE -fPIC -fwrapv -fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2"
|
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 CFLAGS_NODIST="%{build_cflags} -D_GNU_SOURCE -fPIC -fwrapv"
|
||||||
export CXXFLAGS="%{extension_cxxflags} -D_GNU_SOURCE -fPIC -fwrapv"
|
export CXXFLAGS="%{extension_cxxflags} -D_GNU_SOURCE -fPIC -fwrapv"
|
||||||
export CPPFLAGS="$(pkg-config --cflags-only-I libffi)"
|
export CPPFLAGS="$(pkg-config --cflags-only-I libffi)"
|
||||||
export OPT="%{extension_cflags} -D_GNU_SOURCE -fPIC -fwrapv"
|
export OPT="%{extension_cflags} -D_GNU_SOURCE -fPIC -fwrapv"
|
||||||
|
%if "%toolchain" == "clang"
|
||||||
|
export LINKCC="clang"
|
||||||
|
%else
|
||||||
export LINKCC="gcc"
|
export LINKCC="gcc"
|
||||||
|
%endif
|
||||||
export CFLAGS="$CFLAGS $(pkg-config --cflags openssl)"
|
export CFLAGS="$CFLAGS $(pkg-config --cflags openssl)"
|
||||||
export LDFLAGS="%{extension_ldflags} -g $(pkg-config --libs-only-L openssl)"
|
export LDFLAGS="%{extension_ldflags} -g $(pkg-config --libs-only-L openssl)"
|
||||||
export LDFLAGS_NODIST="%{build_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 \
|
--with-valgrind \
|
||||||
%endif
|
%endif
|
||||||
--without-ensurepip \
|
--without-ensurepip \
|
||||||
|
%if "%toolchain" == "gcc"
|
||||||
|
--with-lto \
|
||||||
|
%endif
|
||||||
--with-pydebug
|
--with-pydebug
|
||||||
|
|
||||||
%make_build EXTRA_CFLAGS="$CFLAGS -Og"
|
%make_build EXTRA_CFLAGS="$CFLAGS -Og"
|
||||||
@ -266,7 +280,9 @@ pushd ${OptimizedBuildDir}
|
|||||||
--with-valgrind \
|
--with-valgrind \
|
||||||
%endif
|
%endif
|
||||||
--without-ensurepip \
|
--without-ensurepip \
|
||||||
|
%if "%toolchain" == "gcc"
|
||||||
--with-lto \
|
--with-lto \
|
||||||
|
%endif
|
||||||
%{optimizations_flag}
|
%{optimizations_flag}
|
||||||
|
|
||||||
%make_build EXTRA_CFLAGS="$CFLAGS"
|
%make_build EXTRA_CFLAGS="$CFLAGS"
|
||||||
@ -804,6 +820,12 @@ export BEP_GTDLIST="$BEP_GTDLIST_TMP"
|
|||||||
%{_mandir}/*/*
|
%{_mandir}/*/*
|
||||||
|
|
||||||
%changelog
|
%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
|
* Thu Apr 06 2023 shixuantong <shixuantong1@huawei.com> - 3.10.9-3
|
||||||
- Type:CVE
|
- Type:CVE
|
||||||
- CVE:CVE-2023-24329
|
- CVE:CVE-2023-24329
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user