All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/2] package/harfbuzz: disable test programs
@ 2015-05-12 21:51 Romain Naour
  2015-05-12 21:51 ` [Buildroot] [PATCH v2 2/2] Revert "harfbuzz: fix static linking of test programs when toolchain has threads support" Romain Naour
  2015-05-18 21:03 ` [Buildroot] [PATCH v2 1/2] package/harfbuzz: disable test programs Thomas Petazzoni
  0 siblings, 2 replies; 5+ messages in thread
From: Romain Naour @ 2015-05-12 21:51 UTC (permalink / raw)
  To: buildroot

Workaround a build issue by disabling all test
binaries since it forget to link with -lstd++.

Add a new configure option to disable test programs
in a upstreamable way.

Fixes:
http://autobuild.buildroot.net/results/210/2107f9dfb39eeb6559fb4271c7af8b39aef521ca/

Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
v2: reword commit log
---
 .../0001-autotools-add-disable-tests-option.patch  | 57 ++++++++++++++++++++++
 package/harfbuzz/harfbuzz.mk                       |  6 ++-
 2 files changed, 61 insertions(+), 2 deletions(-)
 create mode 100644 package/harfbuzz/0001-autotools-add-disable-tests-option.patch

diff --git a/package/harfbuzz/0001-autotools-add-disable-tests-option.patch b/package/harfbuzz/0001-autotools-add-disable-tests-option.patch
new file mode 100644
index 0000000..59a7b5a
--- /dev/null
+++ b/package/harfbuzz/0001-autotools-add-disable-tests-option.patch
@@ -0,0 +1,57 @@
+From 4641f22b2297fdbf4206ccaea971868301887aa7 Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@openwide.fr>
+Date: Fri, 8 May 2015 15:58:51 +0200
+Subject: [PATCH] autotools: add --disable-tests option
+
+Disable all test programs in order to only build harfbuzz
+librarie and speed up the build time.
+
+Signed-off-by: Romain Naour <romain.naour@openwide.fr>
+---
+ Makefile.am  |  6 +++++-
+ configure.ac | 12 ++++++++++++
+ 2 files changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 47aeb97..0f8ee46 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -4,7 +4,11 @@ NULL =
+ 
+ ACLOCAL_AMFLAGS = -I m4
+ 
+-SUBDIRS = src util test docs
++SUBDIRS = src util docs
++
++if WITH_TESTS
++SUBDIRS += test
++endif
+ 
+ EXTRA_DIST = \
+ 	autogen.sh \
+diff --git a/configure.ac b/configure.ac
+index 5baad1f..b15f31e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -408,6 +408,18 @@ fi
+ 
+ dnl ===========================================================================
+ 
++AC_ARG_ENABLE([tests],
++  AS_HELP_STRING([--enable-tests], [build tests [default=yes]]),
++  [], enable_tests=yes
++)
++have_tests=yes
++if test "$enable_tests" = "no"; then
++  have_tests="no"
++fi
++AM_CONDITIONAL(WITH_TESTS, [test "$have_tests" = "yes"])
++
++dnl ===========================================================================
++
+ AC_CONFIG_FILES([
+ Makefile
+ src/Makefile
+-- 
+1.9.3
+
diff --git a/package/harfbuzz/harfbuzz.mk b/package/harfbuzz/harfbuzz.mk
index 9cfd613..3f0b028 100644
--- a/package/harfbuzz/harfbuzz.mk
+++ b/package/harfbuzz/harfbuzz.mk
@@ -10,7 +10,8 @@ HARFBUZZ_SOURCE = harfbuzz-$(HARFBUZZ_VERSION).tar.bz2
 HARFBUZZ_LICENSE = MIT, ISC (ucdn library)
 HARFBUZZ_LICENSE_FILES = COPYING src/hb-ucdn/COPYING
 HARFBUZZ_INSTALL_STAGING = YES
-HARFBUZZ_CONF_OPTS = --without-coretext --without-uniscribe --without-graphite2
+HARFBUZZ_CONF_OPTS = --disable-tests --without-coretext --without-uniscribe \
+	--without-graphite2
 
 # freetype & glib2 support required by host-pango
 HOST_HARFBUZZ_DEPENDENCIES = \
@@ -23,7 +24,8 @@ HOST_HARFBUZZ_CONF_OPTS = \
 	--with-cairo=no \
 	--with-icu=no \
 	--with-freetype=yes \
-	--with-glib=yes
+	--with-glib=yes \
+	--disable-tests
 
 # beta libtool version
 HARFBUZZ_AUTORECONF = YES
-- 
1.9.3

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

* [Buildroot] [PATCH v2 2/2] Revert "harfbuzz: fix static linking of test programs when toolchain has threads support"
  2015-05-12 21:51 [Buildroot] [PATCH v2 1/2] package/harfbuzz: disable test programs Romain Naour
@ 2015-05-12 21:51 ` Romain Naour
  2015-05-18 21:03 ` [Buildroot] [PATCH v2 1/2] package/harfbuzz: disable test programs Thomas Petazzoni
  1 sibling, 0 replies; 5+ messages in thread
From: Romain Naour @ 2015-05-12 21:51 UTC (permalink / raw)
  To: buildroot

harfbuzz version was updated since this change and
it's no not useful anymore to add -pthread in LDFLAGS (fixed upstream).

Also, test programs are not build anymore since --disable-tests
was used in harfbuzz.mk

This reverts commit 3d03017f53c2566ed32a0ae76d79eeb1ef4a7feb.

Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
v2: reword commit log
    add Sob line
---
 package/harfbuzz/harfbuzz.mk | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/package/harfbuzz/harfbuzz.mk b/package/harfbuzz/harfbuzz.mk
index 3f0b028..c5182a4 100644
--- a/package/harfbuzz/harfbuzz.mk
+++ b/package/harfbuzz/harfbuzz.mk
@@ -30,11 +30,6 @@ HOST_HARFBUZZ_CONF_OPTS = \
 # beta libtool version
 HARFBUZZ_AUTORECONF = YES
 
-ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
-# forgets to link test programs with -pthread breaking static link
-HARFBUZZ_CONF_ENV = LDFLAGS="$(TARGET_LDFLAGS) -pthread"
-endif
-
 ifeq ($(BR2_PACKAGE_CAIRO),y)
 HARFBUZZ_DEPENDENCIES += cairo
 HARFBUZZ_CONF_OPTS += --with-cairo=yes
-- 
1.9.3

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

* [Buildroot] [PATCH v2 1/2] package/harfbuzz: disable test programs
  2015-05-12 21:51 [Buildroot] [PATCH v2 1/2] package/harfbuzz: disable test programs Romain Naour
  2015-05-12 21:51 ` [Buildroot] [PATCH v2 2/2] Revert "harfbuzz: fix static linking of test programs when toolchain has threads support" Romain Naour
@ 2015-05-18 21:03 ` Thomas Petazzoni
  2015-05-18 21:40   ` Romain Naour
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2015-05-18 21:03 UTC (permalink / raw)
  To: buildroot

Dear Romain Naour,

On Tue, 12 May 2015 23:51:23 +0200, Romain Naour wrote:
> Workaround a build issue by disabling all test
> binaries since it forget to link with -lstd++.
> 
> Add a new configure option to disable test programs
> in a upstreamable way.
> 
> Fixes:
> http://autobuild.buildroot.net/results/210/2107f9dfb39eeb6559fb4271c7af8b39aef521ca/
> 
> Signed-off-by: Romain Naour <romain.naour@openwide.fr>

I was almost going to apply this one, but I'm not entirely happy in
fact. I really works around the real problem, and does not fix it:
imagine a real program now links statically to harfbuzz using harfbuzz
pkg-config file. This pkg-config file does not advertise the dependency
on libstdc++ in its Libs.private, so the link would also fail, just
like it currently fails for the test programs.

Unfortunately, fixing the .pc file would not fix the internal harfbuzz
test programs, since they don't use pkg-config to get the link flags.

To be honest, I am not sure what is the correct automake way of fixing
this problem. Maybe:

-LDADD = $(top_builddir)/src/libharfbuzz.la $(GLIB_LIBS)
+LDADD = $(top_builddir)/src/libharfbuzz.la $(GLIB_LIBS) -lstdc++

in test/api/Makefile.am ?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v2 1/2] package/harfbuzz: disable test programs
  2015-05-18 21:03 ` [Buildroot] [PATCH v2 1/2] package/harfbuzz: disable test programs Thomas Petazzoni
@ 2015-05-18 21:40   ` Romain Naour
  2015-05-19  7:33     ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Romain Naour @ 2015-05-18 21:40 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

Le 18/05/2015 23:03, Thomas Petazzoni a ?crit :
> Dear Romain Naour,
> 
> On Tue, 12 May 2015 23:51:23 +0200, Romain Naour wrote:
>> Workaround a build issue by disabling all test
>> binaries since it forget to link with -lstd++.
>>
>> Add a new configure option to disable test programs
>> in a upstreamable way.
>>
>> Fixes:
>> http://autobuild.buildroot.net/results/210/2107f9dfb39eeb6559fb4271c7af8b39aef521ca/
>>
>> Signed-off-by: Romain Naour <romain.naour@openwide.fr>
> 
> I was almost going to apply this one, but I'm not entirely happy in
> fact. I really works around the real problem, and does not fix it:
> imagine a real program now links statically to harfbuzz using harfbuzz
> pkg-config file. This pkg-config file does not advertise the dependency
> on libstdc++ in its Libs.private, so the link would also fail, just
> like it currently fails for the test programs.

-lstdc++ is only needed by libharfbuzz-icu.la which use the icu package.
So maybe -lstdc++ is missing in Libs.private from icu-uc.pc ?

> 
> Unfortunately, fixing the .pc file would not fix the internal harfbuzz
> test programs, since they don't use pkg-config to get the link flags.
> 
> To be honest, I am not sure what is the correct automake way of fixing
> this problem. Maybe:
> 
> -LDADD = $(top_builddir)/src/libharfbuzz.la $(GLIB_LIBS)
> +LDADD = $(top_builddir)/src/libharfbuzz.la $(GLIB_LIBS) -lstdc++
> 
> in test/api/Makefile.am ?

You would said ;)
test_unicode_LDADD += $(top_builddir)/src/libharfbuzz-icu.la -lstdc++

With that fixed, Harbuzz build fine.

Thanks for the review.

Best regards,
Romain

> 
> Best regards,
> 
> Thomas
> 

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

* [Buildroot] [PATCH v2 1/2] package/harfbuzz: disable test programs
  2015-05-18 21:40   ` Romain Naour
@ 2015-05-19  7:33     ` Thomas Petazzoni
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2015-05-19  7:33 UTC (permalink / raw)
  To: buildroot

Romain,

On Mon, 18 May 2015 23:40:02 +0200, Romain Naour wrote:

> > I was almost going to apply this one, but I'm not entirely happy in
> > fact. I really works around the real problem, and does not fix it:
> > imagine a real program now links statically to harfbuzz using harfbuzz
> > pkg-config file. This pkg-config file does not advertise the dependency
> > on libstdc++ in its Libs.private, so the link would also fail, just
> > like it currently fails for the test programs.
> 
> -lstdc++ is only needed by libharfbuzz-icu.la which use the icu package.
> So maybe -lstdc++ is missing in Libs.private from icu-uc.pc ?

Yes, might be. It's weird: harfbuzz uses .cc as the extension for its
source files, but it seems to be only pure C, not C++. And to add to
the confusion, it also uses AC_PROG_CXX in its configure.ac, which
would also indicate it's in C++.

But obviously, icu is implemented in C++, so the icu-uc pkg-config file
should have the corresponding -lstdc++ Libs.private flag.


> You would said ;)
> test_unicode_LDADD += $(top_builddir)/src/libharfbuzz-icu.la -lstdc++
> 
> With that fixed, Harbuzz build fine.

Sounds good to me.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

end of thread, other threads:[~2015-05-19  7:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-12 21:51 [Buildroot] [PATCH v2 1/2] package/harfbuzz: disable test programs Romain Naour
2015-05-12 21:51 ` [Buildroot] [PATCH v2 2/2] Revert "harfbuzz: fix static linking of test programs when toolchain has threads support" Romain Naour
2015-05-18 21:03 ` [Buildroot] [PATCH v2 1/2] package/harfbuzz: disable test programs Thomas Petazzoni
2015-05-18 21:40   ` Romain Naour
2015-05-19  7:33     ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.