Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/rhash: fix build failure due to gcc -v
@ 2020-12-03 20:28 Fabrice Fontaine
  2020-12-05 20:31 ` Thomas Petazzoni
  2020-12-25 22:34 ` Yann E. MORIN
  0 siblings, 2 replies; 9+ messages in thread
From: Fabrice Fontaine @ 2020-12-03 20:28 UTC (permalink / raw)
  To: buildroot

Fixes:
 - http://autobuild.buildroot.org/results/8605c16cc28316954ce8b9dcc266974390c5da20

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...01-configure-allow-cross-compilation.patch | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 package/rhash/0001-configure-allow-cross-compilation.patch

diff --git a/package/rhash/0001-configure-allow-cross-compilation.patch b/package/rhash/0001-configure-allow-cross-compilation.patch
new file mode 100644
index 0000000000..e33353f8b3
--- /dev/null
+++ b/package/rhash/0001-configure-allow-cross-compilation.patch
@@ -0,0 +1,45 @@
+From 0605ddf795330c03ff52e993726de99a984cf2f4 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Sat, 10 Oct 2020 11:07:39 +0200
+Subject: [PATCH] configure: allow cross-compilation
+
+Update configure to allow the user to pass a cross-compiler such as
+--cc=/home/fabrice/buildroot/output/host/bin/riscv64-buildroot-linux-uclibc-gcc
+
+First, use --version instead of -v to avoid a build failure and set
+cc_vendor to gnu if CC compiler contains gcc
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ configure | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/configure b/configure
+index 2783b85..c8e1ea7 100755
+--- a/configure
++++ b/configure
+@@ -512,9 +512,9 @@ else
+   CC_TMP="$CC"
+   test -n "$OPT_CC" && OTHER_CC= || OTHER_CC="gcc cc"
+   for CC in "$CC_TMP" $OTHER_CC; do
+-    if run_cmd "$CC -v"; then
+-      cc_name_tmp=$($CC -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
+-      if test "$cc_name_tmp" = "gcc"; then
++    if run_cmd "$CC --version"; then
++      cc_name_tmp=$($CC --version 2>&1 | head -n 1 | cut -d ' ' -f 1)
++      if echo "$cc_name_tmp" | grep -q "gcc"; then
+         cc_name=$cc_name_tmp
+         start_check "$CC version"
+         cc_vendor=gnu
+@@ -538,7 +538,7 @@ else
+         finish_check "$cc_name $cc_version"
+         break
+       fi
+-      if $CC -v 2>&1 | grep -q "clang"; then
++      if $CC --version 2>&1 | grep -q "clang"; then
+         start_check "$CC version"
+         cc_vendor=clang
+         cc_version=$($CC -dumpversion 2>&1)
+-- 
+2.29.2
+
-- 
2.29.2

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

end of thread, other threads:[~2020-12-27 10:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-03 20:28 [Buildroot] [PATCH 1/1] package/rhash: fix build failure due to gcc -v Fabrice Fontaine
2020-12-05 20:31 ` Thomas Petazzoni
2020-12-05 20:44   ` Fabrice Fontaine
2020-12-13 16:07     ` Peter Seiderer
2020-12-13 16:20       ` Peter Seiderer
2020-12-23 15:42         ` Fabrice Fontaine
2020-12-25 22:34 ` Yann E. MORIN
2020-12-27  7:55   ` Peter Korsgaard
2020-12-27 10:26     ` Fabrice Fontaine

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