# FORCE NOARCH # This package is noarch intentionally, although it supplies binaries, # as they're not intended for the build platform, but for ARM. # The related discussion can be found here: # https://www.redhat.com/archives/fedora-devel-list/2009-February/msg02261.html %global _binaries_in_noarch_packages_terminate_build 0 %global arch riscv64 %global butarget riscv64-linux-gnu %global target riscv32-unknown-elf %global pkg_version 4.1.0 Name: %{arch}-newlib Version: 4.1.0 Release: 1%{?dist} Summary: C library intended for use on %{target} embedded systems Group: Development/Tools # For a breakdown of the licensing, see NEWLIB-LICENSING License: BSD and MIT and LGPLv2+ and ISC URL: http://sourceware.org/newlib/ Source0: ftp://sourceware.org/pub/newlib/newlib-%{pkg_version}.tar.gz Source1: README.fedora Source2: NEWLIB-LICENSING BuildRequires: gcc BuildRequires: binutils-%{butarget} gcc-%{butarget} gcc-c++-%{butarget} texinfo texinfo-tex BuildArch: noarch %description Newlib is a C library intended for use on embedded systems. It is a conglomeration of several library parts, all under free software licenses that make them easily usable on embedded products. %prep %setup -q -n newlib-%{pkg_version} %build rm -rf build-{newlib,nano} mkdir build-{newlib,nano} pushd build-newlib # -mcmodel=medlow export CFLAGS_FOR_TARGET="-g -Os -ffunction-sections -fdata-sections" export CXXFLAGS_FOR_TARGET="-g -Os -ffunction-sections -fdata-sections" export CC_FOR_TARGET=%{butarget}-gcc export AR_FOR_TARGET=%{butarget}-ar export RANLIB_FOR_TARGET=%{butarget}-ranlib ../configure \ --prefix=%{_prefix} \ --libdir=%{_libdir} \ --mandir=%{_mandir} \ --htmldir=%{_docdir}/html \ --pdfdir=%{_docdir}/pdf \ --target=%{target} \ --enable-newlib-io-long-long \ --enable-newlib-register-fini \ --enable-newlib-retargetable-locking \ --disable-newlib-supplied-syscalls \ --disable-nls \ --enable-multilib \ --disable-libssp \ --with-float=soft # --enable-newlib-reent-small \ # --disable-newlib-fvwrite-in-streamio \ # --disable-newlib-fseek-optimization \ # --disable-newlib-wide-orient \ # --enable-newlib-nano-malloc \ # --disable-newlib-unbuf-stream-opt \ # --enable-lite-exit \ # --enable-newlib-global-atexit \ # --enable-newlib-nano-formatted-io \ # --disable-newlib-supplied-syscalls \ # --disable-nls \ # --enable-newlib-register-fini \ # --with-arch=%{rvarch} make popd pushd build-nano export CFLAGS_FOR_TARGET="-g -Os -ffunction-sections -fdata-sections" export CXXFLAGS_FOR_TARGET="-g -Os -ffunction-sections -fdata-sections" export CC_FOR_TARGET=%{butarget}-gcc export AR_FOR_TARGET=%{butarget}-ar export RANLIB_FOR_TARGET=%{butarget}-ranlib ../configure \ --prefix=%{_prefix} \ --libdir=%{_libdir} \ --mandir=%{_mandir} \ --target=%{target} \ --disable-newlib-supplied-syscalls \ --enable-newlib-reent-small \ --disable-newlib-fvwrite-in-streamio \ --disable-newlib-fseek-optimization \ --disable-newlib-wide-orient \ --enable-newlib-nano-malloc \ --disable-newlib-unbuf-stream-opt \ --enable-lite-exit \ --enable-newlib-global-atexit \ --enable-newlib-nano-formatted-io \ --disable-nls make -j popd %install pushd build-newlib make install DESTDIR=%{buildroot} popd pushd build-nano NANO_ROOT=%{buildroot}/nano make install DESTDIR=$NANO_ROOT for i in $(find $NANO_ROOT -regex ".*/lib\(c\|g\|rdimon\)\.a"); do file=$(basename $i | sed "s|\.a|_nano\.a|") target_path=$(dirname $i | sed "s|$NANO_ROOT||") mv $i "%{buildroot}$target_path/$file" done popd cp %{SOURCE1} . cp %{SOURCE2} . # we don't want these as we are a cross version rm -rf %{buildroot}%{_infodir} rm -rf $NANO_ROOT # despite us being noarch redhat-rpm-config insists on stripping our files %if %{fedora}0 > 200 %global __os_install_post /usr/lib/rpm/brp-compress %else %global __os_install_post /usr/lib/rpm/redhat/brp-compress %endif %files %doc README.fedora %license NEWLIB-LICENSING COPYING* %dir %{_prefix}/%{target} %dir %{_prefix}/%{target}/include/ %{_prefix}/%{target}/include/* %dir %{_prefix}/%{target}/lib %{_prefix}/%{target}/lib/* %changelog * Thu Apr 08 2021 Thomas Sailer - 4.1.0-1 - update to 4.1.0 * Thu Mar 28 2019 Thomas Sailer - 3.0.0-5 - adapt to riscv64 * Thu Jul 12 2018 Fedora Release Engineering - 3.0.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Wed Feb 07 2018 Fedora Release Engineering - 3.0.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Tue Feb 06 2018 Michal Hlavinka - 3.0.0-2 - updated to 3.0.0 * Wed Jul 26 2017 Fedora Release Engineering - 2.5.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Mon Jul 10 2017 Michal Hlavinka - 2.5.0-2 - make sure -Os flags are used for nano version (#1443512) * Fri Jun 23 2017 Michal Hlavinka - 2.5.0-1 - updated to 2.5.0 * Fri Feb 10 2017 Fedora Release Engineering - 2.4.0-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Sun Nov 13 2016 Michal Hlavinka - 2.4.0-8 - bump release and rebuild * Thu Jun 30 2016 Michal Hlavinka - 2.4.0-7 - updated to 2.4.0 * Wed Feb 03 2016 Fedora Release Engineering - 2.2.0_1-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Wed Sep 02 2015 Michal Hlavinka - 2.2.0_1-6 - bump release and rebuild * Wed Sep 02 2015 Michal Hlavinka - 2.2.0_1-5 - add --enable-newlib-io-long-long configure option * Mon Aug 31 2015 Michal Hlavinka - 2.2.0_1-4 - added nano versions of libraries - cleaned up spec file - credits: Johnny Robeson * Wed Jun 17 2015 Fedora Release Engineering - 2.2.0_1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Mon Jun 01 2015 Michal Hlavinka - 2.2.0_1-2 - rebuild for gcc 5.1 * Tue Apr 14 2015 Michal Hlavinka - 2.2.0_1-1 - newlib updated to 2.2.0_1 * Mon Jun 09 2014 Michal Hlavinka - 2.1.0-5 - fix FTBFS (#1105970) * Sat Jun 07 2014 Fedora Release Engineering - 2.1.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Tue Feb 25 2014 Michal Hlavinka - 2.1.0-3 - enable libnosys (#1060567,#1058722) * Tue Jan 14 2014 Michal Hlavinka - 2.1.0-2 - rebuild with newer arm-none-eabi-gcc * Wed Jan 08 2014 Michal Hlavinka - 2.1.0-1 - initial import