Accepting request 942155 from devel:gcc
OBS-URL: https://build.opensuse.org/request/show/942155 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/newlib?expand=0&rev=12
This commit is contained in:
commit
dd7b547a8d
@ -1,3 +1,11 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Sun Dec 19 17:14:21 UTC 2021 - Stefan Brüns <stefan.bruens@rwth-aachen.de>
|
||||||
|
|
||||||
|
- Build also nano variants of the libraries. The flags/features
|
||||||
|
are the same as used e.g. by ARM for their toolchain, or
|
||||||
|
fedora; most notably syscalls are not supplied, as this targets
|
||||||
|
bare metal.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Jun 9 20:13:14 UTC 2021 - Dirk Müller <dmueller@suse.com>
|
Wed Jun 9 20:13:14 UTC 2021 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
51
newlib.spec
51
newlib.spec
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# spec file
|
# spec file for package newlib
|
||||||
#
|
#
|
||||||
# Copyright (c) 2021 SUSE LLC
|
# Copyright (c) 2021 SUSE LLC
|
||||||
#
|
#
|
||||||
@ -73,22 +73,33 @@ that make them easily usable on embedded products.
|
|||||||
|
|
||||||
%build
|
%build
|
||||||
%if "%{flavor}" != ""
|
%if "%{flavor}" != ""
|
||||||
mkdir build-dir
|
for variant in nano regular; do
|
||||||
cd build-dir
|
mkdir build-${variant}-dir
|
||||||
# On %%ix86 hosts newlib is documented to be buildable as shared library via --with-newlib,
|
pushd build-${variant}-dir
|
||||||
# but it fails to build for us and we don't need a host library at the moment.
|
# On %%ix86 hosts newlib is documented to be buildable as shared library via --with-newlib,
|
||||||
../configure \
|
# but it fails to build for us and we don't need a host library at the moment.
|
||||||
|
export CFLAGS_FOR_TARGET="-O2 -g -ffunction-sections -fdata-sections"
|
||||||
|
FEATURES="--disable-nls"
|
||||||
|
if [[ "${variant}" == "nano" ]]; then
|
||||||
|
export CFLAGS_FOR_TARGET="-Os -g"
|
||||||
|
FEATURES="${FEATURES} --enable-newlib-nano-malloc --enable-lite-exit --enable-newlib-nano-formatted-io --disable-newlib-supplied-syscalls"
|
||||||
|
fi
|
||||||
|
../configure \
|
||||||
--prefix=%{_prefix} --libdir=%{_libdir} --mandir=%{_mandir} --infodir=%{_infodir} \
|
--prefix=%{_prefix} --libdir=%{_libdir} --mandir=%{_mandir} --infodir=%{_infodir} \
|
||||||
--target=%{target} \
|
--target=%{target} \
|
||||||
--with-build-sysroot=%{sysroot}
|
--with-build-sysroot=%{sysroot} \
|
||||||
|
$FEATURES \
|
||||||
%ifarch %{ix86}
|
%ifarch %{ix86}
|
||||||
%if 0
|
%if 0
|
||||||
--with-newlib \
|
--with-newlib \
|
||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
CFLAGS="%{optflags}"
|
CFLAGS="%{optflags}" \
|
||||||
|
%{nil}
|
||||||
|
|
||||||
%make_build
|
%make_build
|
||||||
|
popd
|
||||||
|
done
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%install
|
%install
|
||||||
@ -101,8 +112,26 @@ export NO_DEBUGINFO_STRIP_DEBUG=true
|
|||||||
: >debugsourcefiles.list
|
: >debugsourcefiles.list
|
||||||
: >debugsources.list
|
: >debugsources.list
|
||||||
|
|
||||||
cd build-dir
|
for variant in nano regular; do
|
||||||
%make_install
|
pushd build-${variant}-dir
|
||||||
|
if [[ "${variant}" == "regular" ]]; then
|
||||||
|
%make_install
|
||||||
|
else
|
||||||
|
%make_install DESTDIR=/tmp/newlib-nano
|
||||||
|
multilibs=$(%{target}-gcc --print-multi-lib)
|
||||||
|
for multilib in ${multilibs}; do
|
||||||
|
multilib="${multilib%%;*}"
|
||||||
|
for l in libc libg librdimon libstdc++ libsupc++; do
|
||||||
|
test -f /tmp/newlib-nano/%{_prefix}/%{target}/lib/${multilib}/${l}.a || continue
|
||||||
|
install -m 0644 -D /tmp/newlib-nano/%{_prefix}/%{target}/lib/${multilib}/${l}.a \
|
||||||
|
%{buildroot}%{_prefix}/%{target}/lib/${multilib}/${l}_nano.a
|
||||||
|
done
|
||||||
|
done
|
||||||
|
install -m 0644 -D -t %{buildroot}%{_prefix}/%{target}/include/newlib-nano/ /tmp/newlib-nano/%{_prefix}/%{target}/include/newlib.h
|
||||||
|
fi
|
||||||
|
popd
|
||||||
|
done
|
||||||
|
|
||||||
%fdupes %{buildroot}
|
%fdupes %{buildroot}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user