Compare commits

...

4 Commits

3 changed files with 123 additions and 72 deletions

View File

@ -1,12 +0,0 @@
--- gcc-13.1.1/libgomp/env.c.orig 2023-06-20 10:11:45.125868665 +0200
+++ gcc-13.1.1/libgomp/env.c 2023-06-20 10:04:18.089095860 +0200
@@ -2059,6 +2059,9 @@
none = gomp_get_initial_icv_item (GOMP_DEVICE_NUM_FOR_NO_SUFFIX);
initialize_icvs (&none->icvs);
+ if (environ == 0) fprintf(stderr, "FIXME: initialize_env: environ is not initialized\n");
+
+ if (environ != 0)
for (env = environ; *env != 0; env++)
{
if (!startswith (*env, "OMP_"))

View File

@ -0,0 +1,15 @@
Avoid leaking current data on generated file for Ada.
Index: gcc/ada/gcc-interface/Makefile.in
===================================================================
--- gcc/ada/gcc-interface/Makefile.in (revision 268977)
+++ gcc/ada/gcc-interface/Makefile.in (working copy)
@@ -2407,6 +2407,7 @@ $(RTSDIR)/s-oscons.ads: ../stamp-gnatlib
$(OSCONS_CPP) ; \
$(OSCONS_EXTRACT) ; \
../bldtools/oscons/xoscons s-oscons)
+ touch -r $(fsrcpfx)ada/gsocket.h $@
gnatlib: ../stamp-gnatlib1-$(RTSDIR) ../stamp-gnatlib2-$(RTSDIR) $(RTSDIR)/s-oscons.ads
test -f $(RTSDIR)/s-oscons.ads || exit 1

168
gcc.spec
View File

@ -14,7 +14,7 @@
%define _ld ld %define _ld ld
%endif %endif
%define gcc_ver %(echo %{version} | cut -d. -f 1-3) %define gcc_ver %(echo %{version} | cut -d+ -f1)
# use stage1 == 1 to have a gcc build not depending on # use stage1 == 1 to have a gcc build not depending on
# glibc library; this is usually the first needed step in # glibc library; this is usually the first needed step in
@ -30,14 +30,14 @@
# % define bootstrap_append -stage2 # % define bootstrap_append -stage2
#% endif #% endif
%define gittag %(echo %version | cut -d. -f5) %define gittag %(echo %version | cut -d+ -f2 | cut -d. -f2)
%define libstdcxx_name libstdc++6 %define libstdcxx_name libstdc++6
%define MAJver %(echo %version | cut -d. -f 1) %define MAJver %(echo %version | cut -d. -f 1)
%define majver %(echo %version | cut -d. -f 1-2) %define majver %(echo %version | cut -d. -f 1-2)
Name: gcc Name: gcc
Version: 14.2.0 Version: 15.1.1+20250606git.f59d33ad
Release: 1mamba Release: 1mamba
Summary: GNU Compiler Collection (C, C++, Fortran, Go, Ada) Summary: GNU Compiler Collection (C, C++, Fortran, Go, Ada)
Group: Applications/Development Group: Applications/Development
@ -45,10 +45,10 @@ Vendor: openmamba
Distribution: openmamba Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it> Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://gcc.gnu.org/ URL: https://gcc.gnu.org/
Source: https://ftp.gnu.org/gnu/gcc/gcc-%{version}/gcc-%{version}.tar.xz Source: https://gcc.gnu.org/git/gcc.git/releases%2Fgcc-15@%{gittag}/gcc-%{version}.tar.bz2
#Source: https://sourceware.org/git/gcc.git/releases%2Fgcc-14@%{gittag}/gcc-%{version}.tar.bz2 #Source: https://ftp.gnu.org/gnu/gcc/gcc-%{version}/gcc-%{version}.tar.xz
Patch0: gcc-10.1.0-arm-provide-futex-atomic-functions.patch Patch0: gcc-10.1.0-arm-provide-futex-atomic-functions.patch
Patch1: gcc-13.1.1-libgomp-workaround-null-environ.patch Patch1: gcc-14.2.1+20240909git.3951efed-ada-repro.patch
License: GPL License: GPL
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
## AUTOBUILDREQ-END ## AUTOBUILDREQ-END
@ -317,11 +317,11 @@ Requires: libgo-devel = %{version}-%{release}
The GNU compiler for the Go programming language. The GNU compiler for the Go programming language.
%package -n libgo %package -n libgo
Summary: Library for the Go programmi language Summary: Library for the Go programming language
Group: System/Libraries Group: System/Libraries
%description -n libgo %description -n libgo
Library for the Go programmi language. Library for the Go programming language.
%package -n libgo-devel %package -n libgo-devel
Summary: Development headers and static library for libgo Summary: Development headers and static library for libgo
@ -329,7 +329,7 @@ Group: Development/Libraries
Requires: libgo = %{version}-%{release} Requires: libgo = %{version}-%{release}
%description -n libgo-devel %description -n libgo-devel
Development files for the library for the Go programmi language. Development files for the library for the Go programming language.
# #
# Fortran 95 Libraries # Fortran 95 Libraries
@ -341,6 +341,36 @@ Group: System/Libraries
%description -n libgfortran %description -n libgfortran
This package contains Fortran 95 shared library which is needed to run Fortran 95 dynamically linked programs. This package contains Fortran 95 shared library which is needed to run Fortran 95 dynamically linked programs.
#
# Modula-2 compiler
#
%package m2
Summary: The GNU frontend for the Modula-2 programming language
Group: System/Libraries
Requires: libm2 = %{version}-%{release}
Requires: libm2-devel = %{version}-%{release}
%description m2
The GNU frontend for the Modula-2 programming language.
%package -n libm2
Summary: Library for the Modula-2 programming language
Group: System/Libraries
%description -n libm2
Library for the Modula-2 programming language.
%package -n libm2-devel
Summary: Development headers and static library for libm2
Group: Development/Libraries
Requires: libm2 = %{version}-%{release}
%description -n libm2-devel
Development files for the library for the Modula-2 programming language.
#
# Other libraries
#
%package -n libiberty-devel %package -n libiberty-devel
Summary: Development files for libiberty Summary: Development files for libiberty
Group: Development/Libraries Group: Development/Libraries
@ -580,18 +610,12 @@ AutoReqProv: no
Cross Platform gcc for %{_target_platform}. Cross Platform gcc for %{_target_platform}.
%if "%{_target_platform}" == "%{_host}" %if "%{_target_platform}" == "%{_host}"
%debug_package
%endif %endif
# Don't clean build at the end # Don't clean build at the end
%global __spec_rmbuild_cmd /bin/true %global __spec_rmbuild_cmd /bin/true
%prep %prep
#%if "%{git_commit_ver}" != "%{version}"
#echo "Needed to update git commit for gcc %{version}"
#exit 1
#%endif
%setup -q -n gcc-%{version}%{?gcc_extraver} %setup -q -n gcc-%{version}%{?gcc_extraver}
#-D -T #-D -T
#:<< ___EOF #:<< ___EOF
@ -601,19 +625,7 @@ Cross Platform gcc for %{_target_platform}.
%endif %endif
%patch 0 -p1 %patch 0 -p1
%patch 1 -p0 -b .ada-repro
%ifarch arm
%patch 1 -p1
## workaround for gcc-go
#cp libgo/go/internal/syscall/unix/{getrandom_linux_arm.go,dummy.go}
cat >> libgo/go/internal/syscall/unix/dummy.go << __EOF
const (
getrandomTrap uintptr = 384
copyFileRangeTrap uintptr = 391
)
__EOF
%endif
# Do not run fixincludes # Do not run fixincludes
sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
@ -632,13 +644,10 @@ cd ../%{name}-build-%{_target_platform}
slibdir=%{_libdir} slibdir=%{_libdir}
# BUILD_LANGUAGES is only used in final (not staged) build # BUILD_LANGUAGES is only used in final (not staged) build
BUILD_LANGUAGES=c,objc,lto,d BUILD_LANGUAGES=c,objc,lto,d,rust
# TODO: ada: configure: error: GNAT is required to build ada
%if "%{disable_cpp}" != "1" %if "%{disable_cpp}" != "1"
# Fortran won't build cross platform (?) BUILD_LANGUAGES="${BUILD_LANGUAGES},c++,obj-c++,m2"
BUILD_LANGUAGES="${BUILD_LANGUAGES},c++,obj-c++"
%endif %endif
%if "%{disable_fortran}" != "1" %if "%{disable_fortran}" != "1"
# Fortran won't build cross platform (?) # Fortran won't build cross platform (?)
@ -647,6 +656,14 @@ BUILD_LANGUAGES="${BUILD_LANGUAGES},fortran"
%if "%{disable_go}" != "1" %if "%{disable_go}" != "1"
BUILD_LANGUAGES="${BUILD_LANGUAGES},go" BUILD_LANGUAGES="${BUILD_LANGUAGES},go"
%endif %endif
#%if "%{disable_ada}" != "1"
#BUILD_LANGUAGES="${BUILD_LANGUAGES},ada"
## Bootstrap GNAT (ada) with prebuilt toolchains
## x86_64: https://github.com/alire-project/GNAT-FSF-builds/releases/download/gnat-14.2.0-1/gnat-x86_64-linux-14.2.0-1.tar.gz
## x86: https://community.download.adacore.com/v1/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=gnat-gpl-2014-x86-linux-bin.tar.gz&rand=1247
#export CC=~/gnat-x86_64-linux-14.2.0-1/bin/gcc
#export PATH=$PATH:~/gnat-x86_64-linux-14.2.0-1/bin
#%endif
case %{_target_platform} in case %{_target_platform} in
i386-*|i486-*|i586-*|i686-*|athlon-*) i386-*|i486-*|i586-*|i686-*|athlon-*)
@ -776,7 +793,22 @@ CROSS_SYSTEM_HEADER_DIR=/usr/%{_target_platform}/include \
%endif %endif
%else %else
make %{?_smp_mflags} CFLAGS="%{optflags}" CXXFLAGS="%{optflags}"
OPT_FLAGS="%{optflags}"
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=[123]//g'`
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=[123]//g'`
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/\(-Wp,\)\?-U_FORTIFY_SOURCE//g'`
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-flto=auto//g;s/-flto//g;s/-ffat-lto-objects//g'`
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-m64//g;s/-m32//g;s/-m31//g'`
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-mfpmath=sse/-mfpmath=sse -msse2/g'`
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/ -pipe / /g'`
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-fno-omit-frame-pointer//g;s/-mbackchain//g;s/-mno-omit-leaf-frame-pointer//g'`
OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-Werror=format-security/-Wformat-security/g'`
CXXFLAGS="`echo " $OPT_FLAGS " | sed 's/ -Wall / /g;s/ -fexceptions / /g' \
| sed 's/ -Wformat-security / -Wformat -Wformat-security /'`"
make %{?_smp_mflags} CFLAGS="${OPT_LFAGS}" CXXFLAGS="${CXXFLAGS}"
# CFLAGS='-O -I/usr/include/freetype2' LIBCFLAGS='-g -O2' \ # CFLAGS='-O -I/usr/include/freetype2' LIBCFLAGS='-g -O2' \
# LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap # LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap
%endif %endif
@ -897,30 +929,6 @@ rm -f %{buildroot}%{_infodir}/libquadmath.info*
%clean %clean
[ "%{buildroot}" != "/" ] && rm -rf "%{buildroot}" [ "%{buildroot}" != "/" ] && rm -rf "%{buildroot}"
%post -n libgcc -p /sbin/ldconfig
%postun -n libgcc -p /sbin/ldconfig
%post -n %{libstdcxx_name} -p /sbin/ldconfig
%postun -n %{libstdcxx_name} -p /sbin/ldconfig
%post -n libgdruntime -p /sbin/ldconfig
%postun -n libgdruntime -p /sbin/ldconfig
%post -n libgfortran -p /sbin/ldconfig
%postun -n libgfortran -p /sbin/ldconfig
%post -n libquadmath -p /sbin/ldconfig
%postun -n libquadmath -p /sbin/ldconfig
%post -n libatomic -p /sbin/ldconfig
%postun -n libatomic -p /sbin/ldconfig
%post -n libasan -p /sbin/ldconfig
%postun -n libasan -p /sbin/ldconfig
%post -n liblsan -p /sbin/ldconfig
%postun -n liblsan -p /sbin/ldconfig
%post doc %post doc
%install_info cppinternals.info %install_info cppinternals.info
%install_info gcc.info %install_info gcc.info
@ -958,6 +966,7 @@ rm -f %{buildroot}%{_infodir}/libquadmath.info*
%{_bindir}/lto-dump %{_bindir}/lto-dump
%{_bindir}/%{_target_platform}-cc %{_bindir}/%{_target_platform}-cc
%{_bindir}/%{_target_platform}-gcc %{_bindir}/%{_target_platform}-gcc
%{_bindir}/%{_target_platform}-gcc-%{gcc_ver}
%{_bindir}/%{_target_platform}-gcc-ar %{_bindir}/%{_target_platform}-gcc-ar
%{_bindir}/%{_target_platform}-gcc-nm %{_bindir}/%{_target_platform}-gcc-nm
%{_bindir}/%{_target_platform}-gcc-ranlib %{_bindir}/%{_target_platform}-gcc-ranlib
@ -1138,13 +1147,14 @@ rm -f %{buildroot}%{_infodir}/libquadmath.info*
%files -n %{libstdcxx_name}-devel %files -n %{libstdcxx_name}-devel
%defattr(-,root,root) %defattr(-,root,root)
%dir %{_includedir}/c++
%{_includedir}/c++/*
%{_libdir}/libstdc++.a %{_libdir}/libstdc++.a
%{_libdir}/libstdc++exp.a %{_libdir}/libstdc++exp.a
%{_libdir}/libstdc++.so %{_libdir}/libstdc++.so
%{_libdir}/libsupc++.a %{_libdir}/libsupc++.a
%{_libdir}/libstdc++fs.a %{_libdir}/libstdc++fs.a
%dir %{_includedir}/c++ %{_libdir}/libstdc++.modules.json
%{_includedir}/c++/*
#%doc libstdc++-v3/{ChangeLog*,README*,doc/html/} #%doc libstdc++-v3/{ChangeLog*,README*,doc/html/}
%endif %endif
@ -1226,6 +1236,31 @@ rm -f %{buildroot}%{_infodir}/libquadmath.info*
%{_libdir}/libgolibbegin.a %{_libdir}/libgolibbegin.a
%endif %endif
%files m2
%defattr(-,root,root)
%{_bindir}/gccrs
%{_bindir}/gm2
%{_bindir}/%{_target_platform}-gccrs
%{_bindir}/%{_target_platform}-gm2
%{_infodir}/m2.info.gz
%{_mandir}/man1/gm2.1*
%files -n libm2
%defattr(-,root,root)
%ifarch x86_64
%{_prefix}/lib32/libm2*.so.*
%endif
%{_libdir}/libm2*.so.*
%files -n libm2-devel
%defattr(-,root,root)
%ifarch x86_64
%{_prefix}/lib32/libm2*.a
%{_prefix}/lib32/libm2*.so
%endif
%{_libdir}/libm2*.a
%{_libdir}/libm2*.so
%files doc %files doc
%defattr(-,root,root) %defattr(-,root,root)
%{_infodir}/cpp.info.* %{_infodir}/cpp.info.*
@ -1260,6 +1295,7 @@ rm -f %{buildroot}%{_infodir}/libquadmath.info*
%{_prefix}/lib32/libstdc++.so %{_prefix}/lib32/libstdc++.so
%{_prefix}/lib32/libstdc++.so.* %{_prefix}/lib32/libstdc++.so.*
%{_prefix}/lib32/libstdc++fs.*a %{_prefix}/lib32/libstdc++fs.*a
%{_prefix}/lib32/libstdc++.modules.json
# #
%{_prefix}/lib32/libasan.a %{_prefix}/lib32/libasan.a
%{_prefix}/lib32/libasan.so %{_prefix}/lib32/libasan.so
@ -1350,6 +1386,18 @@ rm -f %{buildroot}%{_infodir}/libquadmath.info*
%endif %endif
%changelog %changelog
* Fri Jun 06 2025 Silvan Calarco <silvan.calarco@mambasoft.it> 15.1.1+20250606git.f59d33ad-1mamba
- update to 15.1.1+20250606git.f59d33ad
* Sun May 25 2025 Silvan Calarco <silvan.calarco@mambasoft.it> 15.1.0-1mamba
- update to 15.1.0
* Sat Oct 05 2024 Silvan Calarco <silvan.calarco@mambasoft.it> 14.2.1+20240909git.3951efed-2mamba
- enable more languages: m2, rust
* Mon Sep 09 2024 Silvan Calarco <silvan.calarco@mambasoft.it> 14.2.1+20240909git.3951efed-1mamba
- update to 14.2.1+20240909git.3951efed
* Tue Aug 13 2024 Automatic Build System <autodist@openmamba.org> 14.2.0-1mamba * Tue Aug 13 2024 Automatic Build System <autodist@openmamba.org> 14.2.0-1mamba
- automatic version update by autodist - automatic version update by autodist