Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/1] support/dependencies: add check for c++ multilib
@ 2018-02-05 21:57 Gaël PORTAY
  2018-02-06 16:22 ` Thomas Petazzoni
  2018-02-06 22:00 ` Yann E. MORIN
  0 siblings, 2 replies; 4+ messages in thread
From: Gaël PORTAY @ 2018-02-05 21:57 UTC (permalink / raw)
  To: buildroot

Some packages build C++ 32bits host-tools and need the g++-multilib to
be installed on the build machine. As example, qt5webengine builds a C++
host-tool when target is 32bits.

Add the check for g++-multilib to the dependencies script; and update
the Dockerfile to install g++-multilib package.

Signed-off-by: Ga?l PORTAY <gael.portay@savoirfairelinux.com>
---

There are two solutions to solve this issue:

The first one consists in checking for g++-multilib when the config
option BR2_HOSTARCH_NEEDS_IA32_COMPILER is set; even if it is not
required. The implementation is simple (see patch below).

The second solution consists in creating a new config option for
packages that needs g++-multilib to be installed. As example:
BR2_HOSTARCH_NEEDS_IA32_CXX_COMPILER is a good candidate. [For a matter
of consistency, I would also rename BR2_HOSTARCH_NEEDS_COMPILER into
BR2_HOSTARCH_NEEDS_IA32_C_COMPILER (adding C_); but I do not want to do
that to not break existing configurations that are no in-tree].

Which solution do you prefer?

Change since v1:
 - Use proper c++ value for option -x (cpp does not exist).
 - Use g++ compiler instead of gcc.

 support/dependencies/dependencies.sh | 8 ++++++++
 support/docker/Dockerfile            | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/support/dependencies/dependencies.sh b/support/dependencies/dependencies.sh
index a195c62c8c..1804e85508 100755
--- a/support/dependencies/dependencies.sh
+++ b/support/dependencies/dependencies.sh
@@ -249,6 +249,14 @@ if grep -q ^BR2_HOSTARCH_NEEDS_IA32_COMPILER=y $BR2_CONFIG ; then
 		echo "For other distributions, refer to their documentation."
 		exit 1
 	fi
+
+	if ! echo "int main(void) {}" | g++ -m32 -x c++ - -o /dev/null 2>/dev/null; then
+		echo
+		echo "Your Buildroot configuration needs a compiler capable of building 32 bits binaries."
+		echo "If you're running a Debian/Ubuntu distribution, install the g++-multilib package."
+		echo "For other distributions, refer to their documentation."
+		exit 1
+	fi
 fi
 
 # Check that the Perl installation is complete enough for Buildroot.
diff --git a/support/docker/Dockerfile b/support/docker/Dockerfile
index 474e073c61..ce3fdd9cc2 100644
--- a/support/docker/Dockerfile
+++ b/support/docker/Dockerfile
@@ -22,7 +22,7 @@ COPY apt-sources.list /etc/apt/sources.list
 RUN dpkg --add-architecture i386 && \
     apt-get update -y && \
     apt-get install -y --no-install-recommends \
-        build-essential cmake libc6:i386 gcc-multilib \
+        build-essential cmake libc6:i386 g++-multilib \
         bc ca-certificates file locales rsync \
         cvs bzr git mercurial subversion wget \
         cpio unzip \
-- 
2.11.0

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

end of thread, other threads:[~2018-02-07 19:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-05 21:57 [Buildroot] [PATCH v2 1/1] support/dependencies: add check for c++ multilib Gaël PORTAY
2018-02-06 16:22 ` Thomas Petazzoni
2018-02-06 22:00 ` Yann E. MORIN
2018-02-07 19:47   ` Gaël PORTAY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox