newlib/newlib.spec.in
Richard Biener 7dd5cbdb55 Accepting request 844448 from home:matthewtrescott:branches:devel:gcc
- Update to v3.3.0
  * Fixes assembly of trap.S when building ARM multilibs (related
    to https://bugzilla.opensuse.org/show_bug.cgi?id=1106014)
- Remove unused configure flag --with-multilib-list. Newlib's configure
  script obtains this information from the GCC used to build it.

OBS-URL: https://build.opensuse.org/request/show/844448
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/newlib?expand=0&rev=18
2020-10-28 08:36:59 +00:00

76 lines
1.9 KiB
RPMSpec

%define gcc_cross_arch %{cross_arch}
%if "%{cross_arch}" == "riscv64"
%define gcc_cross_arch %{cross_arch}-elf
%endif
Name: cross-%{cross_arch}-newlib-devel
Version: 3.3.0
Release: 0
Summary: C library intended for use on %{cross_arch} embedded systems
Group: Development/Tools
License: BSD-3-Clause AND MIT AND LGPL-2.0-or-later AND ISC
Url: https://sourceware.org/newlib/
Source0: ftp://sourceware.org/pub/newlib/newlib-%{version}.tar.gz
Patch1: epiphany-fixes.diff
%if "%{cross_arch}" == "riscv64"
BuildRequires: cross-%{gcc_cross_arch}-gcc8-bootstrap
%else
BuildRequires: cross-%{gcc_cross_arch}-gcc%{gcc_version}-bootstrap
%endif
%if %{suse_version} > 1220
BuildRequires: makeinfo
%else
BuildRequires: texinfo
%endif
%description
Newlib is a C library intended for use on embedded systems. It is a
conglomeration of several library parts.
%define target %{cross_arch}
%if "%{cross_arch}" == "epiphany" || "%{cross_arch}" == "riscv32" || "%{cross_arch}" == "riscv64" || "%{cross_arch}" == "rl78" || "%{cross_arch}" == "rx"
%define target %{cross_arch}-elf
%endif
%if "%{cross_arch}" == "arm-none"
%define target %{cross_arch}-eabi
%endif
%if "%{cross_arch}" == "spu"
%define sysroot /usr/spu
%else
%define sysroot %{_prefix}/%{target}/sys-root
%endif
%prep
%setup -q -n newlib-%{version}
%patch1 -p1
%build
mkdir build-dir
cd build-dir
../configure \
--prefix=%{_prefix} --libdir=%{_libdir} --mandir=%{_mandir} --infodir=%{_infodir} \
--target=%{target} \
--with-build-sysroot=%{sysroot}
make %{?_smp_mflags}
%install
# All binaries built are for the target architecture - don't damage them.
export NO_BRP_STRIP_DEBUG=true
export NO_DEBUGINFO_STRIP_DEBUG=true
%define __debug_install_post %{nil}
: >debugfiles.list
: >debugsourcefiles.list
: >debugsources.list
cd build-dir
make install DESTDIR=%{buildroot}
%files
%defattr(-,root,root,-)
%{_prefix}/%{target}/
%changelog