!183 [SPEC] Add support for libgccjit
From: @mmzzmm Reviewed-by: @eastb233 Signed-off-by: @eastb233
This commit is contained in:
commit
5d8f974a90
81
gcc.spec
81
gcc.spec
@ -61,7 +61,7 @@
|
||||
Summary: Various compilers (C, C++, Objective-C, ...)
|
||||
Name: gcc
|
||||
Version: %{gcc_version}
|
||||
Release: 11
|
||||
Release: 12
|
||||
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
|
||||
URL: https://gcc.gnu.org
|
||||
|
||||
@ -357,6 +357,21 @@ Requires: gcc = %{version}-%{release}
|
||||
%description gdb-plugin
|
||||
This package contains GCC plugin for GDB C expression evaluation.
|
||||
|
||||
%package -n libgccjit
|
||||
Summary: Library for embedding GCC inside programs and libraries
|
||||
Requires: gcc = %{version}-%{release}
|
||||
|
||||
%description -n libgccjit
|
||||
This package contains shared library with GCC JIT front-end.
|
||||
|
||||
%package -n libgccjit-devel
|
||||
Summary: Support for embedding GCC inside programs and libraries
|
||||
BuildRequires: python3-sphinx
|
||||
Requires: libgccjit = %{version}-%{release}
|
||||
|
||||
%description -n libgccjit-devel
|
||||
This package contains header files and documentation for GCC JIT front-end.
|
||||
|
||||
%package -n libquadmath
|
||||
Summary: GCC __float128 shared support library
|
||||
|
||||
@ -715,6 +730,41 @@ make %{?_smp_mflags} BOOT_CFLAGS="$OPT_FLAGS" bootstrap
|
||||
make %{?_smp_mflags} BOOT_CFLAGS="$OPT_FLAGS" BOOT_LDFLAGS="-pie -Wl,-z,relro,-z,now"
|
||||
%endif
|
||||
|
||||
# Build libgccjit separately, so that normal compiler binaries aren't -fpic
|
||||
# unnecessarily.
|
||||
mkdir objlibgccjit
|
||||
cd objlibgccjit
|
||||
CC="$CC" CXX="$CXX" CFLAGS="$OPT_FLAGS" \
|
||||
CXXFLAGS="`echo " $OPT_FLAGS " | sed 's/ -Wall / /g;s/ -fexceptions / /g' \
|
||||
| sed 's/ -Wformat-security / -Wformat -Wformat-security /'`" \
|
||||
XCFLAGS="$OPT_FLAGS" TCFLAGS="$OPT_FLAGS" \
|
||||
../../configure --disable-bootstrap --enable-host-shared \
|
||||
--enable-languages=jit \
|
||||
%ifarch x86_64
|
||||
--with-tune=generic \
|
||||
--with-arch_32=x86-64 \
|
||||
--disable-multilib
|
||||
%endif
|
||||
%ifarch aarch64
|
||||
--with-multilib-list=lp64 \
|
||||
--enable-bolt
|
||||
%endif
|
||||
%ifarch riscv64
|
||||
--with-arch=rv64g --with-abi=lp64d \
|
||||
--disable-libquadmath --disable-multilib
|
||||
%endif
|
||||
make %{?_smp_mflags} BOOT_CFLAGS="$OPT_FLAGS" all-gcc
|
||||
cp -a gcc/libgccjit.so* ../gcc/
|
||||
cd ../gcc/
|
||||
ln -sf xgcc %{gcc_target_platform}-gcc-%{gcc_major}
|
||||
cp -a Makefile{,.orig}
|
||||
sed -i -e '/^CHECK_TARGETS/s/$/ check-jit/' Makefile
|
||||
touch -r Makefile.orig Makefile
|
||||
rm Makefile.orig
|
||||
make jit.sphinx.html
|
||||
make jit.sphinx.install-html jit_htmldir=`pwd`/../../rpm.doc/libgccjit-devel/html
|
||||
cd ..
|
||||
|
||||
# Make generated man pages even if Pod::Man is not new enough
|
||||
perl -pi -e 's/head3/head2/' ../contrib/texi2pod.pl
|
||||
for i in ../gcc/doc/*.texi; do
|
||||
@ -735,9 +785,9 @@ cd ../..
|
||||
cd ..
|
||||
mkdir -p rpm.doc/gfortran rpm.doc/objc rpm.doc/gdc rpm.doc/libphobos
|
||||
mkdir -p rpm.doc/go rpm.doc/libgo rpm.doc/libquadmath rpm.doc/libitm
|
||||
mkdir -p rpm.doc/changelogs/{gcc/cp,gcc/ada,libstdc++-v3,libobjc,libgomp,libcc1,libatomic,libsanitizer}
|
||||
mkdir -p rpm.doc/changelogs/{gcc/cp,gcc/ada,gcc/jit,libstdc++-v3,libobjc,libgomp,libcc1,libatomic,libsanitizer}
|
||||
|
||||
for i in {gcc,gcc/cp,gcc/ada,libstdc++-v3,libobjc,libgomp,libcc1,libatomic,libsanitizer}/ChangeLog*; do
|
||||
for i in {gcc,gcc/cp,gcc/ada,gcc/jit,libstdc++-v3,libobjc,libgomp,libcc1,libatomic,libsanitizer}/ChangeLog*; do
|
||||
cp -p $i rpm.doc/changelogs/$i
|
||||
done
|
||||
|
||||
@ -988,6 +1038,12 @@ done
|
||||
touch -r hook.in %{buildroot}%{_datadir}/gdb/auto-load/%{_prefix}/%{_lib}/libstdc++*gdb.py
|
||||
popd
|
||||
|
||||
rm -f $FULLEPATH/libgccjit.so
|
||||
cp -a objlibgccjit/gcc/libgccjit.so* %{buildroot}%{_prefix}/%{_lib}/
|
||||
cp -a ../gcc/jit/libgccjit*.h %{buildroot}%{_prefix}/include/
|
||||
/usr/bin/install -c -m 644 objlibgccjit/gcc/doc/libgccjit.info %{buildroot}/%{_infodir}/
|
||||
gzip -9 %{buildroot}/%{_infodir}/libgccjit.info
|
||||
|
||||
pushd $FULLPATH
|
||||
if [ "%{_lib}" = "lib" ]; then
|
||||
%if %{build_objc}
|
||||
@ -1599,6 +1655,8 @@ end
|
||||
|
||||
%ldconfig_scriptlets gdb-plugin
|
||||
|
||||
%ldconfig_scriptlets -n libgccjit
|
||||
|
||||
%ldconfig_scriptlets -n libgquadmath
|
||||
|
||||
%ldconfig_scriptlets -n libitm
|
||||
@ -2568,6 +2626,17 @@ end
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%files -n libgccjit
|
||||
%{_prefix}/%{_lib}/libgccjit.so.*
|
||||
%doc rpm.doc/changelogs/gcc/jit/ChangeLog*
|
||||
|
||||
%files -n libgccjit-devel
|
||||
%{_prefix}/%{_lib}/libgccjit.so
|
||||
%{_prefix}/include/libgccjit*.h
|
||||
%{_infodir}/libgccjit.info*
|
||||
%doc rpm.doc/libgccjit-devel/*
|
||||
%doc gcc/jit/docs/examples
|
||||
|
||||
%files plugin-devel
|
||||
%dir %{_prefix}/lib/gcc
|
||||
%dir %{_prefix}/lib/gcc/%{gcc_target_platform}
|
||||
@ -2591,6 +2660,12 @@ end
|
||||
%doc rpm.doc/changelogs/libcc1/ChangeLog*
|
||||
|
||||
%changelog
|
||||
* Fri Jul 08 2022 zhaomengmeng <zhaomengmeng@kylinos.cn> - 10.3.1-12
|
||||
- Type:SPEC
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:Enable libgccjit
|
||||
|
||||
* Fri May 6 2022 liyancheng <412998149@qq.com> - 10.3.1-11
|
||||
- Type:Sync
|
||||
- ID:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user