From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] pacakge/qt5/qt5base: fix build with ccache
Date: Wed, 26 Aug 2015 15:45:34 +0200 [thread overview]
Message-ID: <20150826154534.3e67c9bc@free-electrons.com> (raw)
In-Reply-To: <1440499298-39957-1-git-send-email-benoit@wsystem.com>
Beno?t,
On Tue, 25 Aug 2015 12:41:38 +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 valid (absolute or QMAKE_PATH_ENV-relative) path to an existing
> file, which is not possible if using ccache as above.
>
> Add a patch removing these tests since the toolchain is already tested
> by Buildroot, which allows to keep using ccache.
>
> Signed-off-by: Beno?t Th?baudeau <benoit@wsystem.com>
Thanks for the patch. I see the problem, but as usual, having a
solution that can be submitted upstream is better. See my suggestion
below.
> ---
> .../qt5/qt5base/0009-fix-build-with-ccache.patch | 60 ++++++++++++++++++++++
> 1 file changed, 60 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..04d41a4
> --- /dev/null
> +++ b/package/qt5/qt5base/0009-fix-build-with-ccache.patch
> @@ -0,0 +1,60 @@
> +Fix build with ccache
> +
> +Building with Buildroot and 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 valid (absolute or QMAKE_PATH_ENV-relative) path to an existing
> +file, which is not possible if using ccache as above.
> +
> +Remove these tests since the toolchain is already tested by Buildroot,
> +which allows to keep using ccache.
> +
> +Signed-off-by: Beno?t Th?baudeau <benoit@wsystem.com>
> +---
> + mkspecs/features/device_config.prf | 23 -----------------------
> + 1 file changed, 23 deletions(-)
> +
> +diff --git a/mkspecs/features/device_config.prf b/mkspecs/features/device_config.prf
> +index cd3a0cf..ef16540 100644
> +--- a/mkspecs/features/device_config.prf
> ++++ b/mkspecs/features/device_config.prf
> +@@ -14,28 +14,5 @@ host_build {
> +
> + # Provide a function to be used by mkspecs
> + defineTest(deviceSanityCheckCompiler) {
> +- equals(QMAKE_HOST.os, Windows): \
> +- sfx = .exe
> +- else: \
> +- 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()
> +-
> +- # Check for possible reasons of failure
> +- # check if CROSS_COMPILE device-option is set
> +- isEmpty(CROSS_COMPILE):error("CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE=<path>")
> +-
> +- # Check if QMAKE_CXX points to an executable.
> +- ensurePathEnv()
> +- for (dir, QMAKE_PATH_ENV) {
> +- exists($$dir/$${QMAKE_CXX}$$sfx): \
> +- return()
> +- }
Instead of removing this entire piece of code, can you try to replace
just this last part by something like:
system($${QMAKE_CXX}$$sfx --version): return()
Instead of trying to look for a file, it will actually try to run the
compiler.
Also, can you report the bug and submit the patch upstream to Qt? See
https://bugreports.qt.io/secure/Dashboard.jspa.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2015-08-26 13:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-25 10:41 [Buildroot] [PATCH] pacakge/qt5/qt5base: fix build with ccache Benoît Thébaudeau
2015-08-26 13:45 ` Thomas Petazzoni [this message]
2015-08-26 22:10 ` Benoît Thébaudeau
2015-08-27 8:12 ` Benoît Thébaudeau
2015-08-27 8:54 ` Thomas Petazzoni
2015-08-27 9:12 ` Benoît Thébaudeau
2015-08-27 12:39 ` Thomas Petazzoni
2015-08-28 9:50 ` Benoît Thébaudeau
2015-08-27 12:49 ` Jaap Crezee
2015-08-27 19:03 ` Benoît Thébaudeau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150826154534.3e67c9bc@free-electrons.com \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.