git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #35887 from dtzWill/fix/luatex-issue-35839

luatex: patch to fix crash w/gcc7

commitc9cf193f0e6a8fafa99fcb34f9bd2411612b9210 authorWill Dietz <github@wdtz.org> dateTue 27 Feb 2018, 11:39 (9 years ago) parentde7f766af73962
2 files changed+32
pkgs/tools/typesetting/tex/texlive/bin.nix+2 pkgs/tools/typesetting/tex/texlive/luatex-gcc7.patch+30
pkgs/tools/typesetting/tex/texlive/bin.nix+2
@@ -168,6 +168,8 @@ core-big = stdenv.mkDerivation { #TODO: upmendex
168168 # http://tex.stackexchange.com/questions/97999/when-to-use-luajittex-in-favour-of-luatex
169169 ];
170170
171+ patches = [ ./luatex-gcc7.patch ];
172+
171173 configureScript = ":";
172174
173175 # we use static libtexlua, because it's only used by a single binary
pkgs/tools/typesetting/tex/texlive/luatex-gcc7.patchnew file+30
@@ -0,0 +1,30 @@
1+https://www.tug.org/pipermail/tex-live/2017-June/040192.html
2+---
3+ texk/web2c/luatexdir/luaffi/ctype.c | 4 ++++
4+ texk/web2c/luatexdir/luaffi/ffi.h | 2 +-
5+ 2 files changed, 5 insertions(+), 1 deletion(-)
6+
7+--- a/texk/web2c/luatexdir/luaffi/ctype.c
8++++ b/texk/web2c/luatexdir/luaffi/ctype.c 2017-05-31 13:08:25.421741873 +0000
9+@@ -245,6 +245,10 @@ void* to_cdata(lua_State* L, int idx, st
10+
11+ lua_pop(L, 1); /* mt */
12+ cd = (struct cdata*) lua_touserdata(L, idx);
13++ if (!cd) {
14++ lua_pushnil(L);
15++ return NULL;
16++ }
17+ *ct = cd->type;
18+ lua_getuservalue(L, idx);
19+
20+--- a/texk/web2c/luatexdir/luaffi/ffi.h
21++++ b/texk/web2c/luatexdir/luaffi/ffi.h 2017-06-01 09:12:45.128442092 +0000
22+@@ -370,7 +370,7 @@ __declspec(align(16))
23+ #endif
24+ struct cdata {
25+ const struct ctype type
26+-#ifdef __GNUC__
27++#if 0 /* def __GNUC__ */
28+ __attribute__ ((aligned(16)))
29+ #endif
30+ ;