Source: motif Version: 2.3.4-13 Severity: important Tags: patch User: debian-sparc@lists.debian.org Usertags: sparc64 X-Debbugs-Cc: debian-sparc@lists.debian.org
Hi, Currently src:motif FTBFS on sparc64 due to wml crashing with SIGBUS (no build logs available, as libfl-dev was broken on sparc64 until just recently, masking the issue). This is because wml.c has yyleng defined as a size_t, which was correct for versions of flex between 2.5.36 and 2.6.1, but this violated POSIX[0] and so yyleng was reverted back to an int in 2.6.1[1]. When building on sparc64, yyleng just happens to be aligned to a 4-byte boundary but not an 8-byte boundary, so doing an 8-byte store to it is unaligned and traps, but on other architectures this will silently zero out the next 4 bytes in memory. Please apply the attached debdiff to revert wml.c back to defining yyleng as an external int, and also add a version constraint to libfl-dev to ensure motif is not accidentally built with an older version of flex without reinstating the hunk. With it I can successfully build motif on sparc64. Regards, James [0] http://pubs.opengroup.org/onlinepubs/7908799/xcu/lex.html [1] https://github.com/westes/flex/commit/7a7c3dfe1bcb8230447ba1656f926b4b4cdfc457
diff -Nru motif-2.3.7/debian/control motif-2.3.7/debian/control --- motif-2.3.7/debian/control 2017-08-03 11:21:00.000000000 +0100 +++ motif-2.3.7/debian/control 2017-08-04 22:36:10.000000000 +0100 @@ -5,7 +5,7 @@ debhelper (>= 10), dh-exec, flex (>= 2.5.36), - libfl-dev, + libfl-dev (>= 2.6.1), libfontconfig1-dev, libjpeg-dev, libpng-dev, diff -Nru motif-2.3.7/debian/patches/fix-type-inconsistencies.patch motif-2.3.7/debian/patches/fix-type-inconsistencies.patch --- motif-2.3.7/debian/patches/fix-type-inconsistencies.patch 2017-08-03 10:54:00.000000000 +0100 +++ motif-2.3.7/debian/patches/fix-type-inconsistencies.patch 2017-08-04 22:36:10.000000000 +0100 @@ -1,12 +1,10 @@ Description: Fix type inconsistencies This patch fixes various type inconsistencies reported by goto-cc from the cbmc package. - . - The yyleng fix in tools/wml/wml.c requires flex >= 2.5.36. Author: Graham Inggs <gin...@debian.org> Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1641 Bug-Debian: http://bugs.debian.org/749417 -Last-Update: 2017-08-03 +Last-Update: 2017-08-04 --- a/lib/Xm/EditresComI.h +++ b/lib/Xm/EditresComI.h @@ -8,7 +8,7 @@ @@ -49,17 +47,6 @@ extern int _XmTabbedStackListCount _ARGS((XmTabbedStackList)); #ifndef _NO_PROTO ---- a/tools/wml/wml.c -+++ b/tools/wml/wml.c -@@ -153,7 +153,7 @@ - /* - * External variables - */ --extern int yyleng; -+extern size_t yyleng; - extern int yyparse(); - - --- a/demos/lib/Xmd/RegEdit.c +++ b/demos/lib/Xmd/RegEdit.c @@ -252,7 +252,7 @@