* [Buildroot] [PATCH] openswan: fix possible build failure
@ 2014-03-30 11:56 Gustavo Zacarias
2014-04-03 19:40 ` Thomas Petazzoni
0 siblings, 1 reply; 3+ messages in thread
From: Gustavo Zacarias @ 2014-03-30 11:56 UTC (permalink / raw)
To: buildroot
openswan's Makefile uses gcc instead of $(CC) for gcc version detection
to use advanced warning/error options. The problem is that if the
host gcc version is newish (>=4.6) and the gcc for the target is not it
uses unsupported options.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
package/openswan/openswan-01-gcc-detection.patch | 43 ++++++++++++++++++++++++
1 file changed, 43 insertions(+)
create mode 100644 package/openswan/openswan-01-gcc-detection.patch
diff --git a/package/openswan/openswan-01-gcc-detection.patch b/package/openswan/openswan-01-gcc-detection.patch
new file mode 100644
index 0000000..2feb5c5
--- /dev/null
+++ b/package/openswan/openswan-01-gcc-detection.patch
@@ -0,0 +1,43 @@
+From b37d4bd266ec65acdf5288e21722991d1c5ec44a Mon Sep 17 00:00:00 2001
+From: Gustavo Zacarias <gustavo@zacarias.com.ar>
+Date: Sun, 30 Mar 2014 08:52:05 -0300
+Subject: [PATCH] Makefile: use CC for version test instead of gcc
+
+Use $(CC) for the version test since that's different from gcc when
+cross-compiling.
+
+Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
+---
+ lib/libopenswan/Makefile | 2 +-
+ programs/pluto/Makefile | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/libopenswan/Makefile b/lib/libopenswan/Makefile
+index 3649fe7..06f5317 100644
+--- a/lib/libopenswan/Makefile
++++ b/lib/libopenswan/Makefile
+@@ -90,7 +90,7 @@ CFLAGS+= -Wpointer-arith
+ CFLAGS+= -Wno-error=cast-qual
+
+ # Check if GCC's version is recent enough
+-GCC_VERSION_GE_46:=$(shell test `gcc -dumpversion | sed 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'` -ge 46 && echo true || echo false)
++GCC_VERSION_GE_46:=$(shell test `$(CC) -dumpversion | sed 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'` -ge 46 && echo true || echo false)
+ ifeq ($(GCC_VERSION_GE_46),true)
+ # some junk left in alg_info.c
+ CFLAGS+= -Wno-error=cpp
+diff --git a/programs/pluto/Makefile b/programs/pluto/Makefile
+index 8e4bc89..ed5e9dc 100644
+--- a/programs/pluto/Makefile
++++ b/programs/pluto/Makefile
+@@ -48,7 +48,7 @@ CPPFLAGS = $(HDRDIRS) $(DEFINES) \
+ # must turn this off due to myid.c
+ CFLAGS+= -Wno-error=cast-qual
+ # Check if GCC's version is recent enough
+-GCC_VERSION_GE_46:=$(shell test `gcc -dumpversion | sed 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'` -ge 46 && echo true || echo false)
++GCC_VERSION_GE_46:=$(shell test `$(CC) -dumpversion | sed 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'` -ge 46 && echo true || echo false)
+ ifeq ($(GCC_VERSION_GE_46),true)
+ CFLAGS+= -Wno-error=cpp
+ endif
+--
+1.8.3.2
+
--
1.8.3.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] openswan: fix possible build failure
2014-03-30 11:56 [Buildroot] [PATCH] openswan: fix possible build failure Gustavo Zacarias
@ 2014-04-03 19:40 ` Thomas Petazzoni
2014-04-03 19:41 ` Gustavo Zacarias
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2014-04-03 19:40 UTC (permalink / raw)
To: buildroot
Dear Gustavo Zacarias,
On Sun, 30 Mar 2014 08:56:30 -0300, Gustavo Zacarias wrote:
> openswan's Makefile uses gcc instead of $(CC) for gcc version detection
> to use advanced warning/error options. The problem is that if the
> host gcc version is newish (>=4.6) and the gcc for the target is not it
> uses unsupported options.
>
> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
> ---
> package/openswan/openswan-01-gcc-detection.patch | 43 ++++++++++++++++++++++++
> 1 file changed, 43 insertions(+)
> create mode 100644 package/openswan/openswan-01-gcc-detection.patch
Applied, thanks. Please submit the patch upstream if you can.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] openswan: fix possible build failure
2014-04-03 19:40 ` Thomas Petazzoni
@ 2014-04-03 19:41 ` Gustavo Zacarias
0 siblings, 0 replies; 3+ messages in thread
From: Gustavo Zacarias @ 2014-04-03 19:41 UTC (permalink / raw)
To: buildroot
On 04/03/2014 04:40 PM, Thomas Petazzoni wrote:
> Applied, thanks. Please submit the patch upstream if you can.
That's always default=y (already sent) :)
Regards.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-04-03 19:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-30 11:56 [Buildroot] [PATCH] openswan: fix possible build failure Gustavo Zacarias
2014-04-03 19:40 ` Thomas Petazzoni
2014-04-03 19:41 ` Gustavo Zacarias
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox