Skip to contentSkip to conversation

flashrom: fix static build with uClibc

PATCH New Baruch Siach 3 participants 5 messages Sep 20, 2017 – Oct 16, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 flashrom: fix static build with uClibc

Define HAVE_STRNLEN to avoid local strnlen() definition.

Fixes:
http://autobuild.buildroot.net/results/7dc/7dc4298e3a07c73e03f70205516d68a0f4c2d297/
http://autobuild.buildroot.net/results/e36/e362848eb45f6b8100131361e6e5faa546f0bbd8/
http://autobuild.buildroot.net/results/69e/69ef10ec710f418b4d10c1edb4f2ce2e49b522bf/

---
It seems like only uClibc is affected. Build with musl succeeds even though the resulting binary contains a global strnlen symbol.

---
 package/flashrom/flashrom.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/flashrom/flashrom.mk +2 -1
index 4ecdce8f4136..f9ab6294a524 100644
@@ -12,7 +12,8 @@ FLASHROM_LICENSE = GPL-2.0+
 FLASHROM_LICENSE_FILES = COPYING
 
 define FLASHROM_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
+		CFLAGS="$(TARGET_CFLAGS) -DHAVE_STRNLEN" -C $(@D)
 endef
 
 define FLASHROM_INSTALL_TARGET_CMDS
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/1 flashrom: fix static build with uClibc

Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Baruch" == Baruch Siach <[email protected]> writes:

Define HAVE_STRNLEN to avoid local strnlen() definition. Fixes:
http://autobuild.buildroot.net/results/7dc/7dc4298e3a07c73e03f70205516d68a0f4c2d297/
http://autobuild.buildroot.net/results/e36/e362848eb45f6b8100131361e6e5faa546f0bbd8/
http://autobuild.buildroot.net/results/69e/69ef10ec710f418b4d10c1edb4f2ce2e49b522bf/

Quoted 4 lines

---
It seems like only uClibc is affected. Build with musl succeeds even though the resulting binary contains a global strnlen symbol.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 flashrom: fix static build with uClibc

In reply to Baruch Siach
Quoted 11 lines · Baruch Siach

Define HAVE_STRNLEN to avoid local strnlen() definition.

Fixes:
http://autobuild.buildroot.net/results/7dc/7dc4298e3a07c73e03f70205516d68a0f4c2d297/
http://autobuild.buildroot.net/results/e36/e362848eb45f6b8100131361e6e5faa546f0bbd8/
http://autobuild.buildroot.net/results/69e/69ef10ec710f418b4d10c1edb4f2ce2e49b522bf/

---
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.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
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
#3 lore raw

PATCH 1/1 flashrom: fix static build with uClibc

In reply to Baruch Siach
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Baruch" == Baruch Siach <[email protected]> writes:

Define HAVE_STRNLEN to avoid local strnlen() definition. Fixes:
http://autobuild.buildroot.net/results/7dc/7dc4298e3a07c73e03f70205516d68a0f4c2d297/
http://autobuild.buildroot.net/results/e36/e362848eb45f6b8100131361e6e5faa546f0bbd8/
http://autobuild.buildroot.net/results/69e/69ef10ec710f418b4d10c1edb4f2ce2e49b522bf/

Quoted 4 lines

---
It seems like only uClibc is affected. Build with musl succeeds even though the resulting binary contains a global strnlen symbol.

Committed to 2017.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw

PATCH 1/1 flashrom: fix static build with uClibc

In reply to Baruch Siach
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Baruch" == Baruch Siach <[email protected]> writes:

Define HAVE_STRNLEN to avoid local strnlen() definition. Fixes:
http://autobuild.buildroot.net/results/7dc/7dc4298e3a07c73e03f70205516d68a0f4c2d297/
http://autobuild.buildroot.net/results/e36/e362848eb45f6b8100131361e6e5faa546f0bbd8/
http://autobuild.buildroot.net/results/69e/69ef10ec710f418b4d10c1edb4f2ce2e49b522bf/

Quoted 4 lines

---
It seems like only uClibc is affected. Build with musl succeeds even though the resulting binary contains a global strnlen symbol.

Committed to 2017.08.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard