[Buildroot] [PATCH] flashrom: fix static build with uClibc
arnout at mind.be
Thu Sep 21 20:53:07 UTC 2017
On 20-09-17 10:17, Baruch Siach wrote:
> Define HAVE_STRNLEN to avoid local strnlen() definition.
> Signed-off-by: Baruch Siach <baruch at tkos.co.il>
> It seems like only uClibc is affected. Build with musl succeeds even
> though the resulting binary contains a global strnlen symbol.
musl puts strnlen in a separate strnlen.o file. Since linking is done per
object file, and there is no undefined symbol that pulls in strnlen.o (since
strnlen is already defined), it will just use the flashrom version of the function.
uClibc also puts strnlen in a separate object file. However, that object file
also contain the hidden symbol __GI_strnlen which is referred to from other
object files in the archive (e.g. vfprintf). Therefore, strnlen.o will be linked
in and you get a double definition.
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
More information about the buildroot