Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 621726 - app-text/texlive-core-2017-r1: fails to compile using clang (C++11)
Summary: app-text/texlive-core-2017-r1: fails to compile using clang (C++11)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Alexis Ballier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-14 08:08 UTC by Fabian Groffen
Modified: 2017-06-20 13:15 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
c++11 patch (pdftoepdf-c++11.patch,1.25 KB, patch)
2017-06-20 12:13 UTC, Fabian Groffen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Groffen gentoo-dev 2017-06-14 08:08:58 UTC
x86_64-apple-darwin16-clang -DHAVE_CONFIG_H -I. -I/Users/fabian/Gentoo-10.12/var/tmp/portage/app-text/texlive-core-2017-r1/work/texlive-20170524-source/texk/web2c -I./w2c  -I/Users/fabian/Gentoo-10.12/usr/lib  -I/Users/fabian/Gentoo-10.12/usr/include/libpng16 -DPOPPLER_VERSION=\"0.55.0\" -I/Users/fabian/Gentoo-10.12/usr/include/poppler -I/Users/fabian/Gentoo-10.12/var/tmp/portage/app-text/texlive-core-2017-r1/work/texlive-20170524-source/texk/web2c/libmd5 -DpdfTeX -I/Users/fabian/Gentoo-10.12/var/tmp/portage/app-text/texlive-core-2017-r1/work/texlive-20170524-source/texk/web2c/luatexdir -I/Users/fabian/Gentoo-10.12/var/tmp/portage/app-text/texlive-core-2017-r1/work/texlive-20170524-source/texk/web2c/luatexdir/unilib -I/Users/fabian/Gentoo-10.12/var/tmp/portage/app-text/texlive-core-2017-r1/work/texlive-20170524-source/texk/web2c/luatexdir/luafontloader/fontforge/inc -DLUA_FF_LIB=1 -I/Users/fabian/Gentoo-10.12/var/tmp/portage/app-text/texlive-core-2017-r1/work/texlive-20170524-source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge -DSYNCTEX_ENGINE_H='<synctex-luatex.h>' -I/Users/fabian/Gentoo-10.12/var/tmp/portage/app-text/texlive-core-2017-r1/work/texlive-20170524-source/texk/web2c/synctexdir -I/Users/fabian/Gentoo-10.12/var/tmp/portage/app-text/texlive-core-2017-r1/work/texlive-core-2017_build/libs/lua52/include -DLUA_COMPAT_MODULE -DLUAI_HASHLIMIT=6 -DLUA_USE_POSIX -DLUA_USE_DLOPEN  -Wimplicit -Wreturn-type -Wdeclaration-after-statement -Wno-unknown-pragmas -march=native -O2 -pipe -c -o libluatex_a-texlang.o `test -f 'texlang.c' || echo '/Users/fabian/Gentoo-10.12/var/tmp/portage/app-text/texlive-core-2017-r1/work/texlive-20170524-source/texk/web2c/'`texlang.c
/Users/fabian/Gentoo-10.12/var/tmp/portage/app-text/texlive-core-2017-r1/work/texlive-20170524-source/texk/web2c/luatexdir/image/pdftoepdf.w:74:34: error: 
      invalid suffix on literal; C++11 requires a space between literal and
      identifier [-Wreserved-user-defined-literal]
snprintf(ck,PDF_CHECKSUM_SIZE,"%"PRIu64"_%"PRIu64,(uint64_t)size,(uint64...
                                 ^
                                  
/Users/fabian/Gentoo-10.12/var/tmp/portage/app-text/texlive-core-2017-r1/work/texlive-20170524-source/texk/web2c/luatexdir/image/pdftoepdf.w:74:44: error: 
      invalid suffix on literal; C++11 requires a space between literal and
      identifier [-Wreserved-user-defined-literal]
snprintf(ck,PDF_CHECKSUM_SIZE,"%"PRIu64"_%"PRIu64,(uint64_t)size,(uint64...
                                           ^
                                            
2 errors generated.
make[5]: *** [Makefile:12944: libluatex_a-pdftoepdf.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[5]: Leaving directory '/Users/fabian/Gentoo-10.12/var/tmp/portage/app-text/texlive-core-2017-r1/work/texlive-core-2017_build/texk/web2c'
make[4]: *** [Makefile:13394: all-recursive] Error 1
make[4]: Leaving directory '/Users/fabian/Gentoo-10.12/var/tmp/portage/app-text/texlive-core-2017-r1/work/texlive-core-2017_build/texk/web2c'
make[3]: *** [Makefile:3820: all] Error 2
make[3]: Leaving directory '/Users/fabian/Gentoo-10.12/var/tmp/portage/app-text/texlive-core-2017-r1/work/texlive-core-2017_build/texk/web2c'
make[2]: *** [Makefile:906: recurse] Error 1
make[2]: Leaving directory '/Users/fabian/Gentoo-10.12/var/tmp/portage/app-text/texlive-core-2017-r1/work/texlive-core-2017_build/texk'
make[1]: *** [Makefile:486: all-recursive] Error 1
make[1]: Leaving directory '/Users/fabian/Gentoo-10.12/var/tmp/portage/app-text/texlive-core-2017-r1/work/texlive-core-2017_build/texk'
make: *** [Makefile:575: all-recursive] Error 1
 * ERROR: app-text/texlive-core-2017-r1::gentoo_prefix failed (compile phase):
 *   emake failed


I have no idea if it really is that simple as just adding a space.  I need to try.
Comment 1 Fabian Groffen gentoo-dev 2017-06-20 11:29:36 UTC
It appears the problem is in a generated file, where the generator on purpose generates very dense code.  So fixing it was a bit harder, but I found this to work at the end of src_prepare before elibtoolize:


    # fix C++11 (according to clang) in condense generated file
    sed -i -e 's/\<PRIu64\>/\nPRIu64\n/g' \
        texk/web2c/luatexdir/image/pdftoepdf.w || die


The code generator keeps newlines, so this way the C-compiler sees whitespace between the literal and identifier.

@maintainers: what do you think about this fix?
Comment 2 Alexis Ballier gentoo-dev 2017-06-20 11:48:32 UTC
(In reply to Fabian Groffen from comment #1)
> It appears the problem is in a generated file, where the generator on
> purpose generates very dense code.  So fixing it was a bit harder, but I
> found this to work at the end of src_prepare before elibtoolize:
> 
> 
>     # fix C++11 (according to clang) in condense generated file
>     sed -i -e 's/\<PRIu64\>/\nPRIu64\n/g' \
>         texk/web2c/luatexdir/image/pdftoepdf.w || die
> 
> 
> The code generator keeps newlines, so this way the C-compiler sees
> whitespace between the literal and identifier.
> 
> @maintainers: what do you think about this fix?

I would prefer a patch to include in the tarball


Isn't it possible to fix the generator ? I think we should include this quick and dirty patch but it should be reported upstream, because the line in the .w is correct but the postprocessed file is not.
Comment 3 Fabian Groffen gentoo-dev 2017-06-20 12:02:01 UTC
Yes, I believe the generator should be fixed, but I have no knowledge of the build system, so the only quick thing I could do was workaround it ;)

I'll add a patch with the effect of the sed-statement.

About reporting upstream, do you have a suggestion where?  tex-live@tug.org?
Comment 4 Alexis Ballier gentoo-dev 2017-06-20 12:08:59 UTC
(In reply to Fabian Groffen from comment #3)
> Yes, I believe the generator should be fixed, but I have no knowledge of the
> build system, so the only quick thing I could do was workaround it ;)

It probably won't be easy as this generator is used in a lot of places and changing it might have a lot of consequences

> I'll add a patch with the effect of the sed-statement.

thanks

> About reporting upstream, do you have a suggestion where?  tex-live@tug.org?

yes that's probably the best place I think
Comment 5 Fabian Groffen gentoo-dev 2017-06-20 12:13:07 UTC
Created attachment 477318 [details, diff]
c++11 patch
Comment 6 Alexis Ballier gentoo-dev 2017-06-20 13:15:50 UTC
commit be00e932c28e0273052f6c26d586c9e48aee8b8f (HEAD -> master, origin/master, origin/HEAD)
Author: Alexis Ballier <aballier@gentoo.org>
Date:   Tue Jun 20 15:15:07 2017 +0200

    app-text/texlive-core: Add patch by  Fabian Groffen to fix build with clang, bug #621726



thanks!