File newlib.spec.patch of Package newlib
--- org/newlib.spec 2024-09-26 16:11:03.812392641 +0200
+++ new/newlib.spec 2024-09-26 16:15:38.773588007 +0200
@@ -15,6 +15,11 @@
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
+# Compatible to the configuration of the corepondig package for arch linux
+%define arch_compat 1
+
+# Force the same gcc is used for arm builds
+%define gcc_version 11
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == ""
@@ -54,6 +59,8 @@
Patch1: epiphany-fixes.diff
%if "%{flavor}" == ""
BuildArch: noarch
+# Disable build, newlib for noarch is not needed in this repo
+ExclusiveArch: do_not_build
%else
BuildRequires: cross-%{gcc_cross_arch}-gcc%{gcc_version}-bootstrap
BuildRequires: fdupes
@@ -69,7 +76,7 @@
%prep
%setup -q -n newlib-%{version}
-%patch1 -p1
+%patch -P 1 -p1
%build
%if "%{flavor}" != ""
@@ -81,13 +88,27 @@
export CFLAGS_FOR_TARGET="-O2 -g -ffunction-sections -fdata-sections"
FEATURES="--disable-nls"
if [[ "${variant}" == "nano" ]]; then
+%if %{arch_compat}
+ export CFLAGS_FOR_TARGET="-Os -g -ffunction-sections -fdata-sections"
+%else
export CFLAGS_FOR_TARGET="-Os -g"
- FEATURES="${FEATURES} --enable-newlib-nano-malloc --enable-lite-exit --enable-newlib-nano-formatted-io --disable-newlib-supplied-syscalls"
+%endif
+ FEATURES="${FEATURES} --enable-newlib-nano-malloc --enable-lite-exit --enable-newlib-nano-formatted-io"
fi
../configure \
--prefix=%{_prefix} --libdir=%{_libdir} --mandir=%{_mandir} --infodir=%{_infodir} \
--target=%{target} \
--with-build-sysroot=%{sysroot} \
+ --disable-newlib-supplied-syscalls \
+%if %{arch_compat}
+ --enable-newlib-reent-small \
+ --enable-newlib-retargetable-locking \
+ --disable-newlib-fvwrite-in-streamio \
+ --disable-newlib-fseek-optimization \
+ --disable-newlib-wide-orient \
+ --disable-newlib-unbuf-stream-opt \
+ --enable-newlib-global-atexit \
+%endif
$FEATURES \
%ifarch %{ix86}
%if 0