diff --git a/DEVELOPERS b/DEVELOPERS index 0a6e5a9c06..c103bdadf8 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1388,6 +1388,7 @@ F: package/python-rpi-gpio/ N: Ibai Erkiaga F: package/binutils-bare-metal/ F: package/gcc-bare-metal/ +F: package/newlib-bare-metal/ F: toolchain/toolchain-bare-metal-buildroot/ N: Ignacy Gawędzki @@ -2274,6 +2275,7 @@ F: configs/zynqmp_zcu106_defconfig F: package/binutils-bare-metal/ F: package/bootgen/ F: package/gcc-bare-metal/ +F: package/newlib-bare-metal/ F: package/versal-firmware/ F: toolchain/toolchain-bare-metal-buildroot/ diff --git a/package/newlib-bare-metal/Config.in b/package/newlib-bare-metal/Config.in new file mode 100644 index 0000000000..1ff3d5d8ec --- /dev/null +++ b/package/newlib-bare-metal/Config.in @@ -0,0 +1,2 @@ +config BR2_PACKAGE_NEWLIB_BARE_METAL + bool diff --git a/package/newlib-bare-metal/newlib-bare-metal.hash b/package/newlib-bare-metal/newlib-bare-metal.hash new file mode 100644 index 0000000000..f8c553cf86 --- /dev/null +++ b/package/newlib-bare-metal/newlib-bare-metal.hash @@ -0,0 +1,8 @@ +# Locally calculated +sha256 0c166a39e1bf0951dfafcd68949fe0e4b6d3658081d6282f39aeefc6310f2f13 newlib-4.4.0.20231231.tar.gz + +# Hashes for license files locally calculated +sha256 231f7edcc7352d7734a96eef0b8030f77982678c516876fcb81e25b32d68564c COPYING +sha256 a9bdde5616ecdd1e980b44f360600ee8783b1f99b8cc83a2beb163a0a390e861 COPYING.LIB +sha256 f3b7f3e4426b1fa6f60198dae7adfedd94b77b28db2d108adc0253575011e0ff COPYING.LIBGLOSS +sha256 422aa40293093fb54fc66e692a0d68fd0b24ed5602e5d1d33ad05ba3909057e9 COPYING.NEWLIB diff --git a/package/newlib-bare-metal/newlib-bare-metal.mk b/package/newlib-bare-metal/newlib-bare-metal.mk new file mode 100644 index 0000000000..452bc4da25 --- /dev/null +++ b/package/newlib-bare-metal/newlib-bare-metal.mk @@ -0,0 +1,52 @@ +################################################################################ +# +# newlib-bare-metal +# +################################################################################ + +NEWLIB_BARE_METAL_VERSION = 4.4.0 +NEWLIB_BARE_METAL_SITE = ftp://sourceware.org/pub/newlib +NEWLIB_BARE_METAL_SOURCE = newlib-$(NEWLIB_BARE_METAL_VERSION).20231231.tar.gz +NEWLIB_BARE_METAL_DEPENDENCIES = host-gcc-bare-metal +NEWLIB_BARE_METAL_ADD_TOOLCHAIN_DEPENDENCY = NO +NEWLIB_BARE_METAL_LICENSE = GPL-2.0, GPL-3.0, LGPL-2.1, LGPL-3.0 +NEWLIB_BARE_METAL_LICENSE_FILES = \ + COPYING \ + COPYING.LIB \ + COPYING.LIBGLOSS \ + COPYING.NEWLIB + +NEWLIB_BARE_METAL_INSTALL_STAGING = YES +NEWLIB_BARE_METAL_INSTALL_TARGET = NO + +define NEWLIB_BARE_METAL_CONFIGURE_CMDS + (cd $(@D) && \ + PATH=$(BR_PATH) \ + ./configure \ + --target=$(TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH_TUPLE) \ + --prefix=/usr \ + --enable-newlib-io-c99-formats \ + --enable-newlib-io-long-long \ + --enable-newlib-io-float \ + --enable-newlib-io-long-double \ + --disable-multilib \ + ) +endef + +define NEWLIB_BARE_METAL_BUILD_CMDS + PATH=$(BR_PATH) $(MAKE1) -C $(@D) +endef + +define NEWLIB_BARE_METAL_INSTALL_STAGING_CMDS + PATH=$(BR_PATH) $(MAKE1) -C $(@D) DESTDIR=$(TOOLCHAIN_BARE_METAL_BUILDROOT_SYSROOT) install +endef + +define NEWLIB_BARE_METAL_FIXUP + mv $(TOOLCHAIN_BARE_METAL_BUILDROOT_SYSROOT)/usr/$(TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH_TUPLE)/include \ + $(TOOLCHAIN_BARE_METAL_BUILDROOT_SYSROOT)/usr/include + mv $(TOOLCHAIN_BARE_METAL_BUILDROOT_SYSROOT)/usr/$(TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH_TUPLE)/lib \ + $(TOOLCHAIN_BARE_METAL_BUILDROOT_SYSROOT)/usr/lib +endef +NEWLIB_BARE_METAL_POST_INSTALL_STAGING_HOOKS += NEWLIB_BARE_METAL_FIXUP + +$(eval $(generic-package))