Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/brltty: fix build with expat
@ 2020-02-14 16:40 Fabrice Fontaine
  2020-02-19 23:44 ` Thomas Petazzoni
  0 siblings, 1 reply; 8+ messages in thread
From: Fabrice Fontaine @ 2020-02-14 16:40 UTC (permalink / raw)
  To: buildroot

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

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/brltty/brltty.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/brltty/brltty.mk b/package/brltty/brltty.mk
index 11b8c0d35f..001f4cbb9f 100644
--- a/package/brltty/brltty.mk
+++ b/package/brltty/brltty.mk
@@ -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
-- 
2.24.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 1/1] package/brltty: fix build with expat
@ 2019-09-29  8:40 Fabrice Fontaine
  2019-09-30 21:46 ` Thomas Petazzoni
  2019-10-12 19:58 ` Thomas Petazzoni
  0 siblings, 2 replies; 8+ messages in thread
From: Fabrice Fontaine @ 2019-09-29  8:40 UTC (permalink / raw)
  To: buildroot

tbl2hex is a host command line that is built with:

TBL2HEX_OBJECTS_FOR_BUILD = tbl2hex.$(O_FOR_BUILD) $(PROGRAM_OBJECTS_FOR_BUILD) dataarea.$(O_FOR_BUILD) ttb_compile.$(O_FOR_BUILD) ttb_native.$(O_FOR_BUILD) atb_compile.$(O_FOR_BUILD) ctb_compile.$(O_FOR_BUILD) cldr.$(O_FOR_BUILD)
TBL2HEX_OBJECTS = $(TBL2HEX_OBJECTS_FOR_BUILD:.$(O_FOR_BUILD)=.$B)

tbl2hex$(X_FOR_BUILD): $(TBL2HEX_OBJECTS)
$(CC_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ $(TBL2HEX_OBJECTS) $(EXPAT_LIBS_FOR_BUILD) $(LDLIBS_FOR_BUILD)

So build fails if expat is enabled on target but not found on host:

gcc -DFOR_BUILD -I. -I. -I./../Programs -I../Programs -I../Headers -I./.. -I.. -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=2 -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_GNU_SOURCE  -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=2 -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_GNU_SOURCE -DHAVE_CONFIG_H -g -O2 -std=gnu99 -Wall -Werror=format-security -o cldr.build.o -c cldr.c
cldr.c:31:10: fatal error: expat.h: No such file or directory
 #include <expat.h>
          ^~~~~~~~~

To fix this issue, build host-expat if needed

Fixes:
 - http://autobuild.buildroot.org/results/362cfb57e4a91a066493269d8078d931529ddf69

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/brltty/brltty.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/brltty/brltty.mk b/package/brltty/brltty.mk
index b9d608b9f5..3ae8b899b8 100644
--- a/package/brltty/brltty.mk
+++ b/package/brltty/brltty.mk
@@ -51,7 +51,8 @@ BRLTTY_CONF_OPTS += --without-espeak
 endif
 
 ifeq ($(BR2_PACKAGE_EXPAT),y)
-BRLTTY_DEPENDENCIES += expat
+# host-expat is needed by tbl2hex's host program
+BRLTTY_DEPENDENCIES += host-expat expat
 BRLTTY_CONF_OPTS += --enable-expat
 else
 BRLTTY_CONF_OPTS += --disable-expat
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-02-19 23:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-14 16:40 [Buildroot] [PATCH 1/1] package/brltty: fix build with expat Fabrice Fontaine
2020-02-19 23:44 ` Thomas Petazzoni
  -- strict thread matches above, loose matches on Subject: below --
2019-09-29  8:40 Fabrice Fontaine
2019-09-30 21:46 ` Thomas Petazzoni
2019-10-01  6:42   ` Fabrice Fontaine
2019-10-05 20:37     ` Thomas Petazzoni
2019-10-09 17:16       ` Fabrice Fontaine
2019-10-12 19:58 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox