[OE-core] [PATCH] byacc: fix compilation on Ubuntu 14.04

Khem Raj raj.khem at gmail.com
Thu Aug 27 01:27:59 UTC 2015


> On Aug 26, 2015, at 1:35 PM, Ross Burton <ross.burton at intel.com> wrote:
> 
> 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 at intel.com>
> ---
> meta/recipes-extended/byacc/byacc.inc              |  4 +++-
> meta/recipes-extended/byacc/byacc/byacc-open.patch | 13 +++++++++++++
> 2 files changed, 16 insertions(+), 1 deletion(-)
> create mode 100644 meta/recipes-extended/byacc/byacc/byacc-open.patch
> 
> diff --git a/meta/recipes-extended/byacc/byacc.inc b/meta/recipes-extended/byacc/byacc.inc
> index fae9e25..f9f8d6b 100644
> --- a/meta/recipes-extended/byacc/byacc.inc
> +++ b/meta/recipes-extended/byacc/byacc.inc
> @@ -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
> index 0000000..9160543
> --- /dev/null
> +++ b/meta/recipes-extended/byacc/byacc/byacc-open.patch
> @@ -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);


hmm its cryptic may be you can use (S_IRUSR|S_IWUSR) instead of 0666 and add ore flags if it needs.
and the patch will need upstreaming status.

> + 	strcpy(temp, name);
> +     }
> +     else
> --
> 2.1.4
> 
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20150826/67e7d515/attachment-0002.sig>


More information about the Openembedded-core mailing list