* [Buildroot] [PATCH v2] pacakge/qt5/qt5base: fix build with ccache
@ 2015-08-28 9:46 Benoît Thébaudeau
2015-08-28 9:57 ` Thomas Petazzoni
2015-08-28 13:39 ` Thomas Petazzoni
0 siblings, 2 replies; 5+ messages in thread
From: Benoît Thébaudeau @ 2015-08-28 9:46 UTC (permalink / raw)
To: buildroot
Building with ccache failed with:
Running configuration tests...
Failed to process makespec for platform 'devices/linux-buildroot-g++'
Project ERROR: Compiler <path_to_output_dir>/host/usr/bin/ccache <path_to_output_dir>/host/usr/bin/<cross_compile>-g++ not found. Check the value of CROSS_COMPILE -device-option
Could not read qmake configuration file <path_to_output_dir>/build/qt5base-5.5.0/mkspecs/devices/linux-buildroot-g++/qmake.conf.
Error processing project file: /dev/null
This was caused by Buildroot setting this in
qt5base-5.5.0/mkspecs/devices/linux-buildroot-g++/qmake.conf:
QMAKE_CXX = $${BR_CCACHE} $${CROSS_COMPILE}g++
But qt5base-5.5.0/mkspecs/features/device_config.prf expects QMAKE_CXX
to be a single valid (absolute or QMAKE_PATH_ENV-relative) path to an
existing file, which is not possible if using ccache as above.
Add a patch fixing this by testing only the first value in QMAKE_CXX.
Signed-off-by: Beno?t Th?baudeau <benoit@wsystem.com>
---
Changes v1 -> v2:
- Use the first value in QMAKE_CXX instead of removing the whole test.
---
.../qt5/qt5base/0009-fix-build-with-ccache.patch | 49 ++++++++++++++++++++++
1 file changed, 49 insertions(+)
create mode 100644 package/qt5/qt5base/0009-fix-build-with-ccache.patch
diff --git a/package/qt5/qt5base/0009-fix-build-with-ccache.patch b/package/qt5/qt5base/0009-fix-build-with-ccache.patch
new file mode 100644
index 0000000..896c0ef
--- /dev/null
+++ b/package/qt5/qt5base/0009-fix-build-with-ccache.patch
@@ -0,0 +1,49 @@
+Fix QMAKE_CXX/CROSS_COMPILE verification with ccache
+
+The use of ccache leads to QMAKE_CXX definitions of the form:
+
+ QMAKE_CXX = $${CCACHE} $${CROSS_COMPILE}g++
+
+The previous test required QMAKE_CXX to be a single valid (absolute or
+QMAKE_PATH_ENV-relative) path to an existing file, which was not
+compatible with definitions of QMAKE_CXX like the one above.
+
+Fix this by using only the first value in QMAKE_CXX, which usually
+points to the compiler executable, or to the ccache executable in the
+above case.
+
+Signed-off-by: Beno?t Th?baudeau <benoit@wsystem.com>
+---
+ mkspecs/features/device_config.prf | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/mkspecs/features/device_config.prf b/mkspecs/features/device_config.prf
+index cd3a0cf..eee4ac6 100644
+--- a/mkspecs/features/device_config.prf
++++ b/mkspecs/features/device_config.prf
+@@ -19,10 +19,15 @@ defineTest(deviceSanityCheckCompiler) {
+ else: \
+ sfx =
+
++ # Build the compiler filename using the first value in QMAKE_CXX in order to
++ # support tools like ccache, which give QMAKE_CXX values of the form:
++ # ccache <path_to_compiler>
++ compiler = $$first(QMAKE_CXX)$$sfx
++
+ # Check if the binary exists with an absolute path. Do this check
+ # before the CROSS_COMPILE empty check below to allow the mkspec
+ # to derive the compiler path from other device options.
+- exists($$QMAKE_CXX$$sfx):return()
++ exists($$compiler):return()
+
+ # Check for possible reasons of failure
+ # check if CROSS_COMPILE device-option is set
+@@ -31,7 +36,7 @@ defineTest(deviceSanityCheckCompiler) {
+ # Check if QMAKE_CXX points to an executable.
+ ensurePathEnv()
+ for (dir, QMAKE_PATH_ENV) {
+- exists($$dir/$${QMAKE_CXX}$$sfx): \
++ exists($$dir/$${compiler}): \
+ return()
+ }
+
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH v2] pacakge/qt5/qt5base: fix build with ccache
2015-08-28 9:46 [Buildroot] [PATCH v2] pacakge/qt5/qt5base: fix build with ccache Benoît Thébaudeau
@ 2015-08-28 9:57 ` Thomas Petazzoni
2015-08-28 10:02 ` Benoît Thébaudeau
2015-08-28 13:39 ` Thomas Petazzoni
1 sibling, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2015-08-28 9:57 UTC (permalink / raw)
To: buildroot
Dear Beno?t Th?baudeau,
On Fri, 28 Aug 2015 11:46:51 +0200, Beno?t Th?baudeau wrote:
> +diff --git a/mkspecs/features/device_config.prf b/mkspecs/features/device_config.prf
> +index cd3a0cf..eee4ac6 100644
> +--- a/mkspecs/features/device_config.prf
> ++++ b/mkspecs/features/device_config.prf
> +@@ -19,10 +19,15 @@ defineTest(deviceSanityCheckCompiler) {
> + else: \
> + sfx =
> +
> ++ # Build the compiler filename using the first value in QMAKE_CXX in order to
> ++ # support tools like ccache, which give QMAKE_CXX values of the form:
> ++ # ccache <path_to_compiler>
> ++ compiler = $$first(QMAKE_CXX)$$sfx
Then wouldn't it make more sense to use the last() function, to use the
last value rather than the first, and actual check the compiler rather
than ccache?
compiler = $$last(QMAKE_CXX)$$sfx
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
* [Buildroot] [PATCH v2] pacakge/qt5/qt5base: fix build with ccache
2015-08-28 9:57 ` Thomas Petazzoni
@ 2015-08-28 10:02 ` Benoît Thébaudeau
2015-08-28 10:05 ` Thomas Petazzoni
0 siblings, 1 reply; 5+ messages in thread
From: Benoît Thébaudeau @ 2015-08-28 10:02 UTC (permalink / raw)
To: buildroot
On 28/08/2015 11:57, Thomas Petazzoni wrote:
> On Fri, 28 Aug 2015 11:46:51 +0200, Beno?t Th?baudeau wrote:
>
>> +diff --git a/mkspecs/features/device_config.prf b/mkspecs/features/device_config.prf
>> +index cd3a0cf..eee4ac6 100644
>> +--- a/mkspecs/features/device_config.prf
>> ++++ b/mkspecs/features/device_config.prf
>> +@@ -19,10 +19,15 @@ defineTest(deviceSanityCheckCompiler) {
>> + else: \
>> + sfx =
>> +
>> ++ # Build the compiler filename using the first value in QMAKE_CXX in order to
>> ++ # support tools like ccache, which give QMAKE_CXX values of the form:
>> ++ # ccache <path_to_compiler>
>> ++ compiler = $$first(QMAKE_CXX)$$sfx
>
> Then wouldn't it make more sense to use the last() function, to use the
> last value rather than the first, and actual check the compiler rather
> than ccache?
>
> compiler = $$last(QMAKE_CXX)$$sfx
The last() function could be less portable because there might be some other use
cases out there that we're not thinking about. On the contrary, we're certain
that the first value has to be an executable.
Best regards,
Beno?t
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH v2] pacakge/qt5/qt5base: fix build with ccache
2015-08-28 10:02 ` Benoît Thébaudeau
@ 2015-08-28 10:05 ` Thomas Petazzoni
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2015-08-28 10:05 UTC (permalink / raw)
To: buildroot
Dear Beno?t Th?baudeau,
On Fri, 28 Aug 2015 12:02:31 +0200, Beno?t Th?baudeau wrote:
> > Then wouldn't it make more sense to use the last() function, to use the
> > last value rather than the first, and actual check the compiler rather
> > than ccache?
> >
> > compiler = $$last(QMAKE_CXX)$$sfx
>
> The last() function could be less portable because there might be some other use
> cases out there that we're not thinking about. On the contrary, we're certain
> that the first value has to be an executable.
Correct. It makes the test a bit useless though. But oh well that test
is not very useful in the first place. If upstream is happy with a
$$first() solution, I'm fine :)
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
* [Buildroot] [PATCH v2] pacakge/qt5/qt5base: fix build with ccache
2015-08-28 9:46 [Buildroot] [PATCH v2] pacakge/qt5/qt5base: fix build with ccache Benoît Thébaudeau
2015-08-28 9:57 ` Thomas Petazzoni
@ 2015-08-28 13:39 ` Thomas Petazzoni
1 sibling, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2015-08-28 13:39 UTC (permalink / raw)
To: buildroot
Dear Beno?t Th?baudeau,
On Fri, 28 Aug 2015 11:46:51 +0200, Beno?t Th?baudeau wrote:
> Building with ccache failed with:
>
> Running configuration tests...
> Failed to process makespec for platform 'devices/linux-buildroot-g++'
> Project ERROR: Compiler <path_to_output_dir>/host/usr/bin/ccache <path_to_output_dir>/host/usr/bin/<cross_compile>-g++ not found. Check the value of CROSS_COMPILE -device-option
> Could not read qmake configuration file <path_to_output_dir>/build/qt5base-5.5.0/mkspecs/devices/linux-buildroot-g++/qmake.conf.
> Error processing project file: /dev/null
>
> This was caused by Buildroot setting this in
> qt5base-5.5.0/mkspecs/devices/linux-buildroot-g++/qmake.conf:
>
> QMAKE_CXX = $${BR_CCACHE} $${CROSS_COMPILE}g++
>
> But qt5base-5.5.0/mkspecs/features/device_config.prf expects QMAKE_CXX
> to be a single valid (absolute or QMAKE_PATH_ENV-relative) path to an
> existing file, which is not possible if using ccache as above.
>
> Add a patch fixing this by testing only the first value in QMAKE_CXX.
>
> Signed-off-by: Beno?t Th?baudeau <benoit@wsystem.com>
> ---
> Changes v1 -> v2:
> - Use the first value in QMAKE_CXX instead of removing the whole test.
> ---
> .../qt5/qt5base/0009-fix-build-with-ccache.patch | 49 ++++++++++++++++++++++
> 1 file changed, 49 insertions(+)
> create mode 100644 package/qt5/qt5base/0009-fix-build-with-ccache.patch
Applied to master after fixing the typo in the commit title. 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-08-28 13:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-28 9:46 [Buildroot] [PATCH v2] pacakge/qt5/qt5base: fix build with ccache Benoît Thébaudeau
2015-08-28 9:57 ` Thomas Petazzoni
2015-08-28 10:02 ` Benoît Thébaudeau
2015-08-28 10:05 ` Thomas Petazzoni
2015-08-28 13:39 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox