]> code.ossystems Code Review - openembedded-core.git/commitdiff
byacc: fix compilation on Ubuntu 14.04
authorRoss Burton <ross.burton@intel.com>
Wed, 26 Aug 2015 20:32:45 +0000 (21:32 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 30 Aug 2015 11:34:27 +0000 (12:34 +0100)
Ubuntu defaults to passing _FORTIFY_SOURCE=2 which breaks byacc as it doesn't
pass enough arguments to open():

inlined from 'open_tmpfile' at byacc-20150711/main.c:588:5:
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:50:24: error: call to '__open_missing_mode' declared with attribute error:
open with O_CREAT in second argument needs 3 arguments

Add a mode of 0666 to fix this.

Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-extended/byacc/byacc.inc
meta/recipes-extended/byacc/byacc/byacc-open.patch [new file with mode: 0644]

index fae9e2504a8233ab10049e0a94dcf7fc08b8d518..f9f8d6b5f03030d9a4039f4ade5de420fb7ece13 100644 (file)
@@ -5,7 +5,9 @@ programming language."
 SECTION = "devel"
 LICENSE = "PD"
 
-SRC_URI = "ftp://invisible-island.net/byacc/byacc-${PV}.tgz"
+SRC_URI = "ftp://invisible-island.net/byacc/byacc-${PV}.tgz \
+           file://byacc-open.patch"
+
 EXTRA_OECONF += "--program-transform-name='s,^,b,'"
 
 BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/byacc/byacc/byacc-open.patch b/meta/recipes-extended/byacc/byacc/byacc-open.patch
new file mode 100644 (file)
index 0000000..9160543
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/main.c b/main.c
+index 620ce3f..82071a4 100644
+--- a/main.c
++++ b/main.c
+@@ -526,7 +526,7 @@ my_mkstemp(char *temp)
+     }
+     if ((name = tempnam(dname, fname)) != 0)
+     {
+-      fd = open(name, O_CREAT | O_EXCL | O_RDWR);
++      fd = open(name, O_CREAT | O_EXCL | O_RDWR, 0666);
+       strcpy(temp, name);
+     }
+     else