All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] qt: fix build for arm with BR2_STATIC_LIBS
@ 2015-10-06 10:56 Alexander Lukichev
  2015-10-06 21:51 ` Arnout Vandecappelle
  2015-10-07  7:02 ` [Buildroot] [PATCH v2] " Alexander Lukichev
  0 siblings, 2 replies; 7+ messages in thread
From: Alexander Lukichev @ 2015-10-06 10:56 UTC (permalink / raw)
  To: buildroot

Some Buildroot-generated static toolchains for ARM do not have
dlfcn.h header, which breaks builds of qt-4.8.7 because its
QtCore's plugin loader expects this header to be present (and
dynamic libraries to be supported). For certain platforms without
dynamic libraries, there is a QT_NO_DYNAMIC_LIBRARY constant
defined in plugin loader's source. This patch puts that constant
into Qt's build environment if Buildroot is configured without
shared library support, and prevents plugin loader from defining
it if it has already been defined.

Fixes:
- http://autobuild.buildroot.net/results/11a4c19638ca211bd2a424fd92602166235c9433
- http://autobuild.buildroot.net/results/c056e8781558267f6971a5f017f47e90dcf24e07
- http://autobuild.buildroot.net/results/b8f34afa8686e890a1a3882a52081bb6a3b9c13b
and several others.

Signed-off-by: Alexander Lukichev <alexander.lukichev@gmail.com>
---
 package/qt/0009-no-dynamic-library-plugins.patch | 27 ++++++++++++++++++++++++
 package/qt/qt.mk                                 |  4 ++++
 2 files changed, 31 insertions(+)
 create mode 100644 package/qt/0009-no-dynamic-library-plugins.patch

diff --git a/package/qt/0009-no-dynamic-library-plugins.patch b/package/qt/0009-no-dynamic-library-plugins.patch
new file mode 100644
index 0000000..3836677
--- /dev/null
+++ b/package/qt/0009-no-dynamic-library-plugins.patch
@@ -0,0 +1,27 @@
+Do not define QT_NO_DYNAMIC_LIBRARY if it is already defined
+
+QtCore plugin loader behaves correctly on platforms that do not support
+dynamic libraries. This is implemented by QT_NO_DYNAMIC_LIBRARY constant
+defined at compile time in the loader's source for specific platforms.
+Since Buildroot does not have a separate platform defined for it in
+mkspecs, if shared libraries are not supported by its configuration, the
+constant is specified in Qt's build environment. This patch prevents
+compilation error in such cases.
+
+Signed-off-by: Alexander Lukichev <alexander.lukichev@gmail.com>
+
+diff -uNrp qt-4.8.7.orig/src/corelib/plugin/qlibrary_unix.cpp qt-4.8.7/src/corelib/plugin/qlibrary_unix.cpp
+--- qt-4.8.7.orig/src/corelib/plugin/qlibrary_unix.cpp	2015-05-07 17:14:48.000000000 +0300
++++ qt-4.8.7/src/corelib/plugin/qlibrary_unix.cpp	2015-10-06 08:53:27.189232642 +0300
+@@ -56,9 +56,11 @@
+ #include <string.h>
+ #endif
+ 
++#ifndef QT_NO_DYNAMIC_LIBRARY
+ #if (defined(Q_OS_VXWORKS) && !defined(VXWORKS_RTP)) || defined (Q_OS_NACL)
+ #define QT_NO_DYNAMIC_LIBRARY
+ #endif
++#endif
+ 
+ QT_BEGIN_NAMESPACE
+ 
diff --git a/package/qt/qt.mk b/package/qt/qt.mk
index e0e5d22..a64d32f 100644
--- a/package/qt/qt.mk
+++ b/package/qt/qt.mk
@@ -203,6 +203,10 @@ else
 QT_CONFIGURE_OPTS += -static
 endif
 
+ifeq ($(BR2_STATIC_LIBS),y)
+QT_CONFIGURE_OPTS += -D QT_NO_DYNAMIC_LIBRARY
+endif
+
 ifeq ($(BR2_ENDIAN),"LITTLE")
 QT_CONFIGURE_OPTS += -little-endian
 else
-- 
1.8.0.1

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

* [Buildroot] [PATCH 1/1] qt: fix build for arm with BR2_STATIC_LIBS
  2015-10-06 10:56 [Buildroot] [PATCH 1/1] qt: fix build for arm with BR2_STATIC_LIBS Alexander Lukichev
@ 2015-10-06 21:51 ` Arnout Vandecappelle
  2015-10-07  4:55   ` Alexander Lukichev
  2015-10-07  7:02 ` [Buildroot] [PATCH v2] " Alexander Lukichev
  1 sibling, 1 reply; 7+ messages in thread
From: Arnout Vandecappelle @ 2015-10-06 21:51 UTC (permalink / raw)
  To: buildroot

On 06-10-15 11:56, Alexander Lukichev wrote:
> Some Buildroot-generated static toolchains for ARM do not have
> dlfcn.h header, which breaks builds of qt-4.8.7 because its
> QtCore's plugin loader expects this header to be present (and
> dynamic libraries to be supported). For certain platforms without
> dynamic libraries, there is a QT_NO_DYNAMIC_LIBRARY constant
> defined in plugin loader's source. This patch puts that constant
> into Qt's build environment if Buildroot is configured without
> shared library support, and prevents plugin loader from defining
> it if it has already been defined.
> 
> Fixes:
> - http://autobuild.buildroot.net/results/11a4c19638ca211bd2a424fd92602166235c9433
> - http://autobuild.buildroot.net/results/c056e8781558267f6971a5f017f47e90dcf24e07
> - http://autobuild.buildroot.net/results/b8f34afa8686e890a1a3882a52081bb6a3b9c13b
> and several others.
> 
> Signed-off-by: Alexander Lukichev <alexander.lukichev@gmail.com>
> ---
>  package/qt/0009-no-dynamic-library-plugins.patch | 27 ++++++++++++++++++++++++
>  package/qt/qt.mk                                 |  4 ++++
>  2 files changed, 31 insertions(+)
>  create mode 100644 package/qt/0009-no-dynamic-library-plugins.patch
> 
> diff --git a/package/qt/0009-no-dynamic-library-plugins.patch b/package/qt/0009-no-dynamic-library-plugins.patch
> new file mode 100644
> index 0000000..3836677
> --- /dev/null
> +++ b/package/qt/0009-no-dynamic-library-plugins.patch
> @@ -0,0 +1,27 @@
> +Do not define QT_NO_DYNAMIC_LIBRARY if it is already defined
> +
> +QtCore plugin loader behaves correctly on platforms that do not support
> +dynamic libraries. This is implemented by QT_NO_DYNAMIC_LIBRARY constant
> +defined at compile time in the loader's source for specific platforms.
> +Since Buildroot does not have a separate platform defined for it in
> +mkspecs, if shared libraries are not supported by its configuration, the
> +constant is specified in Qt's build environment. This patch prevents
> +compilation error in such cases.

 I'm sorry, but I fail to understand how there can be a compilation error...
We're not building for VxWorks or NaCl, so why should there be a problem?

 Otherwise the patch looks good to me BTW.

 Regards,
 Arnout

> +
> +Signed-off-by: Alexander Lukichev <alexander.lukichev@gmail.com>
> +
> +diff -uNrp qt-4.8.7.orig/src/corelib/plugin/qlibrary_unix.cpp qt-4.8.7/src/corelib/plugin/qlibrary_unix.cpp
> +--- qt-4.8.7.orig/src/corelib/plugin/qlibrary_unix.cpp	2015-05-07 17:14:48.000000000 +0300
> ++++ qt-4.8.7/src/corelib/plugin/qlibrary_unix.cpp	2015-10-06 08:53:27.189232642 +0300
> +@@ -56,9 +56,11 @@
> + #include <string.h>
> + #endif
> + 
> ++#ifndef QT_NO_DYNAMIC_LIBRARY
> + #if (defined(Q_OS_VXWORKS) && !defined(VXWORKS_RTP)) || defined (Q_OS_NACL)
> + #define QT_NO_DYNAMIC_LIBRARY
> + #endif
> ++#endif
> + 
> + QT_BEGIN_NAMESPACE
> + 
> diff --git a/package/qt/qt.mk b/package/qt/qt.mk
> index e0e5d22..a64d32f 100644
> --- a/package/qt/qt.mk
> +++ b/package/qt/qt.mk
> @@ -203,6 +203,10 @@ else
>  QT_CONFIGURE_OPTS += -static
>  endif
>  
> +ifeq ($(BR2_STATIC_LIBS),y)
> +QT_CONFIGURE_OPTS += -D QT_NO_DYNAMIC_LIBRARY
> +endif
> +
>  ifeq ($(BR2_ENDIAN),"LITTLE")
>  QT_CONFIGURE_OPTS += -little-endian
>  else
> 


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

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

* [Buildroot] [PATCH 1/1] qt: fix build for arm with BR2_STATIC_LIBS
  2015-10-06 21:51 ` Arnout Vandecappelle
@ 2015-10-07  4:55   ` Alexander Lukichev
  0 siblings, 0 replies; 7+ messages in thread
From: Alexander Lukichev @ 2015-10-07  4:55 UTC (permalink / raw)
  To: buildroot

Hi, Arnout!

  Thanks for taking a look!

On 10/07/2015 12:51 AM, Arnout Vandecappelle wrote:
>> --- /dev/null
>> +++ b/package/qt/0009-no-dynamic-library-plugins.patch
>> @@ -0,0 +1,27 @@
>> +Do not define QT_NO_DYNAMIC_LIBRARY if it is already defined
[...]
>> ++#ifndef QT_NO_DYNAMIC_LIBRARY
>> + #if (defined(Q_OS_VXWORKS) && !defined(VXWORKS_RTP)) || defined (Q_OS_NACL)
>> + #define QT_NO_DYNAMIC_LIBRARY
>> + #endif
>> ++#endif

>  I'm sorry, but I fail to understand how there can be a compilation error...
> We're not building for VxWorks or NaCl, so why should there be a problem?

Indeed. I will remove unnecessary Qt patch and send a new version. Thanks again!

--
Best regards,
  Alexander Lukichev

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

* [Buildroot] [PATCH v2] qt: fix build for arm with BR2_STATIC_LIBS
  2015-10-06 10:56 [Buildroot] [PATCH 1/1] qt: fix build for arm with BR2_STATIC_LIBS Alexander Lukichev
  2015-10-06 21:51 ` Arnout Vandecappelle
@ 2015-10-07  7:02 ` Alexander Lukichev
  2015-10-10 10:03   ` Thomas Petazzoni
  2015-10-12 20:38   ` Peter Korsgaard
  1 sibling, 2 replies; 7+ messages in thread
From: Alexander Lukichev @ 2015-10-07  7:02 UTC (permalink / raw)
  To: buildroot

Some Buildroot-generated static toolchains for ARM do not have
dlfcn.h header, which breaks builds of qt-4.8.7 because its
QtCore's plugin loader expects this header to be present (and
dynamic libraries to be supported). For certain platforms without
dynamic libraries, there is a QT_NO_DYNAMIC_LIBRARY constant
defined in plugin loader's source. This patch puts that constant
into Qt's build environment if Buildroot is configured without
shared library support.

Fixes:
- http://autobuild.buildroot.net/results/11a4c19638ca211bd2a424fd92602166235c9433
- http://autobuild.buildroot.net/results/c056e8781558267f6971a5f017f47e90dcf24e07
- http://autobuild.buildroot.net/results/b8f34afa8686e890a1a3882a52081bb6a3b9c13b
and several others.

Signed-off-by: Alexander Lukichev <alexander.lukichev@gmail.com>
---
Changes
v2: unnecessary Qt patch removed (Arnout).
---
 package/qt/qt.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/qt/qt.mk b/package/qt/qt.mk
index e0e5d22..a64d32f 100644
--- a/package/qt/qt.mk
+++ b/package/qt/qt.mk
@@ -203,6 +203,10 @@ else
 QT_CONFIGURE_OPTS += -static
 endif
 
+ifeq ($(BR2_STATIC_LIBS),y)
+QT_CONFIGURE_OPTS += -D QT_NO_DYNAMIC_LIBRARY
+endif
+
 ifeq ($(BR2_ENDIAN),"LITTLE")
 QT_CONFIGURE_OPTS += -little-endian
 else
-- 
2.6.1

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

* [Buildroot] [PATCH v2] qt: fix build for arm with BR2_STATIC_LIBS
  2015-10-07  7:02 ` [Buildroot] [PATCH v2] " Alexander Lukichev
@ 2015-10-10 10:03   ` Thomas Petazzoni
  2015-10-12 20:38   ` Peter Korsgaard
  1 sibling, 0 replies; 7+ messages in thread
From: Thomas Petazzoni @ 2015-10-10 10:03 UTC (permalink / raw)
  To: buildroot

Dear Alexander Lukichev,

On Wed,  7 Oct 2015 10:02:46 +0300, Alexander Lukichev wrote:
> Some Buildroot-generated static toolchains for ARM do not have
> dlfcn.h header, which breaks builds of qt-4.8.7 because its
> QtCore's plugin loader expects this header to be present (and
> dynamic libraries to be supported). For certain platforms without
> dynamic libraries, there is a QT_NO_DYNAMIC_LIBRARY constant
> defined in plugin loader's source. This patch puts that constant
> into Qt's build environment if Buildroot is configured without
> shared library support.
> 
> Fixes:
> - http://autobuild.buildroot.net/results/11a4c19638ca211bd2a424fd92602166235c9433
> - http://autobuild.buildroot.net/results/c056e8781558267f6971a5f017f47e90dcf24e07
> - http://autobuild.buildroot.net/results/b8f34afa8686e890a1a3882a52081bb6a3b9c13b
> and several others.
> 
> Signed-off-by: Alexander Lukichev <alexander.lukichev@gmail.com>
> ---
> Changes
> v2: unnecessary Qt patch removed (Arnout).
> ---
>  package/qt/qt.mk | 4 ++++
>  1 file changed, 4 insertions(+)

Applied, thanks.

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

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

* [Buildroot] [PATCH v2] qt: fix build for arm with BR2_STATIC_LIBS
  2015-10-07  7:02 ` [Buildroot] [PATCH v2] " Alexander Lukichev
  2015-10-10 10:03   ` Thomas Petazzoni
@ 2015-10-12 20:38   ` Peter Korsgaard
  2015-10-13  5:14     ` Alexander Lukichev
  1 sibling, 1 reply; 7+ messages in thread
From: Peter Korsgaard @ 2015-10-12 20:38 UTC (permalink / raw)
  To: buildroot

>>>>> "Alexander" == Alexander Lukichev <alexander.lukichev@gmail.com> writes:

 > Some Buildroot-generated static toolchains for ARM do not have
 > dlfcn.h header, which breaks builds of qt-4.8.7 because its
 > QtCore's plugin loader expects this header to be present (and
 > dynamic libraries to be supported). For certain platforms without
 > dynamic libraries, there is a QT_NO_DYNAMIC_LIBRARY constant
 > defined in plugin loader's source. This patch puts that constant
 > into Qt's build environment if Buildroot is configured without
 > shared library support.

 > Fixes:
 > - http://autobuild.buildroot.net/results/11a4c19638ca211bd2a424fd92602166235c9433
 > - http://autobuild.buildroot.net/results/c056e8781558267f6971a5f017f47e90dcf24e07
 > - http://autobuild.buildroot.net/results/b8f34afa8686e890a1a3882a52081bb6a3b9c13b
 > and several others.

 > Signed-off-by: Alexander Lukichev <alexander.lukichev@gmail.com>
 > ---
 > Changes
 > v2: unnecessary Qt patch removed (Arnout).
 > ---
 >  package/qt/qt.mk | 4 ++++
 >  1 file changed, 4 insertions(+)

 > diff --git a/package/qt/qt.mk b/package/qt/qt.mk
 > index e0e5d22..a64d32f 100644
 > --- a/package/qt/qt.mk
 > +++ b/package/qt/qt.mk
 > @@ -203,6 +203,10 @@ else
 >  QT_CONFIGURE_OPTS += -static
 >  endif
 
 > +ifeq ($(BR2_STATIC_LIBS),y)
 > +QT_CONFIGURE_OPTS += -D QT_NO_DYNAMIC_LIBRARY

Hmm, shouldn't this be checking BR2_PACKAGE_QT_STATIC instead?

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCH v2] qt: fix build for arm with BR2_STATIC_LIBS
  2015-10-12 20:38   ` Peter Korsgaard
@ 2015-10-13  5:14     ` Alexander Lukichev
  0 siblings, 0 replies; 7+ messages in thread
From: Alexander Lukichev @ 2015-10-13  5:14 UTC (permalink / raw)
  To: buildroot

Hi Peter,

On 10/12/2015 11:38 PM, Peter Korsgaard wrote:
>>>>>> "Alexander" == Alexander Lukichev <alexander.lukichev@gmail.com> writes:
>
>  > Some Buildroot-generated static toolchains for ARM do not have
>  > dlfcn.h header, which breaks builds of qt-4.8.7 because its
>  > QtCore's plugin loader expects this header to be present (and
>  > dynamic libraries to be supported). For certain platforms without
>  > dynamic libraries, there is a QT_NO_DYNAMIC_LIBRARY constant
>  > defined in plugin loader's source. This patch puts that constant
>  > into Qt's build environment if Buildroot is configured without
>  > shared library support.
[...]
>  > +ifeq ($(BR2_STATIC_LIBS),y)
>  > +QT_CONFIGURE_OPTS += -D QT_NO_DYNAMIC_LIBRARY
>
> Hmm, shouldn't this be checking BR2_PACKAGE_QT_STATIC instead?

I think, no. If BR2_PACKAGE_QT_STATIC means to compile only Qt
statically. The problem is when the whole platform is built with
static libraries (BR2_STATIC_LIBS). Then loading plugins dynamically
is not possible in principle. When the Buildroot build is not static,
some dynamic libraries (e.g., compiled later) may be put onto the
target system and be loaded by Qt, even if it itself is statically
built. Correct me if I'm wrong but I have not been able to confirm
that static Qt cannot load / work with dynamic libraries.

--
Best regards,
  Alexander Lukichev

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

end of thread, other threads:[~2015-10-13  5:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-06 10:56 [Buildroot] [PATCH 1/1] qt: fix build for arm with BR2_STATIC_LIBS Alexander Lukichev
2015-10-06 21:51 ` Arnout Vandecappelle
2015-10-07  4:55   ` Alexander Lukichev
2015-10-07  7:02 ` [Buildroot] [PATCH v2] " Alexander Lukichev
2015-10-10 10:03   ` Thomas Petazzoni
2015-10-12 20:38   ` Peter Korsgaard
2015-10-13  5:14     ` Alexander Lukichev

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.