Gnuk with GCC >= 5

NIIBE Yutaka gniibe at
Mon Aug 27 03:30:46 CEST 2018

Bertrand Jacquin <bertrand at> wrote:
> After doing
> the same operation on a different host where the firmware was built
> using gcc 4.9.4, the USB key was detected normally as usual.
> I build the firmware with several version of gcc
> and noticed that firmware built using gcc 5.9.4 was fine when firmwares
> build with gcc 6.4.0 or 7.3.0 produced non functional firmwares.

I think that I once (or twice) had encountered an issue in upgrading
GNU Toolchain.

What's your libc?  Is Gnuk linked correct version?

For me, when it's 6.3.1, I have following entries in

                              build/sha512.o (__aeabi_llsr)
                              build/sha512.o (__aeabi_llsl)
                              build/openpgp.o (memcmp)
                              build/call-rsa.o (memcpy)
                              build/usb_ctrl.o (memset)
                              build/bignum.o (strlen)

The important point is that we need to use V7-M/Thumb implementation of
libc, while there are multiple implementations.  If it's not thumb one,
the first call memset will cause failure, IIRC.

I needed to upgrade newlib together.  It should be handled by the
gcc-arm-none-eabi package with dependency.  It seems that this problem
has been fixed by gcc-arm-none-eabi version 15:7-2018-q2-3 recently.

More information about the Gnuk-users mailing list