From ae021808ab02bd27d378356bed68bb68fb2b9d77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Wed, 7 Jun 2023 09:12:10 +0200 Subject: [PATCH] Sync from SUSE:ALP:Source:Standard:1.0 newlib revision f4f25e040607f480c5ffc6516ade5b34 --- .gitattributes | 23 ++++ _constraints | 11 ++ _multibuild | 7 ++ epiphany-fixes.diff | 24 ++++ newlib-4.3.0.20230120.tar.gz | 3 + newlib.changes | 231 +++++++++++++++++++++++++++++++++++ newlib.spec | 149 ++++++++++++++++++++++ pre_checkin.sh | 3 + 8 files changed, 451 insertions(+) create mode 100644 .gitattributes create mode 100644 _constraints create mode 100644 _multibuild create mode 100644 epiphany-fixes.diff create mode 100644 newlib-4.3.0.20230120.tar.gz create mode 100644 newlib.changes create mode 100644 newlib.spec create mode 100644 pre_checkin.sh diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fecc750 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/_constraints b/_constraints new file mode 100644 index 0000000..bd5daa7 --- /dev/null +++ b/_constraints @@ -0,0 +1,11 @@ + + + + + 5 + + + 3 + + + diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..16811be --- /dev/null +++ b/_multibuild @@ -0,0 +1,7 @@ + + arm-none + epiphany + pru + riscv64 + rx + diff --git a/epiphany-fixes.diff b/epiphany-fixes.diff new file mode 100644 index 0000000..ef5ad42 --- /dev/null +++ b/epiphany-fixes.diff @@ -0,0 +1,24 @@ +Index: newlib-2.1.0/libgloss/epiphany/Makefile.in +=================================================================== +--- newlib-2.1.0.orig/libgloss/epiphany/Makefile.in ++++ newlib-2.1.0/libgloss/epiphany/Makefile.in +@@ -184,7 +184,7 @@ distclean maintainer-clean realclean: cl + install: + @for outputs in ${OUTPUTS}; do\ + mkdir -p $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}; \ +- $(INSTALL_PROGRAM) $${outputs} $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}; \ ++ $(INSTALL_DATA) $${outputs} $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}; \ + done + info: + install-info: +--- newlib-4.3.0.20230120/libgloss/epiphany/crt0.S.orig 2023-03-08 13:57:15.671910169 +0100 ++++ newlib-4.3.0.20230120/libgloss/epiphany/crt0.S 2023-03-08 13:57:27.135910057 +0100 +@@ -121,7 +121,7 @@ + #error "not implemented" + #else /* !__STRUCT_ALIGN_64__ */ + str r1, [r2, 0] ; __atexit = &__atexit0 +- movr r0, 1 ++ mov r0, 1 + str r0, [r1, 4] ; __atexit0._ind = 1 + mov r0,%low(fini) + movt r0,%high(fini) diff --git a/newlib-4.3.0.20230120.tar.gz b/newlib-4.3.0.20230120.tar.gz new file mode 100644 index 0000000..459821d --- /dev/null +++ b/newlib-4.3.0.20230120.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:83a62a99af59e38eb9b0c58ed092ee24d700fff43a22c03e433955113ef35150 +size 8832922 diff --git a/newlib.changes b/newlib.changes new file mode 100644 index 0000000..f2f6f0a --- /dev/null +++ b/newlib.changes @@ -0,0 +1,231 @@ +------------------------------------------------------------------- +Fri May 5 07:50:27 UTC 2023 - Frederic Crozat + +- Add _constraints to ensure enough disk and memory are available + during build. + +------------------------------------------------------------------- +Wed Mar 15 09:18:19 UTC 2023 - Martin Liška + +- Use valid tarball FTP url. + +------------------------------------------------------------------- +Wed Mar 8 12:39:13 UTC 2023 - Richard Biener + +- Update to v4.3.0 + * remove i?86-pc-linux-gnu support + * remove decstation & sunos support + * remove phoenix OS support + * remove unused members from struct _reent (see also + --enable-newlib-reent-binary-compat) + * build system internals heavily rewritten & updated + * make arm jmp_buf size and alignment ABI-conformant + * fixed bug in arm setjmp/longjmp to preserve floating-point register + values + * add --enable-newlib-reent-thread-local configuration option + * add --enable-newlib-reent-binary-compat configuration option + * add 64-bit powerpc setjmp/longjmp support + * use global stdio streams for all configurations + * use global atexit data for all configurations + * vectorized math routines added for amdgcn platform + * nvptx: remove newlib ELIX level 1 restriction +- Already in v4.2.0 + * remove use of --cygnus option for automake + * rename configure.in files to configure.ac + * enable automake silent rules + * import gdtoa from OpenBSD + * update to Unicode 14.0 + * ignore _FORTIFY_SOURCE when building newlib + * fixes to ldtoa + * add clock support to nvptx port + * various pthread POSIX APIs added + * added implementatio for sig2str/str2sig + * strtod/strtof to set errno to ERANGE consistently for underflow + * fixed rounding issue with sqrt/sqrtf + * fixed heap fragmentation issue with nano-malloc + * FTW port for newlib + * additions to sys/tree.h +- Add makeinfo BuildRequires for building libgloss documentation +- Amend epiphany-fixes.diff with a build fix + +------------------------------------------------------------------- +Sun Apr 24 16:55:14 UTC 2022 - Matwey Kornilov + +- Add initial support for TI PRU architecture. This is used for real-time + coprocessor of BeagleBone Black (JeOS-beaglebone) + +------------------------------------------------------------------- +Sun Dec 19 17:14:21 UTC 2021 - Stefan Brüns + +- 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 + +- disable all but the arm dependencies for ring + +------------------------------------------------------------------- +Mon Mar 8 13:24:30 UTC 2021 - Richard Biener + +- Update to v4.1.0 + * fixes for regressions to pow/powf and tgamma functions + * RISC-V semihosting support + * RISC-V and arm patches + * additional out-of-bounds checking for malloc/nano-malloc family + [bsc#1183172, CVE-2021-3420] + * various fixes to makedocbook for python 3.8 + * multiple standard/accuracy fixes to libm math routines + * C-SKY port + * support for Armv8-R aarch64 added + * move of __tzrules_struct from time.h to internal header + * math additions/improvements for RISC-V and arm + * all arm code converted to use unified syntax for Thumb1 + * fenv support added for multiple platforms + * hard float support for PowerPC taken from FreeBSD + * advertising clause removed from BSD licenses + * various other fixes + +------------------------------------------------------------------- +Tue Dec 8 10:46:24 UTC 2020 - Stefan Brüns + +- Use _multibuild for building all flavors. +- Remove unused makeinfo build dependency. +- Omit all build steps from base flavor, it just packages + various documentation files. +- Remove deprecated stuff from spec file. + +------------------------------------------------------------------- +Mon Dec 7 09:17:44 UTC 2020 - Guillaume GARDET + +- Use defined gcc version for all architectures + +------------------------------------------------------------------- +Tue Oct 27 03:49:05 UTC 2020 - Matthew Trescott + +- Update to v3.3.0 + * Fixes assembly of trap.S when building ARM multilibs (related + to [bsc#1106014] +- Remove unused configure flag --with-multilib-list. Newlib's configure + script obtains this information from the GCC used to build it. + +------------------------------------------------------------------- +Sun Jun 23 01:00:01 UTC 2019 - Andreas Färber + +- Update to v3.1.0 + +------------------------------------------------------------------- +Mon May 27 19:59:12 UTC 2019 - matz@suse.com + +- On riscv64 force gcc 8 as bootstrap compiler + +------------------------------------------------------------------- +Mon Dec 24 13:49:40 UTC 2018 - Jan Engelhardt + +- Trim redundant license mention. + +------------------------------------------------------------------- +Sat May 12 21:46:42 UTC 2018 - afaerber@suse.de + +- Add riscv64 target + +------------------------------------------------------------------- +Sat May 12 20:31:49 UTC 2018 - afaerber@suse.de + +- Update SPDX syntax + +------------------------------------------------------------------- +Sun Mar 11 18:44:09 UTC 2018 - afaerber@suse.de + +- Add arm-none-eabi target + +------------------------------------------------------------------- +Sun Mar 11 17:44:01 UTC 2018 - afaerber@suse.de + +- Update to v3.0.0 + +------------------------------------------------------------------- +Sun Mar 11 16:50:55 UTC 2018 - afaerber@suse.de + +- Prepare for %cross_arch with dashes by consistently quoting +- Leave the choice of cross-*-binutils to cross-*-gcc* +- Update to v2.5.0 + +------------------------------------------------------------------- +Wed Jan 24 09:29:00 UTC 2018 - rguenther@suse.com + +- Handle debugsources.list to debugsourcefiles.list rename of new rpm. + +------------------------------------------------------------------- +Fri Jul 1 12:32:49 UTC 2016 - rguenther@suse.com + +- Add rx and epiphany targets + +------------------------------------------------------------------- +Tue May 17 17:55:35 UTC 2016 - afaerber@suse.de + +- Drop newlib-rpmlintrc + +------------------------------------------------------------------- +Sat May 14 00:18:57 UTC 2016 - afaerber@suse.de + +- Apply epiphany-fixes.diff not only to cross builds (.spec.in) but + also in newlib.spec, to please factory-auto checker (sr#395228) + +------------------------------------------------------------------- +Fri May 13 16:57:05 UTC 2016 - afaerber@suse.de + +- Prepare rl78 target +- Update to 2.4.0 +* Info files are no longer built +* Package all license and read-me files +- Clean up makeinfo dependency +- Drop cross .spec files in preparation for Factory submission + +------------------------------------------------------------------- +Mon Jul 20 21:52:07 UTC 2015 - afaerber@suse.de + +- Update to 2.2.0.20150623 +- Add cross-rx-newlib-devel package +- Revert installing files to sysroot + +------------------------------------------------------------------- +Fri Jul 10 21:50:42 UTC 2015 - afaerber@suse.de + +- Switch cross template to gcc5 + +------------------------------------------------------------------- +Mon Apr 6 15:53:44 UTC 2015 - afaerber@suse.de + +- Install target files to sysroot + +------------------------------------------------------------------- +Sat Nov 1 00:52:40 UTC 2014 - afaerber@suse.de + +- Enable native builds + +------------------------------------------------------------------- +Fri Oct 31 21:08:45 UTC 2014 - afaerber@suse.de + +- epiphany-fixes.diff: Drop executable permissions of + libepiphany.a and crt0.o + +------------------------------------------------------------------- +Fri Oct 31 20:05:26 UTC 2014 - afaerber@suse.de + +- Turn cross-epiphany-newlib into generic newlib package +* Rename packages to -devel to avoid empty -newlib packages + +------------------------------------------------------------------- +Tue Oct 21 07:21:21 UTC 2014 - afaerber@suse.de + +- Update to official 2.1.0 tarball +* Drop portability.patch + +------------------------------------------------------------------- +Tue Sep 30 02:29:16 UTC 2014 - afaerber@suse.de + +- Initial + diff --git a/newlib.spec b/newlib.spec new file mode 100644 index 0000000..21506e9 --- /dev/null +++ b/newlib.spec @@ -0,0 +1,149 @@ +# +# spec file +# +# Copyright (c) 2023 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "" +%define pname newlib +%else +%define cross_arch %{flavor} +%define pname cross-%{cross_arch}-newlib-devel +%endif +%if "%{flavor}" == "riscv64" +%define gcc_cross_arch %{cross_arch}-elf +%define target %{cross_arch}-elf +%else +%define gcc_cross_arch %{cross_arch} +%define target %{cross_arch} +%endif +%if "%{cross_arch}" == "epiphany" || "%{cross_arch}" == "riscv32" || "%{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 %{_prefix}/spu +%else +%define sysroot %{_prefix}/%{target}/sys-root +%endif +# In the staging/ring projects, we don't want to build the unneeded packages +%bcond_with ringdisabled +Name: %{pname} +Version: 4.3.0.20230120 +Release: 0 +Summary: C library intended for use on embedded systems +License: BSD-3-Clause AND MIT AND LGPL-2.0-or-later AND ISC +Group: Development/Libraries/Cross +URL: https://sourceware.org/newlib/ +Source0: ftp://sourceware.org/pub/newlib/newlib-%{version}.tar.gz +Patch1: epiphany-fixes.diff +%if "%{flavor}" == "" +BuildArch: noarch +%else +BuildRequires: cross-%{gcc_cross_arch}-gcc%{gcc_version}-bootstrap +BuildRequires: fdupes +BuildRequires: makeinfo +%if "%{cross_arch}" != "arm-none" && "%{cross_arch}" != "arm" && %{with ringdisabled} +ExclusiveArch: do-not-build +%endif +%endif + +%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-%{version} +%patch1 -p1 + +%build +%if "%{flavor}" != "" +for variant in nano regular; do + mkdir build-${variant}-dir + pushd build-${variant}-dir + # On %%ix86 hosts newlib is documented to be buildable as shared library via --with-newlib, + # 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} \ + --target=%{target} \ + --with-build-sysroot=%{sysroot} \ + $FEATURES \ +%ifarch %{ix86} +%if 0 + --with-newlib \ +%endif +%endif + CFLAGS="%{optflags}" \ + %{nil} + + %make_build + popd +done +%endif + +%install +%if "%{flavor}" != "" +# 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 + +for variant in nano regular; do + 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 + +rm %{buildroot}%{_infodir}/porting.info + +%fdupes %{buildroot} +%endif + +%files +%if "%{flavor}" == "" +%license COPYING.NEWLIB COPYING.LIBGLOSS COPYING COPYING.LIB COPYING3 COPYING3.LIB +%doc newlib/README newlib/NEWS +%else +%{_prefix}/%{target}/ +%endif + +%changelog diff --git a/pre_checkin.sh b/pre_checkin.sh new file mode 100644 index 0000000..719e1b4 --- /dev/null +++ b/pre_checkin.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +osc service localrun format_spec_file