Skip to contentSkip to conversation

package/brltty: fix build with expat

PATCH New Fabrice Fontaine 2 participants 2 messages Feb 14, 2020 – Feb 19, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/brltty: fix build with expat

Build with expat fails since January 14th (for an unknown reason as commit cd16e18584066d2817d3acb3822e173f9f23455e does not seem to be the culprit even if this is the more suspicious commit around that time) on:

/usr/bin/gcc -L/home/buildroot/autobuild/instance-0/output-1/host/lib -Wl,-rpath,/home/buildroot/autobuild/instance-0/output-1/host/lib -Wl,-export-dynamic -o tbl2hex tbl2hex.build.o program.build.o pgmpath_none.build.o pid.build.o options.build.o params_none.build.o log.build.o log_history.build.o addresses.build.o file.build.o device.build.o parse.build.o variables.build.o datafile.build.o unicode.build.o charset.build.o charset_none.build.o timing.build.o async_handle.build.o async_data.build.o async_wait.build.o async_alarm.build.o async_task.build.o async_io.build.o async_event.build.o async_signal.build.o thread.build.o queue.build.o lock.build.o dynld_none.build.o ports_none.build.o system_linux.build.o hostcmd.build.o hostcmd_none.build.o dataarea.build.o ttb_compile.build.o ttb_native.build.o atb_compile.build.o ctb_compile.build.o cldr.build.o -L/home/buildroot/autobuild/instance-0/output-1/host/bin/../arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib -lexpat -lp
thread
/usr/bin/ld: skipping incompatible /home/buildroot/autobuild/instance-0/output-1/host/bin/../arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libc.so when searching for -lc /usr/bin/ld: skipping incompatible /home/buildroot/autobuild/instance-0/output-1/host/bin/../arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libc.a when searching for -lc async_signal.build.o: In function `setSignalMask':
async_signal.c:(.text+0xa5): undefined reference to `pthread_sigmask'

This is due to EXPAT_LIBS_FOR_BUILD being retrieved by pkg-config and
set to -L/home/buildroot/autobuild/instance-0/output-1/host/bin/../arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib -lexpat which is obviously wrong for a host program
As there is no easy way to fix the pkg-config call, just set
EXPAT_LIBS_FOR_BUILD to -lexpat

An other option would be to replace pkgconfig_flags_libs="--libs" by pkgconfig_flags_libs="--libs-only-l" in configure.ac

Fixes:
- http://autobuild.buildroot.org/results/7b89404dd84a337906d2fd4b22d7564fecf4fbf8

---
 package/brltty/brltty.mk | 3 +++
 1 file changed, 3 insertions(+)
package/brltty/brltty.mk +3 -0
index 11b8c0d35f..001f4cbb9f 100644
@@ -53,6 +53,9 @@ endif
 ifeq ($(BR2_PACKAGE_EXPAT),y)
 # host-expat is needed by tbl2hex's host program
 BRLTTY_DEPENDENCIES += host-expat expat
+# Set EXPAT_LIBS_FOR_BUILD otherwise -L$(STAGING_DIR)/usr/lib -lexpat will be
+# retrieved which is incorrect for a host program and will raise a build failure
+BRLTTY_MAKE_OPTS += EXPAT_LIBS_FOR_BUILD=-lexpat
 BRLTTY_CONF_OPTS += --enable-expat
 else
 BRLTTY_CONF_OPTS += --disable-expat
Signature · 1 line
2.24.1
#1 lore raw

PATCH 1/1 package/brltty: fix build with expat

Hello Fabrice,

Quoted 3 lines · On Fri, 14 Feb 2020 17:40:36 +0100 Fabrice Fontaine…

Build with expat fails since January 14th (for an unknown reason as commit cd16e18584066d2817d3acb3822e173f9f23455e does not seem to be the culprit even if this is the more suspicious commit around that time) on:

Thanks a lot for this patch, it was a good starting point to investigate more, and based on your research, I could dig deeper and submit what I believe is a more correct solution:

http://patchwork.ozlabs.org/patch/1241072/

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com