* [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
* [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-01 6:42 ` Fabrice Fontaine
2019-10-12 19:58 ` Thomas Petazzoni
1 sibling, 1 reply; 8+ messages in thread
From: Thomas Petazzoni @ 2019-09-30 21:46 UTC (permalink / raw)
To: buildroot
Hello Fabrice,
On Sun, 29 Sep 2019 10:40:04 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
> 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>
Maybe it's because it's late and I'm no longer thinking properly, but
do you understand how disabling expat prevents the cldr program from
being built, and therefore the tbl2hex utility tool from being built ?
They seem to be unconditionally built by Programs/Makefile.in.
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 1/1] package/brltty: fix build with expat
2019-09-30 21:46 ` Thomas Petazzoni
@ 2019-10-01 6:42 ` Fabrice Fontaine
2019-10-05 20:37 ` Thomas Petazzoni
0 siblings, 1 reply; 8+ messages in thread
From: Fabrice Fontaine @ 2019-10-01 6:42 UTC (permalink / raw)
To: buildroot
Dear Thomas,
Le lun. 30 sept. 2019 ? 23:46, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> a ?crit :
>
> Hello Fabrice,
>
> On Sun, 29 Sep 2019 10:40:04 +0200
> Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
>
> > 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>
>
> Maybe it's because it's late and I'm no longer thinking properly, but
> do you understand how disabling expat prevents the cldr program from
> being built, and therefore the tbl2hex utility tool from being built ?
> They seem to be unconditionally built by Programs/Makefile.in.
cldr.c is mostly an empty shell without expat as most of the code is
protected by ifdef HAVE_EXPAT blocks, see
https://github.com/brltty/brltty/blob/aba3d8cc2dc765a0933aabb609928e568e085d39/Programs/cldr.c.
>
> Thanks,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
Best Regards,
Fabrice
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 1/1] package/brltty: fix build with expat
2019-10-01 6:42 ` Fabrice Fontaine
@ 2019-10-05 20:37 ` Thomas Petazzoni
2019-10-09 17:16 ` Fabrice Fontaine
0 siblings, 1 reply; 8+ messages in thread
From: Thomas Petazzoni @ 2019-10-05 20:37 UTC (permalink / raw)
To: buildroot
On Tue, 1 Oct 2019 08:42:24 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
> > Maybe it's because it's late and I'm no longer thinking properly, but
> > do you understand how disabling expat prevents the cldr program from
> > being built, and therefore the tbl2hex utility tool from being built ?
> > They seem to be unconditionally built by Programs/Makefile.in.
> cldr.c is mostly an empty shell without expat as most of the code is
> protected by ifdef HAVE_EXPAT blocks, see
> https://github.com/brltty/brltty/blob/aba3d8cc2dc765a0933aabb609928e568e085d39/Programs/cldr.c.
OK, but where is the logic that links with -lexpat when it's available,
and doesn't link with -lexpat when not available ? I'm a bit confused
by the build logic of this package I must say.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 1/1] package/brltty: fix build with expat
2019-10-05 20:37 ` Thomas Petazzoni
@ 2019-10-09 17:16 ` Fabrice Fontaine
0 siblings, 0 replies; 8+ messages in thread
From: Fabrice Fontaine @ 2019-10-09 17:16 UTC (permalink / raw)
To: buildroot
Dear Thomas,
Le sam. 5 oct. 2019 ? 22:37, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> a ?crit :
>
> On Tue, 1 Oct 2019 08:42:24 +0200
> Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
>
> > > Maybe it's because it's late and I'm no longer thinking properly, but
> > > do you understand how disabling expat prevents the cldr program from
> > > being built, and therefore the tbl2hex utility tool from being built ?
> > > They seem to be unconditionally built by Programs/Makefile.in.
> > cldr.c is mostly an empty shell without expat as most of the code is
> > protected by ifdef HAVE_EXPAT blocks, see
> > https://github.com/brltty/brltty/blob/aba3d8cc2dc765a0933aabb609928e568e085d39/Programs/cldr.c.
>
> OK, but where is the logic that links with -lexpat when it's available,
> and doesn't link with -lexpat when not available ? I'm a bit confused
> by the build logic of this package I must say.
Linking with expat is done through EXPAT_LIBS in Programs/Makefile.in.
EXPAT_LIBS is set to @expat_libs@ in config.mk.in.
expat_libs is set in configure.ac depending on BRLTTY_HAVE_PACKAGE
result (which is basically a pkg-config wrapper defined in
m4/brltty.m4).
The main issue with this package is that it assumes that if expat is
available on target then it is also available on host.
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
Best Regards,
Fabrice
^ permalink raw reply [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
1 sibling, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2019-10-12 19:58 UTC (permalink / raw)
To: buildroot
Hello Fabrice,
On Sun, 29 Sep 2019 10:40:04 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
> 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>
> ^~~~~~~~~
Did you really test this patch on a system where expat was not
installed system-wide ? Because I did, and building host-expat before
building brltty doesn't solve the build issue, I still get:
cldr.c:31:19: fatal error: expat.h: No such file or directory
compilation terminated.
And this is quite expected if you look at the build command line:
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
There's nowhere a -I flag that points to $(HOST_DIR)/include. I guess
it at least needs passing some CFLAGS_FOR_BUILD or something like that.
Could you have a look ?
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* [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
2020-02-14 16:40 [Buildroot] [PATCH 1/1] package/brltty: fix build with expat Fabrice Fontaine
@ 2020-02-19 23:44 ` Thomas Petazzoni
0 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2020-02-19 23:44 UTC (permalink / raw)
To: buildroot
Hello Fabrice,
On Fri, 14 Feb 2020 17:40:36 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
> 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
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [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