From ae3158e0cfbfa1f1027976bff34ad502eeb28583 Mon Sep 17 00:00:00 2001 From: Kai Kang Date: Tue, 20 Aug 2013 10:20:08 +0800 Subject: bc: add patch to fix segmentation fault When run 'bc -l', it segmentation faults. Apply patch from BLFS to fix it. Ref: http://www.mail-archive.com/blfs-support@linuxfromscratch.org/msg04601.html Signed-off-by: Kai Kang Signed-off-by: Saul Wold --- meta/recipes-extended/bc/bc_1.06.bb | 3 ++- .../bc/files/fix-segment-fault.patch | 28 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-extended/bc/files/fix-segment-fault.patch (limited to 'meta/recipes-extended') diff --git a/meta/recipes-extended/bc/bc_1.06.bb b/meta/recipes-extended/bc/bc_1.06.bb index fe9c3f462f..4b28fadb73 100644 --- a/meta/recipes-extended/bc/bc_1.06.bb +++ b/meta/recipes-extended/bc/bc_1.06.bb @@ -13,7 +13,8 @@ SECTION = "base" DEPENDS = "flex" PR = "r2" -SRC_URI = "${GNU_MIRROR}/bc/bc-${PV}.tar.gz" +SRC_URI = "${GNU_MIRROR}/bc/bc-${PV}.tar.gz \ + file://fix-segment-fault.patch " SRC_URI[md5sum] = "d44b5dddebd8a7a7309aea6c36fda117" SRC_URI[sha256sum] = "4ef6d9f17c3c0d92d8798e35666175ecd3d8efac4009d6457b5c99cea72c0e33" diff --git a/meta/recipes-extended/bc/files/fix-segment-fault.patch b/meta/recipes-extended/bc/files/fix-segment-fault.patch new file mode 100644 index 0000000000..20c0da2ebe --- /dev/null +++ b/meta/recipes-extended/bc/files/fix-segment-fault.patch @@ -0,0 +1,28 @@ +Upstream-Status: Pending + +when run command such as 'echo "a = 13" | bc -l', it segmentation faults. +This patch is from http://www.mail-archive.com/blfs-support@linuxfromscratch.org/msg04602.html. + +Signed-off-by: Kai Kang + +--- bc-1.06/lib/number.c.orig 2003-09-26 21:14:02.000000000 +0000 ++++ bc-1.06/lib/number.c 2003-09-26 21:14:26.000000000 +0000 +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + #include /* Prototypes needed for external utility routines. */ + + #define bc_rt_warn rt_warn +--- bc-1.06/bc/load.c.orig 2003-09-26 21:14:14.000000000 +0000 ++++ bc-1.06/bc/load.c 2003-09-26 21:14:26.000000000 +0000 +@@ -156,7 +156,7 @@ + long label_no; + long vaf_name; /* variable, array or function number. */ + long func; +- program_counter save_adr; ++ static program_counter save_adr; + + /* Initialize. */ + str = code; -- cgit v1.2.3