From d7d4f64a32d26fc8a92e4c89b47c78956f20a14d Mon Sep 17 00:00:00 2001 From: Erkka Kääriä Date: Wed, 21 Oct 2015 12:41:49 +0300 Subject: cacao-initial-native: Fix undefined behaviour in gc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upstream-Status: Backport Fixes undefined behaviour in boehm GC used by cacao-initial-native as suggested at https://github.com/ivmai/bdwgc/commit/16780405c899f01119bc45167122b4242f6b34fb. The undefined behaviour at very least causes a segmentation fault during classpath-native configure step with Fedora 22. Signed-off-by: Erkka Kääriä Signed-off-by: Maxin B. John --- ...-0.9.8-initial-fix-gc-undefined-behaviour.patch | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 recipes-core/cacao/files/cacao-0.9.8-initial-fix-gc-undefined-behaviour.patch (limited to 'recipes-core/cacao/files') diff --git a/recipes-core/cacao/files/cacao-0.9.8-initial-fix-gc-undefined-behaviour.patch b/recipes-core/cacao/files/cacao-0.9.8-initial-fix-gc-undefined-behaviour.patch new file mode 100644 index 0000000..ccc35cb --- /dev/null +++ b/recipes-core/cacao/files/cacao-0.9.8-initial-fix-gc-undefined-behaviour.patch @@ -0,0 +1,35 @@ +Upstream-Status: Backport + +This fixes undefined behaviour in boehm GC as suggested at +https://github.com/ivmai/bdwgc/commit/16780405c899f01119bc45167122b4242f6b34fb. + +The undefined behaviour at very least causes a segmentation fault during +classpath-native configure step. + +Signed-off-by: Erkka Kääriä + +--- cacao-0.98/src/mm/boehm-gc/mark_rts.c ++++ cacao-0.98/src/mm/boehm-gc/mark_rts.c +@@ -371,18 +371,7 @@ ptr_t p; + + ptr_t GC_approx_sp() + { +- VOLATILE word dummy; +- +- dummy = 42; /* Force stack to grow if necessary. Otherwise the */ +- /* later accesses might cause the kernel to think we're */ +- /* doing something wrong. */ +-# ifdef _MSC_VER +-# pragma warning(disable:4172) +-# endif +- return((ptr_t)(&dummy)); +-# ifdef _MSC_VER +-# pragma warning(default:4172) +-# endif ++ return __builtin_frame_address(0); + } + + /* +-- +2.1.4 + -- cgit v1.2.3-54-g00ecf