From f516638b7fe9592837389826a6152a7e1b251c54 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 30 May 2020 11:44:06 +0100 Subject: gentoo resync : 30.05.2020 --- sys-libs/newlib/Manifest | 8 +- .../newlib/files/newlib-3.3.0-no-nano-cxx.patch | 29 ++++ sys-libs/newlib/newlib-3.1.0.ebuild | 141 ------------------- sys-libs/newlib/newlib-3.3.0-r1.ebuild | 154 +++++++++++++++++++++ sys-libs/newlib/newlib-3.3.0.ebuild | 6 +- sys-libs/newlib/newlib-9999.ebuild | 13 ++ 6 files changed, 204 insertions(+), 147 deletions(-) create mode 100644 sys-libs/newlib/files/newlib-3.3.0-no-nano-cxx.patch delete mode 100644 sys-libs/newlib/newlib-3.1.0.ebuild create mode 100644 sys-libs/newlib/newlib-3.3.0-r1.ebuild (limited to 'sys-libs/newlib') diff --git a/sys-libs/newlib/Manifest b/sys-libs/newlib/Manifest index f238f05ee704..ff550a93d821 100644 --- a/sys-libs/newlib/Manifest +++ b/sys-libs/newlib/Manifest @@ -1,6 +1,6 @@ -DIST newlib-3.1.0.tar.gz 17958952 BLAKE2B 3a84ae81fc07e442a4ed3da7a78e7ede34cc7e24b5d1c66a12624ed808e5f85f134751fcea0e4ce9eb39df287a582821f751a8610a088c149895b5e38eb06989 SHA512 efc4c3ab7153387780d141386bca5d3e20c9d25ae3e6b87cf94c8df9d301ce5926dacdff9bd33aeb9781559d933c3d0ae77f4e5b46120d90792f75dbfde702c7 +AUX newlib-3.3.0-no-nano-cxx.patch 1338 BLAKE2B ff16751b01784a38dc07aa79120c38f0274bb14caeeb653cecca4b3ca69c60a72e0e1918fea8f2c0f4734293817539122fa41b349f61ceabb3cb9ae878a11d13 SHA512 08dfc7d854dc75c8b875fa7c1829078c8df8988b4ba2b20739d387c656ca63b8b344487861d23658e31b72f911d05c2f57abe51bdf3b2dedcc88ce072c6595c8 DIST newlib-3.3.0.tar.gz 18361083 BLAKE2B bdc81427955d0a2f550bf2973ca82c0b8b55aa170565cdf1cfe8ac926257fad6d3e860ce7b2e286949ab21be2677378b5b6d3c743c05fe8aa6df8a8c34a16945 SHA512 2f0c6666487520e1a0af0b6935431f85d2359e27ded0d01d02567d0d1c6479f2f0e6bbc60405e88e46b92c2a18780a01a60fc9281f7e311cfd40b8d5881d629c -EBUILD newlib-3.1.0.ebuild 4224 BLAKE2B 4e3f5b528c084fb06dc62ba2ec578292651f453482d332536b3c3a6c45088199728c184b6ac9bcad414e85efdb6011c0ff77d1b7578eb61fb8ad947d8a7c3951 SHA512 757b96af5e3131dce540ffc4f428997fac806e87a3b5abedc057e84915c8f5ba436548f4900070941e125f8cfe2d5503412112e13e2d66ce38fd274d436f93eb -EBUILD newlib-3.3.0.ebuild 4350 BLAKE2B 1a6c3b3706123d41950f6fce3930412da06104f4e6e78d70523157664e9ffb1c8bb0f18b661548ac69b60e526ba308db0d2c72369d2d79167f69aec063603367 SHA512 b76c4a3672a0c3d0a712d3a2103018d733826eb31702713b6f19c290df4b67ecf63ab13f59d06e4402357b7b8e3de5d414e3597d57b74326f8e29fbfa1018a67 -EBUILD newlib-9999.ebuild 4224 BLAKE2B 4e3f5b528c084fb06dc62ba2ec578292651f453482d332536b3c3a6c45088199728c184b6ac9bcad414e85efdb6011c0ff77d1b7578eb61fb8ad947d8a7c3951 SHA512 757b96af5e3131dce540ffc4f428997fac806e87a3b5abedc057e84915c8f5ba436548f4900070941e125f8cfe2d5503412112e13e2d66ce38fd274d436f93eb +EBUILD newlib-3.3.0-r1.ebuild 4459 BLAKE2B c2a94dbe1f3f02e9b4f5ffdd3d80c0a7b85533966ae4e5339f8efda4534aa3e8eef297fb82b0a9c1c113556e3b28293a11444f7208abcce6f5fa9f3996ddcb29 SHA512 140d1044b26489f050a4d5e26f8df168c1a524fcaad1ce10b12c274f188b7c62d31c5870ab731d5f82262d594aa37d0251bd0da2ca1f62a8fd8a7a387dc9fe4e +EBUILD newlib-3.3.0.ebuild 4401 BLAKE2B a35d99451e91261ea18c9d3e988e2ef260fa8bfbc17d16cb85db8958f1531152baf0b25281c930288a9d6a7affe0c08deb9d608b78e7906381e03962a4e9da61 SHA512 58ed88812207e3c2ef6e811ddb9e74cdef1b1626cc6c04a9d619e5c5bc4ad1f88516b4b9c2fdda9179848b17995bb34ec38f9d66f3bcea201bdee432e34cf7aa +EBUILD newlib-9999.ebuild 4459 BLAKE2B c2a94dbe1f3f02e9b4f5ffdd3d80c0a7b85533966ae4e5339f8efda4534aa3e8eef297fb82b0a9c1c113556e3b28293a11444f7208abcce6f5fa9f3996ddcb29 SHA512 140d1044b26489f050a4d5e26f8df168c1a524fcaad1ce10b12c274f188b7c62d31c5870ab731d5f82262d594aa37d0251bd0da2ca1f62a8fd8a7a387dc9fe4e MISC metadata.xml 413 BLAKE2B 03320244c40182ff9d503fd1d9c7c3847209eeb91081e7d4a3285ed43eba6a42e0f361f6b7601966df420dde2d4e93ca458816198c2f9ebaec82790359ce868b SHA512 37e46d117243b93e189177ada64acedc0d798dfe4859f29a7ef70b22fe44e6364a3445e345def7e48264cb2bf3047ac78637759bc04d9ed3d7ea339432adf7e4 diff --git a/sys-libs/newlib/files/newlib-3.3.0-no-nano-cxx.patch b/sys-libs/newlib/files/newlib-3.3.0-no-nano-cxx.patch new file mode 100644 index 000000000000..58068ad2d22f --- /dev/null +++ b/sys-libs/newlib/files/newlib-3.3.0-no-nano-cxx.patch @@ -0,0 +1,29 @@ +Gentoo's and upstream gccs don't install _nano variants of stdc++ and supc++. + +Let's not refer to them in nano specs of newlib until we do +(or better yet upstream does) have these libraries. + +Reported-by: David Flogeras +Bug: https://bugs.gentoo.org/723756 +--- a/libgloss/arc/nano.specs ++++ b/libgloss/arc/nano.specs +@@ -11,7 +11,7 @@ + %(nano_link_gcc_c_sequence) --start-group %G %(nano_libc) %(nano_libgloss) --end-group + + *link: +-%(nano_link) %:replace-outfile(-lc -lc_nano) %:replace-outfile(-lg -lg_nano) %:replace-outfile(-lstdc++ -lstdc++_nano) %:replace-outfile(-lsupc++ -lsupc++_nano) ++%(nano_link) %:replace-outfile(-lc -lc_nano) %:replace-outfile(-lg -lg_nano) + + *lib: + %{!shared:%{g*:-lg_nano} %{!p:%{!pg:-lc_nano}}%{p:-lc_p}%{pg:-lc_p}} +--- a/libgloss/arm/elf-nano.specs ++++ b/libgloss/arm/elf-nano.specs +@@ -15,7 +15,7 @@ + %(nano_link_gcc_c_sequence) --start-group %G %(nano_libc) %(nano_libgloss) --end-group + + *link: +-%(nano_link) %:replace-outfile(-lc -lc_nano) %:replace-outfile(-lg -lg_nano) %:replace-outfile(-lrdimon -lrdimon_nano) %:replace-outfile(-lstdc++ -lstdc++_nano) %:replace-outfile(-lsupc++ -lsupc++_nano) ++%(nano_link) %:replace-outfile(-lc -lc_nano) %:replace-outfile(-lg -lg_nano) %:replace-outfile(-lrdimon -lrdimon_nano) + + *lib: + %{!shared:%{g*:-lg_nano} %{!p:%{!pg:-lc_nano}}%{p:-lc_p}%{pg:-lc_p}} diff --git a/sys-libs/newlib/newlib-3.1.0.ebuild b/sys-libs/newlib/newlib-3.1.0.ebuild deleted file mode 100644 index db1a3fad9cfb..000000000000 --- a/sys-libs/newlib/newlib-3.1.0.ebuild +++ /dev/null @@ -1,141 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" - -inherit flag-o-matic toolchain-funcs - -if [[ ${PV} == "9999" ]] ; then - EGIT_REPO_URI="https://sourceware.org/git/newlib-cygwin.git" - inherit git-r3 -else - SRC_URI="ftp://sourceware.org/pub/newlib/${P}.tar.gz" - KEYWORDS="-* ~arm ~hppa ~m68k ~mips ~ppc ~ppc64 ~sparc ~x86" -fi - -export CBUILD=${CBUILD:-${CHOST}} -export CTARGET=${CTARGET:-${CHOST}} -if [[ ${CTARGET} == ${CHOST} ]] ; then - if [[ ${CATEGORY} == cross-* ]] ; then - export CTARGET=${CATEGORY#cross-} - fi -fi - -DESCRIPTION="Newlib is a C library intended for use on embedded systems" -HOMEPAGE="https://sourceware.org/newlib/" - -LICENSE="NEWLIB LIBGLOSS GPL-2" -SLOT="0" -IUSE="nls threads unicode headers-only nano" -RESTRICT="strip" - -NEWLIBBUILD="${WORKDIR}/build" -NEWLIBNANOBUILD="${WORKDIR}/build.nano" -NEWLIBNANOTMPINSTALL="${WORKDIR}/nano_tmp_install" - -# Adding -U_FORTIFY_SOURCE to counter the effect of Gentoo's -# auto-addition of _FORTIFY_SOURCE at gcc site: bug #656018#c4 -# Currently newlib can't be built itself when _FORTIFY_SOURCE -# is set. -CFLAGS_FULL="-ffunction-sections -fdata-sections -U_FORTIFY_SOURCE" -CFLAGS_NANO="-Os -ffunction-sections -fdata-sections -U_FORTIFY_SOURCE" - -pkg_setup() { - # Reject newlib-on-glibc type installs - if [[ ${CTARGET} == ${CHOST} ]] ; then - case ${CHOST} in - *-newlib|*-elf) ;; - *) die "Use sys-devel/crossdev to build a newlib toolchain" ;; - esac - fi -} - -src_configure() { - # we should fix this ... - unset LDFLAGS - CHOST=${CTARGET} strip-unsupported-flags - CCASFLAGS_ORIG="${CCASFLAGS}" - CFLAGS_ORIG="${CFLAGS}" - - local myconf=( - # Disable legacy syscall stub code in newlib. These have been - # moved to libgloss for a long time now, so the code in newlib - # itself just gets in the way. - --disable-newlib-supplied-syscalls - ) - [[ ${CTARGET} == "spu" ]] \ - && myconf+=( --disable-newlib-multithread ) \ - || myconf+=( $(use_enable threads newlib-multithread) ) - - mkdir -p "${NEWLIBBUILD}" - cd "${NEWLIBBUILD}" - - export "CFLAGS_FOR_TARGET=${CFLAGS_ORIG} ${CFLAGS_FULL}" - export "CCASFLAGS=${CCASFLAGS_ORIG} ${CFLAGS_FULL}" - ECONF_SOURCE=${S} \ - econf \ - $(use_enable unicode newlib-mb) \ - $(use_enable nls) \ - "${myconf[@]}" - - # Build newlib-nano beside newlib (original) - # Based on https://tracker.debian.org/media/packages/n/newlib/rules-2.1.0%2Bgit20140818.1a8323b-2 - if use nano ; then - mkdir -p "${NEWLIBNANOBUILD}" || die - cd "${NEWLIBNANOBUILD}" || die - export "CFLAGS_FOR_TARGET=${CFLAGS_ORIG} ${CFLAGS_NANO}" - export "CCASFLAGS=${CCASFLAGS_ORIG} ${CFLAGS_NANO}" - ECONF_SOURCE=${S} \ - econf \ - $(use_enable unicode newlib-mb) \ - $(use_enable nls) \ - --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 \ - ${myconf} - fi -} - -src_compile() { - export "CFLAGS_FOR_TARGET=${CFLAGS_ORIG} ${CFLAGS_FULL}" - export "CCASFLAGS=${CCASFLAGS_ORIG} ${CFLAGS_FULL}" - emake -C "${NEWLIBBUILD}" - - if use nano ; then - export "CFLAGS_FOR_TARGET=${CFLAGS_ORIG} ${CFLAGS_NANO}" - export "CCASFLAGS=${CCASFLAGS_ORIG} ${CFLAGS_NANO}" - emake -C "${NEWLIBNANOBUILD}" - fi -} - -src_install() { - cd "${NEWLIBBUILD}" || die - emake -j1 DESTDIR="${D}" install - - if use nano ; then - cd "${NEWLIBNANOBUILD}" || die - emake -j1 DESTDIR="${NEWLIBNANOTMPINSTALL}" install - # Rename nano lib* files to lib*_nano and move to the real ${D} - local nanolibfiles="" - nanolibfiles=$(find "${NEWLIBNANOTMPINSTALL}" -regex ".*/lib\(c\|g\|rdimon\)\.a" -print) - for f in ${nanolibfiles}; do - local l="${f##${NEWLIBNANOTMPINSTALL}}" - mv -v "${f}" "${D}/${l%%\.a}_nano.a" || die - done - - # Move newlib-nano's version of newlib.h to newlib-nano/newlib.h - mkdir -p "${D}/usr/${CTARGET}/include/newlib-nano" || die - mv "${NEWLIBNANOTMPINSTALL}/usr/${CTARGET}/include/newlib.h" \ - "${D}/usr/${CTARGET}/include/newlib-nano/newlib.h" || die - fi - - # minor hack to keep things clean - rm -rf "${D}"/usr/share/info || die - rm -rf "${D}"/usr/info || die -} diff --git a/sys-libs/newlib/newlib-3.3.0-r1.ebuild b/sys-libs/newlib/newlib-3.3.0-r1.ebuild new file mode 100644 index 000000000000..bd8e3d1de3f5 --- /dev/null +++ b/sys-libs/newlib/newlib-3.3.0-r1.ebuild @@ -0,0 +1,154 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" + +inherit flag-o-matic toolchain-funcs + +if [[ ${PV} == "9999" ]] ; then + EGIT_REPO_URI="https://sourceware.org/git/newlib-cygwin.git" + inherit git-r3 +else + SRC_URI="ftp://sourceware.org/pub/newlib/${P}.tar.gz" + KEYWORDS="-* ~arm ~hppa ~m68k ~mips ~ppc ~ppc64 ~sparc ~x86" +fi + +export CBUILD=${CBUILD:-${CHOST}} +export CTARGET=${CTARGET:-${CHOST}} +if [[ ${CTARGET} == ${CHOST} ]] ; then + if [[ ${CATEGORY} == cross-* ]] ; then + export CTARGET=${CATEGORY#cross-} + fi +fi + +DESCRIPTION="Newlib is a C library intended for use on embedded systems" +HOMEPAGE="https://sourceware.org/newlib/" + +LICENSE="NEWLIB LIBGLOSS GPL-2" +SLOT="0" +IUSE="nls threads unicode headers-only nano" +RESTRICT="strip" + +PATCHES=( + "${FILESDIR}"/${PN}-3.3.0-no-nano-cxx.patch +) + +NEWLIBBUILD="${WORKDIR}/build" +NEWLIBNANOBUILD="${WORKDIR}/build.nano" +NEWLIBNANOTMPINSTALL="${WORKDIR}/nano_tmp_install" + +# Adding -U_FORTIFY_SOURCE to counter the effect of Gentoo's +# auto-addition of _FORTIFY_SOURCE at gcc site: bug #656018#c4 +# Currently newlib can't be built itself when _FORTIFY_SOURCE +# is set. +CFLAGS_FULL="-ffunction-sections -fdata-sections -U_FORTIFY_SOURCE" +CFLAGS_NANO="-Os -ffunction-sections -fdata-sections -U_FORTIFY_SOURCE" + +pkg_setup() { + # Reject newlib-on-glibc type installs + if [[ ${CTARGET} == ${CHOST} ]] ; then + case ${CHOST} in + *-newlib|*-elf) ;; + *) die "Use sys-devel/crossdev to build a newlib toolchain" ;; + esac + fi + + case ${CTARGET} in + msp430*) + if ver_test $(gcc-version ${CTARGET}) -lt 10.1; then + # bug #717610 + die "gcc for ${CTARGET} has to be 10.1 or above" + fi + ;; + esac +} + +src_configure() { + # we should fix this ... + unset LDFLAGS + CHOST=${CTARGET} strip-unsupported-flags + CCASFLAGS_ORIG="${CCASFLAGS}" + CFLAGS_ORIG="${CFLAGS}" + + local myconf=( + # Disable legacy syscall stub code in newlib. These have been + # moved to libgloss for a long time now, so the code in newlib + # itself just gets in the way. + --disable-newlib-supplied-syscalls + ) + [[ ${CTARGET} == "spu" ]] \ + && myconf+=( --disable-newlib-multithread ) \ + || myconf+=( $(use_enable threads newlib-multithread) ) + + mkdir -p "${NEWLIBBUILD}" + cd "${NEWLIBBUILD}" + + export "CFLAGS_FOR_TARGET=${CFLAGS_ORIG} ${CFLAGS_FULL}" + export "CCASFLAGS=${CCASFLAGS_ORIG} ${CFLAGS_FULL}" + ECONF_SOURCE=${S} \ + econf \ + $(use_enable unicode newlib-mb) \ + $(use_enable nls) \ + "${myconf[@]}" + + # Build newlib-nano beside newlib (original) + # Based on https://tracker.debian.org/media/packages/n/newlib/rules-2.1.0%2Bgit20140818.1a8323b-2 + if use nano ; then + mkdir -p "${NEWLIBNANOBUILD}" || die + cd "${NEWLIBNANOBUILD}" || die + export "CFLAGS_FOR_TARGET=${CFLAGS_ORIG} ${CFLAGS_NANO}" + export "CCASFLAGS=${CCASFLAGS_ORIG} ${CFLAGS_NANO}" + ECONF_SOURCE=${S} \ + econf \ + $(use_enable unicode newlib-mb) \ + $(use_enable nls) \ + --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 \ + ${myconf} + fi +} + +src_compile() { + export "CFLAGS_FOR_TARGET=${CFLAGS_ORIG} ${CFLAGS_FULL}" + export "CCASFLAGS=${CCASFLAGS_ORIG} ${CFLAGS_FULL}" + emake -C "${NEWLIBBUILD}" + + if use nano ; then + export "CFLAGS_FOR_TARGET=${CFLAGS_ORIG} ${CFLAGS_NANO}" + export "CCASFLAGS=${CCASFLAGS_ORIG} ${CFLAGS_NANO}" + emake -C "${NEWLIBNANOBUILD}" + fi +} + +src_install() { + cd "${NEWLIBBUILD}" || die + emake -j1 DESTDIR="${D}" install + + if use nano ; then + cd "${NEWLIBNANOBUILD}" || die + emake -j1 DESTDIR="${NEWLIBNANOTMPINSTALL}" install + # Rename nano lib* files to lib*_nano and move to the real ${D} + local nanolibfiles="" + nanolibfiles=$(find "${NEWLIBNANOTMPINSTALL}" -regex ".*/lib\(c\|g\|rdimon\)\.a" -print) + for f in ${nanolibfiles}; do + local l="${f##${NEWLIBNANOTMPINSTALL}}" + mv -v "${f}" "${D}/${l%%\.a}_nano.a" || die + done + + # Move newlib-nano's version of newlib.h to newlib-nano/newlib.h + mkdir -p "${D}/usr/${CTARGET}/include/newlib-nano" || die + mv "${NEWLIBNANOTMPINSTALL}/usr/${CTARGET}/include/newlib.h" \ + "${D}/usr/${CTARGET}/include/newlib-nano/newlib.h" || die + fi + + # minor hack to keep things clean + rm -rf "${D}"/usr/share/info || die + rm -rf "${D}"/usr/info || die +} diff --git a/sys-libs/newlib/newlib-3.3.0.ebuild b/sys-libs/newlib/newlib-3.3.0.ebuild index 95217157d87a..6362c1259bd1 100644 --- a/sys-libs/newlib/newlib-3.3.0.ebuild +++ b/sys-libs/newlib/newlib-3.3.0.ebuild @@ -51,8 +51,10 @@ pkg_setup() { case ${CTARGET} in msp430*) - # bug #717610 - die "gcc on ${CTARGET} needs older newlib. Use newlib-3.1.0." + if ver_test $(gcc-version ${CTARGET}) -lt 10.1; then + # bug #717610 + die "gcc for ${CTARGET} has to be 10.1 or above" + fi ;; esac } diff --git a/sys-libs/newlib/newlib-9999.ebuild b/sys-libs/newlib/newlib-9999.ebuild index db1a3fad9cfb..bd8e3d1de3f5 100644 --- a/sys-libs/newlib/newlib-9999.ebuild +++ b/sys-libs/newlib/newlib-9999.ebuild @@ -29,6 +29,10 @@ SLOT="0" IUSE="nls threads unicode headers-only nano" RESTRICT="strip" +PATCHES=( + "${FILESDIR}"/${PN}-3.3.0-no-nano-cxx.patch +) + NEWLIBBUILD="${WORKDIR}/build" NEWLIBNANOBUILD="${WORKDIR}/build.nano" NEWLIBNANOTMPINSTALL="${WORKDIR}/nano_tmp_install" @@ -48,6 +52,15 @@ pkg_setup() { *) die "Use sys-devel/crossdev to build a newlib toolchain" ;; esac fi + + case ${CTARGET} in + msp430*) + if ver_test $(gcc-version ${CTARGET}) -lt 10.1; then + # bug #717610 + die "gcc for ${CTARGET} has to be 10.1 or above" + fi + ;; + esac } src_configure() { -- cgit v1.2.3