How to rebuild newlib and newlib-nano of GNU Arm Embedded Toolchain

I downloaded the toolchain “gcc-arm-none-eabi-6-2017-q2-update-win32-sha1.exe” (Windows) from https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads and installed it on my Windows 10 PC.

The installation folder contains a release.txt in “../share/doc/gcc-arm-none-eabi/” which tells:

This release includes the following items:

    <li>newlib and newlib-nano : git://sourceware.org/git/newlib-cygwin.git commit 0d79b021a4ec4e6b9aa1a9f6db0e29a137005ce7</li> </ul>

    And also the readme.txt in “../share/doc/gcc-arm-none-eabi/” contains:

      <li>C Libraries usage *</li> </ul>

      This toolchain is released with two prebuilt C libraries based on newlib: one is the standard newlib (libc.a) and the other is newlib-nano (libc_nano.a) for code size.

      Now I want exactly rebuild all the libc.a and libc_nano.a contained in “../arm-none-eabi/lib/thumb

      At the moment I can build on Ubuntu with “gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2

      $ # Downloaded newlib-cygwin (with corresponding hash) into folder newlib-cygwin $ mkdir build $ cd build $ ../newlib-cygwin/configure --target=arm-none-eabi --disable-newlib-supplied-syscalls $ make

      <strong>How do I have to configure the newlib to build the exact copies of libc.a and for libc_nano.a contained in gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2?</strong>

      $ # Downloaded newlib-cygwin (with corresponding hash) into folder newlib-cygwin $ mkdir build $ cd build $ ../newlib-cygwin/configure --target=arm-none-eabi --??? $ make


      If i understand you correctly, a more detailed question is: What configure options did 'GNU Arm Embedded Toolchain' developers used when building newlib libraries shipped in gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 archive? These ones for newlib:

      --target=arm-none-eabi --enable-newlib-io-long-long --enable-newlib-register-fini --enable-newlib-retargetable-locking --disable-newlib-supplied-syscalls --disable-nls

      And these ones for newlib-nano:

      --target=arm-none-eabi --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 --disable-nls

      How I got it? Let's walk through the process: These packages are build on launchpad, where from you find all the builds that took place on lanuchpad. I picked gcc-arm-none-eabi 6-2017q2-1 from 2017-10-24. There i can find the buildlog. I grepped the buildlog with | grep "^+ " | grep "configure " | grep 'src/newlib' and i was left with:

      + /<<PKGBUILDDIR>>/src/newlib/configure --target=arm-none-eabi --prefix=/<<PKGBUILDDIR>>/install-native --infodir=/<<PKGBUILDDIR>>/install-native/share/doc/gcc-arm-none-eabi/info --mandir=/<<PKGBUILDDIR>>/install-native/share/doc/gcc-arm-none-eabi/man --htmldir=/<<PKGBUILDDIR>>/install-native/share/doc/gcc-arm-none-eabi/html --pdfdir=/<<PKGBUILDDIR>>/install-native/share/doc/gcc-arm-none-eabi/pdf --enable-newlib-io-long-long --enable-newlib-register-fini --enable-newlib-retargetable-locking --disable-newlib-supplied-syscalls --disable-nls + /<<PKGBUILDDIR>>/src/newlib/configure --target=arm-none-eabi --prefix=/<<PKGBUILDDIR>>/build-native/target-libs --disable-newlib-supplied-syscalls --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 --disable-nls

      A bit of Sherlock Holmes and i deduced that the second line is newlib configured to build as newlib-nano (--enable-newlib-reent-small), the first is newlib configured to build as full newlib. To answer your topic question, to recompile newlib and newlib-nano the same way pass the options I have posted above to newlib ./configure script.


  • fatal error C1083: Cannot open include file: 'Carbon/ Carbon.h': No such file or directory
  • Meteor stuck at Extracting meteor-tool@1.4.0-1
  • Sitecore 8: Number of Recipients in List Manager not calculating properly
  • Kendo UI Timepicker custom interval format
  • How to stop auto-refreshing of SBT modules upon opening project in IDEA?
  • How to add product options in category page in opencart 2.0
  • Android: playing audio files in /res/raw by file name
  • Safari 8: Flexbox's “justify-content” isn't working at all
  • Error “Call to undefined method stdClass::delete()” while trying delete a row in Laravel
  • How will Roslyn help me in avoiding a recompile to deploy changes to my ASP.NET website?
  • Writing Unittest for generic classes… best approach?
  • FluentMigrator Failed Migrations Don't Rollback?
  • branch out of range compile error
  • Cannot convert a char value to money. The char value has incorrect syntax
  • Is there a chance to get -splash: work for SWT applications that require -XstartOnFirstThread?
  • Installing samr in in R 3.4
  • Microsoft Chart Controls for Microsoft .NET Framework 4.0
  • How do I pip install from Google Code?
  • What is ./.local/share/Trash (Unix) [closed]
  • include dlls in visual studio c++ 2008
  • Portable JRE on Linux - possible?
  • Building Qt project for C++11 standard
  • R Split data.frame using a column that represents and on/off switch
  • How to get latest version of a artifact on Bintray using JSONP
  • During installation of Django, why do I keep getting ImportError: No module named django?
  • Python pickle not one-to-one: different pickles give same object
  • error importing numpy
  • Very simple C++ DLL that can be called from .net
  • Change multiple background-images with jQuery
  • Installing Hadoop, Java Exception about illegal characters at index 7?
  • Android screen density dpi vs ppi
  • DirectX11 ClearRenderTargetViewback with transparent buffer?
  • Change an a tag attribute in JavaScript based on screen width
  • Convert array of 8 bytes to signed long in C++
  • Function pointer “assignment from incompatible pointer type” only when using vararg ellipsis
  • Understanding cpu registers
  • -fvisibility=hidden not passed by compiler for Debug builds
  • coudnt use logback because of log4j
  • Net Present Value in Excel for Grouped Recurring CF