Package: libnewlib-dev Version: 2.1.0+git20141201.db59ff3-1 Severity: normal Tags: patch
Dear Maintainer, Code built against newlib-nano needs to use newlib-nano's version of newlib.h, because things like the size and layout of struct _reent are different. There are two patches attached: - The first copies newlib.h from the -nano build to /usr/include/newlib/nano/newlib.h in the installed package, so that it's available for use. - The second adjusts the nano.specs file to add the appropriate include path, so that "#include <newlib.h>" pulls in the correct file for both cases (with/without "-specs=nano.specs"). This is so that the user does not need to manually specify the include path in their build. I'm not very familiar with specs files, so there may be a better way to handle that second case that avoids having to hardcode the path. The first patch is more important and only affects the debian/ dir, the other might be better coordinated with upstream? Jim -- System Information: Debian Release: jessie/sid APT prefers testing APT policy: (250, 'testing'), (200, 'stable'), (50, 'unstable'), (1, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 3.14-2-amd64 (SMP w/4 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash libnewlib-dev depends on no packages. libnewlib-dev recommends no packages. Versions of packages libnewlib-dev suggests: ii gcc-arm-none-eabi 4.8.3-9+11 ii libnewlib-arm-none-eabi 2.1.0+git20141201.db59ff3-1 -- no debconf information
>From 235fd4040650b5a3cdca018b089f63f5e34a87f5 Mon Sep 17 00:00:00 2001 From: Jim Paris <j...@jtan.com> Date: Thu, 12 Feb 2015 12:30:44 -0500 Subject: [PATCH 1/2] Ship nano/newlib.h --- debian/rules | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/debian/rules b/debian/rules index b234fe72be86..a0f2330ee4e3 100755 --- a/debian/rules +++ b/debian/rules @@ -100,6 +100,11 @@ override_dh_auto_install: find $(TMP_NANO_DIR) -regex ".*/lib\(c\|g\|rdimon\)\.a" \ -exec rename 's@$(TMP_NANO_DIR)/(.*).a@$(TMP_DIR)/$$1_nano.a@' \{\} \+ # + # Move nano's version of newlib.h to nano/newlib.h + mkdir -p $(TMP_DIR)/usr/lib/$(TARGET)/include/nano + mv $(TMP_NANO_DIR)/usr/lib/$(TARGET)/include/newlib.h \ + $(TMP_DIR)/usr/lib/$(TARGET)/include/nano/newlib.h + # # Build newlib-source package mkdir -p $(P_SRC)/usr/src/newlib cp ../newlib_$(UVERSION).orig.tar.xz $(P_SRC)/usr/src/newlib/newlib-$(UVERSION).tar.xz -- 2.1.3
>From bd495d655003eb97f143bb7bb19d05333046b7fb Mon Sep 17 00:00:00 2001 From: Jim Paris <j...@jtan.com> Date: Thu, 12 Feb 2015 12:54:40 -0500 Subject: [PATCH 2/2] Add /usr/include/newlib/nano to search path in nano.specs --- libgloss/arm/elf-nano.specs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libgloss/arm/elf-nano.specs b/libgloss/arm/elf-nano.specs index 60dc407c678b..c96c57aee50b 100644 --- a/libgloss/arm/elf-nano.specs +++ b/libgloss/arm/elf-nano.specs @@ -1,5 +1,6 @@ %rename link nano_link %rename link_gcc_c_sequence nano_link_gcc_c_sequence +%rename cpp nano_cpp *nano_libc: -lc_nano @@ -16,3 +17,5 @@ *lib: %{!shared:%{g*:-lg_nano} %{!p:%{!pg:-lc_nano}}%{p:-lc_p}%{pg:-lc_p}} +*cpp: +-I/usr/include/newlib/nano %(nano_cpp) -- 2.1.3