raspberrypi / pico-sdk

BSD 3-Clause "New" or "Revised" License
3.64k stars 904 forks source link

Linker warning "_getentropy is not implemented and will always fail" #1768

Open bastetfurry opened 2 months ago

bastetfurry commented 2 months ago

Trying to compile my project i get the following warning after an OS upgrade that also brought in a new version of GCC:

/usr/lib/gcc/arm-none-eabi/13.2.1/../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/13.2.1/../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc.a(libc_a-getentropyr.o): in function `_getentropy_r':
/build/newlib-38V0JC/newlib-4.4.0.20231231/build/arm-none-eabi/thumb/v6-m/nofp/newlib/../../../../../../newlib/libc/reent/getentropyr.c:48:(.text+0xe): warning: _getentropy is not implemented and will always fail
/usr/lib/gcc/arm-none-eabi/13.2.1/../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/13.2.1/../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc.a(libc_a-getentropyr.o): note: the message above does not take linker garbage collection into account

OS: Ubuntu 24.04 GCC: arm-none-eabi-gcc (15:13.2.rel1-2) 13.2.1 20231009 SDK: v1.6.1

Can this safely be ignored for now or can i do something against this, besides downgrading the compiler?

kilograham commented 2 months ago

i have not seen this; can you provide a minimal repro; is this with C++? are you calling something that might need getentropy?

jaguilar commented 1 month ago

I saw this when I upgraded to the latest LTS of Ubuntu. It might be something that gets noticed with a new version of GCC and/or a new version of newlib?

lurch commented 1 month ago

This at least shows that this problem isn't specific to just pico-sdk :wink:

kilograham commented 1 month ago

Yeah, i'm sure it is a problem with newlib however the reason I asked for a repro case, is that i couldn't reproduce it!! (and then work around it)

bastetfurry commented 1 month ago

Sorry, haven't gotten around to create one yet. I don't want to FOSS my project just yet as i want it in a releaseworthy state, but if you could keep it under the lid until i am prepared to release it i could send you a copy. I am using Elmchans FatFS as a library but everything else is just the normal Pico SDK and the normal C and C++ library.

bastetfurry commented 1 month ago

As a sidenote, everything works as expected, so for now it seems one can ignore that warning.

kilograham commented 1 month ago

ok, yeah maybe just worth looking at the .DIS file and see if there are any references to entropy

bastetfurry commented 1 month ago

Bildschirmfoto vom 2024-07-24 23-03-54

CLion says "Nope"

bastetfurry commented 1 month ago

Oh, cool, this is my whole project in assembler, thanks for showing me that! ❤️