Patchwork [1/4] qt4: fix compile error in Qt 4.8.0 with gcc 4.6

login
register
mail settings
Submitter Paul Eggleton
Date Feb. 26, 2012, 10:27 p.m.
Message ID <b5c5d99d64381f508be653cc48e793f1e25eb2fe.1330294151.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/22105/
State Accepted
Commit f29bb5b2a99ecef46e5570bf3336e9680c0b6705
Headers show

Comments

Paul Eggleton - Feb. 26, 2012, 10:27 p.m.
Ensure the Qt configure script can can detect the compiler correctly as
g++. This fixes the following compile error with gcc 4.6:

./wtf/NullPtr.h:48:1: error: identifier 'nullptr' will become a keyword in C++0x [-Werror=c++0x-compat]

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/recipes-qt/qt4/qt-4.8.0.inc                   |    1 +
 .../qt4/qt-4.8.0/configure_oe_compiler.patch       |   31 ++++++++++++++++++++
 meta/recipes-qt/qt4/qt4-embedded_4.8.0.bb          |    2 +-
 3 files changed, 33 insertions(+), 1 deletions(-)
 create mode 100644 meta/recipes-qt/qt4/qt-4.8.0/configure_oe_compiler.patch
Koen Kooi - Feb. 26, 2012, 10:55 p.m.
Op 26 feb. 2012, om 23:27 heeft Paul Eggleton het volgende geschreven:

> Ensure the Qt configure script can can detect the compiler correctly as
> g++. This fixes the following compile error with gcc 4.6:
> 
> ./wtf/NullPtr.h:48:1: error: identifier 'nullptr' will become a keyword in C++0x [-Werror=c++0x-compat]
> 
> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
> ---
> meta/recipes-qt/qt4/qt-4.8.0.inc                   |    1 +
> .../qt4/qt-4.8.0/configure_oe_compiler.patch       |   31 ++++++++++++++++++++
> meta/recipes-qt/qt4/qt4-embedded_4.8.0.bb          |    2 +-
> 3 files changed, 33 insertions(+), 1 deletions(-)
> create mode 100644 meta/recipes-qt/qt4/qt-4.8.0/configure_oe_compiler.patch
> 
> diff --git a/meta/recipes-qt/qt4/qt-4.8.0.inc b/meta/recipes-qt/qt4/qt-4.8.0.inc
> index 2addbb2..532f1ff 100644
> --- a/meta/recipes-qt/qt4/qt-4.8.0.inc
> +++ b/meta/recipes-qt/qt4/qt-4.8.0.inc
> @@ -14,6 +14,7 @@ SRC_URI = "http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-${PV}.
>            file://fix-translations.patch \
>            file://add_nostrip_for_debug_packages.diff \
>            file://qmake_cxx_eval.patch \
> +           file://configure_oe_compiler.patch \
>            file://g++.conf \
>            file://linux.conf \
>            "
> diff --git a/meta/recipes-qt/qt4/qt-4.8.0/configure_oe_compiler.patch b/meta/recipes-qt/qt4/qt-4.8.0/configure_oe_compiler.patch
> new file mode 100644
> index 0000000..d455d0a
> --- /dev/null
> +++ b/meta/recipes-qt/qt4/qt-4.8.0/configure_oe_compiler.patch
> @@ -0,0 +1,31 @@
> +Ensure we identify the compiler as g++ in configure
> +
> +Our PLATFORM in OE is ${TARGET_OS}-oe-g++, and previously the configure
> +script was interpreting from this that the compiler was "oe-g++" and thus
> +g++ specific checks were not being run since this string did not match;
> +among other things this resulted in a compiler version check in the
> +QtWebKit build code not working, and hence the following error at build
> +time:
> +
> +./wtf/NullPtr.h:48:1: error: identifier 'nullptr' will become a keyword in C++0x [-Werror=c++0x-compat]
> +
> +The easiest thing since our PLATFORM is entirely artificial is to just
> +force COMPILER to "g++" in the configure script if it is detected as
> +"oe-g++".
> +
> +Upstream-Status: Inappropriate [configuration]
> +
> +Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>

Can I bribe you to make those proper git patches? :)

regards,

Koen
Paul Eggleton - Feb. 26, 2012, 10:59 p.m.
On Sunday 26 February 2012 23:55:25 Koen Kooi wrote:
> > +Upstream-Status: Inappropriate [configuration]
> > +
> > +Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
> 
> Can I bribe you to make those proper git patches? :)

Is it useful given that it's not suitable for sending upstream?

Cheers,
Paul
Koen Kooi - Feb. 26, 2012, 11:05 p.m.
Op 26 feb. 2012, om 23:59 heeft Paul Eggleton het volgende geschreven:

> On Sunday 26 February 2012 23:55:25 Koen Kooi wrote:
>>> +Upstream-Status: Inappropriate [configuration]
>>> +
>>> +Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
>> 
>> Can I bribe you to make those proper git patches? :)
> 
> Is it useful given that it's not suitable for sending upstream?

It's useful for people like me that have a custom PATCHTOOL that uses git-am. It also makes git am -3 work when updating to a newer version.

regards,

Koen
Paul Eggleton - Feb. 27, 2012, 12:32 a.m.
On Monday 27 February 2012 00:05:53 Koen Kooi wrote:
> It's useful for people like me that have a custom PATCHTOOL that uses
> git-am. It also makes git am -3 work when updating to a newer version.

OK, I've done this and pushed a new branch. I'm not going to send a new patch 
series though unless there are other changes.

Cheers,
Paul

Patch

diff --git a/meta/recipes-qt/qt4/qt-4.8.0.inc b/meta/recipes-qt/qt4/qt-4.8.0.inc
index 2addbb2..532f1ff 100644
--- a/meta/recipes-qt/qt4/qt-4.8.0.inc
+++ b/meta/recipes-qt/qt4/qt-4.8.0.inc
@@ -14,6 +14,7 @@  SRC_URI = "http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-${PV}.
            file://fix-translations.patch \
            file://add_nostrip_for_debug_packages.diff \
            file://qmake_cxx_eval.patch \
+           file://configure_oe_compiler.patch \
            file://g++.conf \
            file://linux.conf \
            "
diff --git a/meta/recipes-qt/qt4/qt-4.8.0/configure_oe_compiler.patch b/meta/recipes-qt/qt4/qt-4.8.0/configure_oe_compiler.patch
new file mode 100644
index 0000000..d455d0a
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt-4.8.0/configure_oe_compiler.patch
@@ -0,0 +1,31 @@ 
+Ensure we identify the compiler as g++ in configure
+
+Our PLATFORM in OE is ${TARGET_OS}-oe-g++, and previously the configure
+script was interpreting from this that the compiler was "oe-g++" and thus
+g++ specific checks were not being run since this string did not match;
+among other things this resulted in a compiler version check in the
+QtWebKit build code not working, and hence the following error at build
+time:
+
+./wtf/NullPtr.h:48:1: error: identifier 'nullptr' will become a keyword in C++0x [-Werror=c++0x-compat]
+
+The easiest thing since our PLATFORM is entirely artificial is to just
+force COMPILER to "g++" in the configure script if it is detected as
+"oe-g++".
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+--- qt-everywhere-opensource-src-4.8.0.orig/configure
++++ qt-everywhere-opensource-src-4.8.0/configure
+@@ -7444,6 +7444,9 @@ elif [ "$XPLATFORM" != "$PLATFORM" ]; th
+ else
+     COMPILER=`echo $PLATFORM | cut -f 2- -d-`
+ fi
++case $COMPILER in
++    *oe-g++) COMPILER="g++" ;;
++esac
+ if [ "$CFG_EXCEPTIONS" = "unspecified" -a "$PLATFORM_QWS" = "yes" ]; then
+     CFG_EXCEPTIONS=no
+ fi
diff --git a/meta/recipes-qt/qt4/qt4-embedded_4.8.0.bb b/meta/recipes-qt/qt4/qt4-embedded_4.8.0.bb
index 5c1c97e..efbc02a 100644
--- a/meta/recipes-qt/qt4/qt4-embedded_4.8.0.bb
+++ b/meta/recipes-qt/qt4/qt4-embedded_4.8.0.bb
@@ -1,7 +1,7 @@ 
 require qt-${PV}.inc
 require qt4-embedded.inc
 
-PR = "${INC_PR}.0"
+PR = "${INC_PR}.1"
 
 DEFAULT_PREFERENCE = "-1"