Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#50481 - [arm-none-eabi-newlib] newlib nano's header files are overwritten by the header files of newlib

Attached to Project: Community Packages
Opened by Pieter Willemsen (pieter_) - Monday, 22 August 2016, 13:16 GMT
Last edited by Anatol Pomozov (anatolik) - Wednesday, 30 May 2018, 12:33 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Anatol Pomozov (anatolik)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: The package installs both newlib and newlib-nano. The header files of newlib nano are overwritten by the newlib's files during installation


Additional info:
* package version: arm-none-eabi-newlib-2.4.0-3

Steps to reproduce:
1. pacman -Sy arm-none-eabi-newlib
2. the file /usr/arm-none-eabi/include/newlib.h is for the normall newlib build. I can't find newlib.h for the nano build
This task depends upon

Closed by  Anatol Pomozov (anatolik)
Wednesday, 30 May 2018, 12:33 GMT
Reason for closing:  Fixed
Comment by Anatol Pomozov (anatolik) - Friday, 26 August 2016, 15:35 GMT
AFAIK interface (and hence header files) for 'normal' newlib and 'nano' are the same.

Why do you need nano's version of newlib.h? What is your use-case?
Comment by Pieter Willemsen (pieter_) - Wednesday, 21 March 2018, 11:15 GMT
All the header files are the same except for newlib.h. Attached is the diff (newlib_h.diff)

For the ubuntu package (https://packages.ubuntu.com/artful/all/libnewlib-arm-none-eabi/filelist), it is located in a separate directory. (/usr/include/newlib/nano/newlib.h vs /usr/include/newlib/newlib.h)

As a temporary fix I added:
install -d "$pkgdir"/usr/$_target/include/newlib-nano
install -m644 -t "$pkgdir"/usr/$_target/include/newlib-nano "$pkgdir"/usr/$_target/include/newlib.h
to the package section of the PKGBUILD just after installing the nano version so the nano newlib.h ends up in include/newlib-nano/. I called it newlib-nano because the nano.specs files have this directory name in it

My use-case for this is in (https://github.com/OTAkeys/RIOT/blob/d05c147c8ab7f12fa0cabf43573948def099168d/sys/newlib_thread_safe/Makefile.include) they are trying to detect if the installed version of newlib nano is compiled with reent small and it is based on the newlib.h header file. The gcc compilation flags are set in (https://github.com/OTAkeys/RIOT/blob/master/makefiles/libc/newlib.mk).
Comment by Pieter Willemsen (pieter_) - Monday, 28 May 2018, 15:12 GMT
In my previous reply the url of the ubuntu package was wrong. It should be https://packages.ubuntu.com/artful/all/libnewlib-dev/filelist (This url is of the newlib header files also used by libnewlib-arm-none-eabi)

Comment by Anatol Pomozov (anatolik) - Tuesday, 29 May 2018, 05:50 GMT
Is this /include/newlib-nano an Ubuntu specific feature? I can't find this file neither in Debian nor in Fedora newlib packages.
Comment by Juan I Carrano (jcarrano) - Tuesday, 29 May 2018, 08:47 GMT
The /include/newlib-nano path is coded in to newlib itself, in the spec file (see https://github.com/bminor/newlib/blob/master/libgloss/arm/elf-nano.specs). As it stands now, this package's nano.specs file contradicts what is in the filesystem. Nano is a separate library with different configuration and thus must have different headers.

WTR other systems, see Gentoo's ebuild file, for example ( https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-libs/newlib/newlib-2.5.0.ebuild ). They put the nano headers in a separate directory too.
Comment by Pieter Willemsen (pieter_) - Tuesday, 29 May 2018, 09:49 GMT
For debian it seems to be there (https://packages.debian.org/buster/all/libnewlib-dev/filelist) file (/usr/include/newlib/nano/newlib.h)
For Fedora it seems to be missing
Comment by Anatol Pomozov (anatolik) - Tuesday, 29 May 2018, 14:28 GMT
Thank you folks for the clarification. I just added the header and pushed to [community-testing] as arm-none-eabi-newlib-3.0.0.20180226-2. Please test it and verify that it works as expected.
Comment by Juan I Carrano (jcarrano) - Wednesday, 30 May 2018, 08:08 GMT
I just tested it and it works! In particular, passing the option "--specs=nano.specs" to GCC now causes the correct newlib.h with the correct defines to be included.

Thanks very much!

Loading...