New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling on Raspberry Pi #1868

Closed
zeitkunst opened this Issue Jul 19, 2014 · 46 comments

Comments

Projects
None yet
@zeitkunst

zeitkunst commented Jul 19, 2014

Opening a new issue, rather than responding to the closed one (#1657).

I'm trying to get wkhtmltopdf compiled on the Pi, and I'm very close. But I'm encountering an error when I try and build libwkhtmltox.so.0.12.2. At the step when it is running the makefile in wkhtmltopdf/static-build/posix-local/app/src/lib, I'm receiving the following, strange, linker error:

'.LTHUNK0' referenced in section '.text._ZN15QGraphicsObjectD1EV[QGraphicsObject::~QGraphicsObject()]’ of /home/pi/wkhtmltopdf/static-build/posix-local/qt/lib/libQtGui.a(qgraphicsitem.o): defined in discarded section ‘.text._ZN15QGraphicsObjectsD2Ev[_ZN15QGraphicsObjectD5Ev]’ of /home/pi/wkhtmltopdf/static-build/posix-local/qt/lib/libQtGui.a(qgraphicsitem.o)

The only thing I’ve been able to find out about this kind of error is that it possibly has to do with the library link order.

The full command is:

make[1]: Entering directory ‘/home/pi/wkhtmltopdf/static-build/posix-local/app/src/lib’
rm -f libwkhtmltox.so.0.12.2 libwkhtmltox.so libwkhtmltox.so.0 libwkhtmltox.so.0.12
g++ -Wl,-O1 -shared -Wl,-soname,libwkhtmltox.so.0 -o libwkhtmltox.so.0.12.2 loadsettings.o multipageloader.o tempfile.o converter.o websettings.o reflect.o utilities.o pdfsettings.o pdfconverter.o outline.o tocstylesheet.o imagesettings.o imageconverter.o pdf_c_bindings.o image_c_bindings.o moc_multipageloader.o moc_utilities.o moc_pdfconverter.o moc_imageconverter.o qrc_wkhtmltopdf.o -L/home/pi/wkhtmltopdf/static-build/posix-local/qt/lib -L/home/pi/wkhtmltopdf/static-build/posix-local/qt/plugins/codecs -lqcncodecs -L/home/pi/wkhtmltopdf/static-build/posix-local/qt/lib -lqjpcodecs -lqkrcodecs -lqtwcodecs -lQtWebKit -L/usr/X11R6/lib -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lQtSvg -lQtXmlPatterns -lQtGui -ljpeg -lpng -lXrender -lfontconfig -lfreetype -lXext -lX11 -lQtNetwork -lQtCore -lz lm -ldl -lrt -lpthread

gcc version 4.6.3 (Debian 4.6.3-14+rpi1)

I was running out of memory when linking, but I ought to have enough swap space now to work (the swap is not exhausted when the linker is running)

Thanks for any help!

@ashkulz

This comment has been minimized.

Show comment
Hide comment
@ashkulz

ashkulz Jul 20, 2014

Member

See this link for a possible solution: you'll have to make some changes in Qt.

http://qt-project.org/forums/viewthread/22427/P15

Member

ashkulz commented Jul 20, 2014

See this link for a possible solution: you'll have to make some changes in Qt.

http://qt-project.org/forums/viewthread/22427/P15

@zeitkunst

This comment has been minimized.

Show comment
Hide comment
@zeitkunst

zeitkunst Jul 20, 2014

Thanks for the suggestion; I'll give it a shot. It might be a couple of days before I can report back, as I'm compiling all of this on the Pi itself (and it takes about 18hrs) as I haven't figured out a good way to compile wkhtmltopdf using my cross-compiling setup.

zeitkunst commented Jul 20, 2014

Thanks for the suggestion; I'll give it a shot. It might be a couple of days before I can report back, as I'm compiling all of this on the Pi itself (and it takes about 18hrs) as I haven't figured out a good way to compile wkhtmltopdf using my cross-compiling setup.

@ashkulz

This comment has been minimized.

Show comment
Hide comment
@ashkulz

ashkulz Jul 20, 2014

Member

Just curious, what is the use of having it on the Pi? I'd be interested to document it if you got the cross-compiling setup working, as compiling directly on the Pi will be too much for most folks :-)

Member

ashkulz commented Jul 20, 2014

Just curious, what is the use of having it on the Pi? I'd be interested to document it if you got the cross-compiling setup working, as compiling directly on the Pi will be too much for most folks :-)

@bennett000

This comment has been minimized.

Show comment
Hide comment
@bennett000

bennett000 Oct 7, 2014

@zeitkunst I would be really curious to know if you ever got wkhtml2pdf statically compiled for the Raspberry Pi.

So far my cross compilation efforts have all failed in one form or another, and when resorting to compiling on the Pi itself I've encountered this issue, and given up due to Qt's daunting compile time.

@ashkulz my use case is for printing PDFs generated from HTML. I can use the dynamic wkhtml2pdf for this, but it "zooms" the page, and it requires X, or at least a virtual X.

bennett000 commented Oct 7, 2014

@zeitkunst I would be really curious to know if you ever got wkhtml2pdf statically compiled for the Raspberry Pi.

So far my cross compilation efforts have all failed in one form or another, and when resorting to compiling on the Pi itself I've encountered this issue, and given up due to Qt's daunting compile time.

@ashkulz my use case is for printing PDFs generated from HTML. I can use the dynamic wkhtml2pdf for this, but it "zooms" the page, and it requires X, or at least a virtual X.

@zeitkunst

This comment has been minimized.

Show comment
Hide comment
@zeitkunst

zeitkunst Oct 7, 2014

@bennett000 I wasn't able to get either the cross-compiler to work properly, nor to get it to compile directly even with the changes. Granted, I only tried once with @ashkulz's suggestions, precisely because of the extended compile time. I ended up using xelatex and some LaTeX templates (!) for my use-case; while it's rather slow, it works. I'd be delighted to use wkhtmltopdf instead, if anyone is able to get it compiled.

zeitkunst commented Oct 7, 2014

@bennett000 I wasn't able to get either the cross-compiler to work properly, nor to get it to compile directly even with the changes. Granted, I only tried once with @ashkulz's suggestions, precisely because of the extended compile time. I ended up using xelatex and some LaTeX templates (!) for my use-case; while it's rather slow, it works. I'd be delighted to use wkhtmltopdf instead, if anyone is able to get it compiled.

@ashkulz

This comment has been minimized.

Show comment
Hide comment
@ashkulz

ashkulz Oct 21, 2014

Member

I don't have a Pi, so I can't really test anything :-)

Member

ashkulz commented Oct 21, 2014

I don't have a Pi, so I can't really test anything :-)

@gebser

This comment has been minimized.

Show comment
Hide comment
@gebser

gebser Dec 10, 2014

Though I've compiled a lot of code over the years, I haven't tried this one and not on an RPi. But I could recommend two strategies: One would be to cd to the directory where the problem is occurring (from your listed output this looks like ../src/lib/); if there's a Makefile there run a make on it, otherwise run by hand the compile and link commands by hand, at the command line. This will save a lot of time over trying to recompile the entire body of code and it will confirm (or not) that this is truly where the error is.

Second, according to the error message, it looks to me as though it's trying to link against something which no longer exists, so I would comment out the rm command (documenting it in the code) and try it again. (However, I didn't see anything in the error message which seemed to correspond to a file which was getting rm'd in the snippet in your post... so it might be some other rm command.

The first time running 'make' on a project is going to take the longest. Thereafter, anything which successfully compiles or links isn't going to be compiled or linked again, saving you some time. So the entire compilation time will get shorter as each problem is solved. Hopefully this will provide you some encouragement to continue.

PS. Be sure to take good notes and pass them off to the developers so they can amend the Makefile(s) to make the path smoother for the next guys coming down the trail you're pioneering. :)

gebser commented Dec 10, 2014

Though I've compiled a lot of code over the years, I haven't tried this one and not on an RPi. But I could recommend two strategies: One would be to cd to the directory where the problem is occurring (from your listed output this looks like ../src/lib/); if there's a Makefile there run a make on it, otherwise run by hand the compile and link commands by hand, at the command line. This will save a lot of time over trying to recompile the entire body of code and it will confirm (or not) that this is truly where the error is.

Second, according to the error message, it looks to me as though it's trying to link against something which no longer exists, so I would comment out the rm command (documenting it in the code) and try it again. (However, I didn't see anything in the error message which seemed to correspond to a file which was getting rm'd in the snippet in your post... so it might be some other rm command.

The first time running 'make' on a project is going to take the longest. Thereafter, anything which successfully compiles or links isn't going to be compiled or linked again, saving you some time. So the entire compilation time will get shorter as each problem is solved. Hopefully this will provide you some encouragement to continue.

PS. Be sure to take good notes and pass them off to the developers so they can amend the Makefile(s) to make the path smoother for the next guys coming down the trail you're pioneering. :)

@GM-Script-Writer-62850

This comment has been minimized.

Show comment
Hide comment
@GM-Script-Writer-62850

GM-Script-Writer-62850 May 16, 2015

@ashkulz
If i get another pi one day and give you ssh access would you be willing to work on this?

GM-Script-Writer-62850 commented May 16, 2015

@ashkulz
If i get another pi one day and give you ssh access would you be willing to work on this?

@ashkulz

This comment has been minimized.

Show comment
Hide comment
@ashkulz

ashkulz May 17, 2015

Member

@GM-Script-Writer-62850: you'll have to do the compilation/testing, I can help you out if you encounter any issues. Try the suggestion I posted above to which there was no response.

Member

ashkulz commented May 17, 2015

@GM-Script-Writer-62850: you'll have to do the compilation/testing, I can help you out if you encounter any issues. Try the suggestion I posted above to which there was no response.

@ashkulz

This comment has been minimized.

Show comment
Hide comment
@ashkulz

ashkulz May 17, 2015

Member

Apparently, it is a known problem -- see compile mythtv and building qt5.3 for arm. The original link is dead, but you can get it from the Internet Archive.

Member

ashkulz commented May 17, 2015

Apparently, it is a known problem -- see compile mythtv and building qt5.3 for arm. The original link is dead, but you can get it from the Internet Archive.

@burningTyger

This comment has been minimized.

Show comment
Hide comment
@burningTyger

burningTyger Jul 27, 2015

Any news on this? No wkhtmltopdf is a deal breaker for one of my projects.

burningTyger commented Jul 27, 2015

Any news on this? No wkhtmltopdf is a deal breaker for one of my projects.

@ashkulz

This comment has been minimized.

Show comment
Hide comment
@ashkulz

ashkulz Jul 27, 2015

Member

Is there a cross-compiler known to work?

Member

ashkulz commented Jul 27, 2015

Is there a cross-compiler known to work?

@burningTyger

This comment has been minimized.

Show comment
Hide comment
@burningTyger

burningTyger Jul 28, 2015

I asked on irc and received this answer: http://www.openframeworks.cc/setup/raspberrypi/Raspberry-Pi-Cross-compiling-guide.html Can't tell how well it's working though. I have ordered a Pi yesterday once I have it set up I can start testing builds.

burningTyger commented Jul 28, 2015

I asked on irc and received this answer: http://www.openframeworks.cc/setup/raspberrypi/Raspberry-Pi-Cross-compiling-guide.html Can't tell how well it's working though. I have ordered a Pi yesterday once I have it set up I can start testing builds.

@ashkulz

This comment has been minimized.

Show comment
Hide comment
@ashkulz

ashkulz Jul 28, 2015

Member

Not sure how you can cross-compile Qt via that mechanism. There's already support in the build script for using a cross-compiler (see the mingw-w64 targets). Or if you do compile directly on the device, try the above answer and see if that helps.

Member

ashkulz commented Jul 28, 2015

Not sure how you can cross-compile Qt via that mechanism. There's already support in the build script for using a cross-compiler (see the mingw-w64 targets). Or if you do compile directly on the device, try the above answer and see if that helps.

@burningTyger

This comment has been minimized.

Show comment
Hide comment
@burningTyger

burningTyger Jul 31, 2015

Compiling I end up with this error:

../../JavaScriptCore/wtf/RefCounted.h:141:13: warning: deleting object of polymorphic class type 'WebCore::Frame' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
             delete static_cast<T*>(this);
             ^
{standard input}: Assembler messages:
{standard input}:3735: Warning: end of file not at end of a line; newline inserted
{standard input}:3834: Error: missing `}' -- `stmfd sp!,{r4,r5,r6,r7,r8'
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://github.com/archlinuxarm/PKGBUILDs/issues> for instructions.
Makefile.WebKit.QtWebKit:351087: recipe for target '.obj/release-shared/RenderBlock.o' failed
make[2]: *** [.obj/release-shared/RenderBlock.o] Error 4
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/home/hmt/qt-wkhtmltopdf/src/3rdparty/webkit/Source/WebKit/qt'
Makefile.WebKit:40: recipe for target 'sub-WebKit-qt-QtWebKit-pro-make_default-ordered' failed
make[1]: *** [sub-WebKit-qt-QtWebKit-pro-make_default-ordered] Error 2
make[1]: Leaving directory '/home/hmt/qt-wkhtmltopdf/src/3rdparty/webkit/Source'
Makefile:708: recipe for target 'sub-webkit-make_default-ordered' failed
make: *** [sub-webkit-make_default-ordered] Error 2

After some serious compiling time :) Nothing to try more than twice.

burningTyger commented Jul 31, 2015

Compiling I end up with this error:

../../JavaScriptCore/wtf/RefCounted.h:141:13: warning: deleting object of polymorphic class type 'WebCore::Frame' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
             delete static_cast<T*>(this);
             ^
{standard input}: Assembler messages:
{standard input}:3735: Warning: end of file not at end of a line; newline inserted
{standard input}:3834: Error: missing `}' -- `stmfd sp!,{r4,r5,r6,r7,r8'
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://github.com/archlinuxarm/PKGBUILDs/issues> for instructions.
Makefile.WebKit.QtWebKit:351087: recipe for target '.obj/release-shared/RenderBlock.o' failed
make[2]: *** [.obj/release-shared/RenderBlock.o] Error 4
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/home/hmt/qt-wkhtmltopdf/src/3rdparty/webkit/Source/WebKit/qt'
Makefile.WebKit:40: recipe for target 'sub-WebKit-qt-QtWebKit-pro-make_default-ordered' failed
make[1]: *** [sub-WebKit-qt-QtWebKit-pro-make_default-ordered] Error 2
make[1]: Leaving directory '/home/hmt/qt-wkhtmltopdf/src/3rdparty/webkit/Source'
Makefile:708: recipe for target 'sub-webkit-make_default-ordered' failed
make: *** [sub-webkit-make_default-ordered] Error 2

After some serious compiling time :) Nothing to try more than twice.

@ashkulz

This comment has been minimized.

Show comment
Hide comment
@ashkulz

ashkulz Jul 31, 2015

Member

Hmm, it's an internal compiler error. Not too sure what the cause is, so unless you can use a different toolchain I'm afraid you're out of luck. Try with a different version of gcc.

Member

ashkulz commented Jul 31, 2015

Hmm, it's an internal compiler error. Not too sure what the cause is, so unless you can use a different toolchain I'm afraid you're out of luck. Try with a different version of gcc.

@burningTyger

This comment has been minimized.

Show comment
Hide comment
@burningTyger

burningTyger Jul 31, 2015

Well, I won't be able to fix it – just a guess – do you know of reasonable alternatives to wkhtmltopdf that might run on arm?

burningTyger commented Jul 31, 2015

Well, I won't be able to fix it – just a guess – do you know of reasonable alternatives to wkhtmltopdf that might run on arm?

@GM-Script-Writer-62850

This comment has been minimized.

Show comment
Hide comment
@GM-Script-Writer-62850

GM-Script-Writer-62850 Jul 31, 2015

what i needed to do was send the pdf out in a email, what i did since i could not use this was generate a link to document and send that along with a html file
id like to send a pdf instead of a html file, but i did not want to setup a free web host just to run this on another server

GM-Script-Writer-62850 commented Jul 31, 2015

what i needed to do was send the pdf out in a email, what i did since i could not use this was generate a link to document and send that along with a html file
id like to send a pdf instead of a html file, but i did not want to setup a free web host just to run this on another server

@ashkulz

This comment has been minimized.

Show comment
Hide comment
@ashkulz

ashkulz Aug 1, 2015

Member

What is the version of gcc you are using? The original reporter got stuck at a different place.

Member

ashkulz commented Aug 1, 2015

What is the version of gcc you are using? The original reporter got stuck at a different place.

@GenericUK

This comment has been minimized.

Show comment
Hide comment
@GenericUK

GenericUK Aug 12, 2015

I'm also interested in a Pi version for pdf email attaching from within Frappe/ERPNext which I have running on Pi local server. Frappe/ERPNext requires the latest version.

With regards to some of the comments above, you do realise there is version 0.9.9 in Raspbian repository.

GenericUK commented Aug 12, 2015

I'm also interested in a Pi version for pdf email attaching from within Frappe/ERPNext which I have running on Pi local server. Frappe/ERPNext requires the latest version.

With regards to some of the comments above, you do realise there is version 0.9.9 in Raspbian repository.

@GenericUK

This comment has been minimized.

Show comment
Hide comment

GenericUK commented Aug 12, 2015

@bennett000

This comment has been minimized.

Show comment
Hide comment
@bennett000

bennett000 Aug 25, 2015

@GenericUK running a virtual X frame buffer is a workable solution for my use case (HTML to PDF conversion), and we actually used it for a while, but it's inefficient, which is why I was looking to build wkhtmltopdf, using a version of QT compiled with the wkhtmltopdf patches.

tl;dr

From the wkhtmltopdf docs:

       This  version  of wkhtmltopdf has been compiled against a version of QT 
       without the wkhtmltopdf patches. Therefore some features are missing, 
       if you need these features please use the static version.

       Currently the list of features only supported with patch QT includes:

        * Printing more then one HTML document into a PDF file.
        * Running without an X11 server.
        * Adding a document outline to the PDF file.
        * Adding headers and footers to the PDF file.
        * Generating a table of contents.
        * Adding links in the generated PDF file.
        * Printing using the screen media-type.
        * Disabling the smart shrink feature of webkit.

My theory was that a version of wkhtmltopdf with the patched QT would convert faster than loading up a virtual X server each time, and I was hoping I'd be able to run wkhtmltopdf once, and pipe input into it...

We ended up using PhantomJS to do PDF conversion, but it comes with its own share of shortcomings; notably instability when it's been running for days.

bennett000 commented Aug 25, 2015

@GenericUK running a virtual X frame buffer is a workable solution for my use case (HTML to PDF conversion), and we actually used it for a while, but it's inefficient, which is why I was looking to build wkhtmltopdf, using a version of QT compiled with the wkhtmltopdf patches.

tl;dr

From the wkhtmltopdf docs:

       This  version  of wkhtmltopdf has been compiled against a version of QT 
       without the wkhtmltopdf patches. Therefore some features are missing, 
       if you need these features please use the static version.

       Currently the list of features only supported with patch QT includes:

        * Printing more then one HTML document into a PDF file.
        * Running without an X11 server.
        * Adding a document outline to the PDF file.
        * Adding headers and footers to the PDF file.
        * Generating a table of contents.
        * Adding links in the generated PDF file.
        * Printing using the screen media-type.
        * Disabling the smart shrink feature of webkit.

My theory was that a version of wkhtmltopdf with the patched QT would convert faster than loading up a virtual X server each time, and I was hoping I'd be able to run wkhtmltopdf once, and pipe input into it...

We ended up using PhantomJS to do PDF conversion, but it comes with its own share of shortcomings; notably instability when it's been running for days.

@tobias-hammerschmidt

This comment has been minimized.

Show comment
Hide comment
@tobias-hammerschmidt

tobias-hammerschmidt Oct 22, 2015

I've successfully cross-compiled wkhtmltopdf for rpi however when running the final binary on my Pi it results in a segmentation fault (exactly the same error message as in #2160 (comment)). This is the output from my gdb session on my Pi:

pi@rpi ~ $ ./wkhtmltopdf -V
wkhtmltopdf 0.12.3-dev (with patched qt)
pi@rpi ~ $ gdb --args /home/pi/wkhtmltopdf foo.html foo.pdf
GNU gdb (Raspbian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/pi/wkhtmltopdf...done.
(gdb) run
Starting program: /home/pi/wkhtmltopdf foo.html foo.pdf
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[New Thread 0xb6980450 (LWP 17820)]
[New Thread 0xb6058450 (LWP 17821)]
Loading pages (1/6)
[======================>                                     ] 38%
Program received signal SIGSEGV, Segmentation fault.
0xb6e8f614 in XListFonts () from /usr/lib/arm-linux-gnueabihf/libX11.so.6
(gdb) bt
#0  0xb6e8f614 in XListFonts () from /usr/lib/arm-linux-gnueabihf/libX11.so.6
#1  0x01440e28 in loadXlfds(char const*, int) ()
#2  0x014417a8 in load(QString const&, int, bool) ()
#3  0x01443f88 in QFontDatabase::families(QFontDatabase::WritingSystem) const ()
#4  0x01444310 in QFontDatabase::hasFamily(QString const&) const ()
#5  0x0064b9ec in WebCore::FontCache::createFontPlatformData(WebCore::FontDescription const&, WTF::AtomicString const&) ()
#6  0x0048d87c in WebCore::FontCache::getCachedFontPlatformData(WebCore::FontDescription const&, WTF::AtomicString const&, bool) ()
#7  0x0048f3cc in WebCore::FontCache::getFontData(WebCore::Font const&, int&, WebCore::FontSelector*) ()
#8  0x00483ef8 in WebCore::FontFallbackList::determinePitch(WebCore::Font const*) const ()
#9  0x00545e30 in WebCore::RenderBlock::LineBreaker::nextLineBreak(WebCore::BidiResolver<WebCore::InlineIterator, WebCore::BidiRun>&, WebCore::LineInfo&, std::pair<WebCore::RenderText*, WebCore::LazyLineBreakIterator>&, WebCore::RenderBlock::FloatingObject*) ()
#10 0x00000000 in ?? ()
(gdb) 

I'm not sure which libraries should be statically linked - right now all X11 stuff is dynamically linked:

pi@rpi ~ $ ldd wkhtmltopdf 
        /usr/lib/arm-linux-gnueabihf/libarmmem.so (0xb6f04000)
        libXrender.so.1 => /usr/lib/arm-linux-gnueabihf/libXrender.so.1 (0xb6ee8000)
        libXext.so.6 => /usr/lib/arm-linux-gnueabihf/libXext.so.6 (0xb6ec9000)
        libX11.so.6 => /usr/lib/arm-linux-gnueabihf/libX11.so.6 (0xb6db3000)
        libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6da0000)
        librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb6d89000)
        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6d61000)
        libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6c85000)
        libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6c0a000)
        libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6bdd000)
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6a9f000)
        /lib/ld-linux-armhf.so.3 (0x7f60e000)
        libxcb.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb.so.1 (0xb6a80000)
        libXau.so.6 => /usr/lib/arm-linux-gnueabihf/libXau.so.6 (0xb6a75000)
        libXdmcp.so.6 => /usr/lib/arm-linux-gnueabihf/libXdmcp.so.6 (0xb6a69000)

tobias-hammerschmidt commented Oct 22, 2015

I've successfully cross-compiled wkhtmltopdf for rpi however when running the final binary on my Pi it results in a segmentation fault (exactly the same error message as in #2160 (comment)). This is the output from my gdb session on my Pi:

pi@rpi ~ $ ./wkhtmltopdf -V
wkhtmltopdf 0.12.3-dev (with patched qt)
pi@rpi ~ $ gdb --args /home/pi/wkhtmltopdf foo.html foo.pdf
GNU gdb (Raspbian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/pi/wkhtmltopdf...done.
(gdb) run
Starting program: /home/pi/wkhtmltopdf foo.html foo.pdf
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[New Thread 0xb6980450 (LWP 17820)]
[New Thread 0xb6058450 (LWP 17821)]
Loading pages (1/6)
[======================>                                     ] 38%
Program received signal SIGSEGV, Segmentation fault.
0xb6e8f614 in XListFonts () from /usr/lib/arm-linux-gnueabihf/libX11.so.6
(gdb) bt
#0  0xb6e8f614 in XListFonts () from /usr/lib/arm-linux-gnueabihf/libX11.so.6
#1  0x01440e28 in loadXlfds(char const*, int) ()
#2  0x014417a8 in load(QString const&, int, bool) ()
#3  0x01443f88 in QFontDatabase::families(QFontDatabase::WritingSystem) const ()
#4  0x01444310 in QFontDatabase::hasFamily(QString const&) const ()
#5  0x0064b9ec in WebCore::FontCache::createFontPlatformData(WebCore::FontDescription const&, WTF::AtomicString const&) ()
#6  0x0048d87c in WebCore::FontCache::getCachedFontPlatformData(WebCore::FontDescription const&, WTF::AtomicString const&, bool) ()
#7  0x0048f3cc in WebCore::FontCache::getFontData(WebCore::Font const&, int&, WebCore::FontSelector*) ()
#8  0x00483ef8 in WebCore::FontFallbackList::determinePitch(WebCore::Font const*) const ()
#9  0x00545e30 in WebCore::RenderBlock::LineBreaker::nextLineBreak(WebCore::BidiResolver<WebCore::InlineIterator, WebCore::BidiRun>&, WebCore::LineInfo&, std::pair<WebCore::RenderText*, WebCore::LazyLineBreakIterator>&, WebCore::RenderBlock::FloatingObject*) ()
#10 0x00000000 in ?? ()
(gdb) 

I'm not sure which libraries should be statically linked - right now all X11 stuff is dynamically linked:

pi@rpi ~ $ ldd wkhtmltopdf 
        /usr/lib/arm-linux-gnueabihf/libarmmem.so (0xb6f04000)
        libXrender.so.1 => /usr/lib/arm-linux-gnueabihf/libXrender.so.1 (0xb6ee8000)
        libXext.so.6 => /usr/lib/arm-linux-gnueabihf/libXext.so.6 (0xb6ec9000)
        libX11.so.6 => /usr/lib/arm-linux-gnueabihf/libX11.so.6 (0xb6db3000)
        libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6da0000)
        librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb6d89000)
        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6d61000)
        libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6c85000)
        libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6c0a000)
        libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6bdd000)
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6a9f000)
        /lib/ld-linux-armhf.so.3 (0x7f60e000)
        libxcb.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb.so.1 (0xb6a80000)
        libXau.so.6 => /usr/lib/arm-linux-gnueabihf/libXau.so.6 (0xb6a75000)
        libXdmcp.so.6 => /usr/lib/arm-linux-gnueabihf/libXdmcp.so.6 (0xb6a69000)
@tobias-hammerschmidt

This comment has been minimized.

Show comment
Hide comment
@tobias-hammerschmidt

tobias-hammerschmidt Oct 23, 2015

Ok solved the segmentation fault issue - after reviewing the build I noticed that fontconfig was disabled due to the config test failing. After fixing this issue and rebuilding wkhtmltopdf now works like a charm on my Pi 👍

tobias-hammerschmidt commented Oct 23, 2015

Ok solved the segmentation fault issue - after reviewing the build I noticed that fontconfig was disabled due to the config test failing. After fixing this issue and rebuilding wkhtmltopdf now works like a charm on my Pi 👍

@burningTyger

This comment has been minimized.

Show comment
Hide comment
@burningTyger

burningTyger Oct 23, 2015

Which Linux flavour are you on and could you post a static version?

burningTyger commented Oct 23, 2015

Which Linux flavour are you on and could you post a static version?

@tobias-hammerschmidt

This comment has been minimized.

Show comment
Hide comment
@tobias-hammerschmidt

tobias-hammerschmidt Oct 23, 2015

My Pi is running Raspbian (Jessie). I can upload the binary (43Mb) but don't have any own webspace and I'm not sure whether its ok to upload it here in github? The binary still requires some shared libraries for running:

pi@rpi ~ $ ldd wkhtmltopdf 
        /usr/lib/arm-linux-gnueabihf/libarmmem.so (0xb6fa1000)
        libjpeg.so.62 => /usr/lib/arm-linux-gnueabihf/libjpeg.so.62 (0xb6f41000)
        libpng12.so.0 => /lib/arm-linux-gnueabihf/libpng12.so.0 (0xb6f1a000)
        libXrender.so.1 => /usr/lib/arm-linux-gnueabihf/libXrender.so.1 (0xb6f09000)
        libfontconfig.so.1 => /usr/lib/arm-linux-gnueabihf/libfontconfig.so.1 (0xb6ed7000)
        libfreetype.so.6 => /usr/lib/arm-linux-gnueabihf/libfreetype.so.6 (0xb6e40000)
        libXext.so.6 => /usr/lib/arm-linux-gnueabihf/libXext.so.6 (0xb6e21000)
        libX11.so.6 => /usr/lib/arm-linux-gnueabihf/libX11.so.6 (0xb6d0b000)
        libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0xb6ce4000)
        libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6cd1000)
        librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb6cb9000)
        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6c91000)
        libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6bb5000)
        libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6b3a000)
        libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6b0d000)
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb69cf000)
        /lib/ld-linux-armhf.so.3 (0x7f5f6000)
        libexpat.so.1 => /lib/arm-linux-gnueabihf/libexpat.so.1 (0xb699d000)
        libxcb.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb.so.1 (0xb697e000)
        libXau.so.6 => /usr/lib/arm-linux-gnueabihf/libXau.so.6 (0xb6973000)
        libXdmcp.so.6 => /usr/lib/arm-linux-gnueabihf/libXdmcp.so.6 (0xb6966000)

tobias-hammerschmidt commented Oct 23, 2015

My Pi is running Raspbian (Jessie). I can upload the binary (43Mb) but don't have any own webspace and I'm not sure whether its ok to upload it here in github? The binary still requires some shared libraries for running:

pi@rpi ~ $ ldd wkhtmltopdf 
        /usr/lib/arm-linux-gnueabihf/libarmmem.so (0xb6fa1000)
        libjpeg.so.62 => /usr/lib/arm-linux-gnueabihf/libjpeg.so.62 (0xb6f41000)
        libpng12.so.0 => /lib/arm-linux-gnueabihf/libpng12.so.0 (0xb6f1a000)
        libXrender.so.1 => /usr/lib/arm-linux-gnueabihf/libXrender.so.1 (0xb6f09000)
        libfontconfig.so.1 => /usr/lib/arm-linux-gnueabihf/libfontconfig.so.1 (0xb6ed7000)
        libfreetype.so.6 => /usr/lib/arm-linux-gnueabihf/libfreetype.so.6 (0xb6e40000)
        libXext.so.6 => /usr/lib/arm-linux-gnueabihf/libXext.so.6 (0xb6e21000)
        libX11.so.6 => /usr/lib/arm-linux-gnueabihf/libX11.so.6 (0xb6d0b000)
        libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0xb6ce4000)
        libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6cd1000)
        librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb6cb9000)
        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6c91000)
        libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6bb5000)
        libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6b3a000)
        libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6b0d000)
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb69cf000)
        /lib/ld-linux-armhf.so.3 (0x7f5f6000)
        libexpat.so.1 => /lib/arm-linux-gnueabihf/libexpat.so.1 (0xb699d000)
        libxcb.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb.so.1 (0xb697e000)
        libXau.so.6 => /usr/lib/arm-linux-gnueabihf/libXau.so.6 (0xb6973000)
        libXdmcp.so.6 => /usr/lib/arm-linux-gnueabihf/libXdmcp.so.6 (0xb6966000)
@GM-Script-Writer-62850

This comment has been minimized.

Show comment
Hide comment
@GM-Script-Writer-62850

GM-Script-Writer-62850 Oct 23, 2015

idk if it is ok, but you can upload it to any file sharing site (eg: mediafire, filedropper,mega ,etc.) and post a link
if you could include any libraries you had to compile that would be great

GM-Script-Writer-62850 commented Oct 23, 2015

idk if it is ok, but you can upload it to any file sharing site (eg: mediafire, filedropper,mega ,etc.) and post a link
if you could include any libraries you had to compile that would be great

@tobias-hammerschmidt

This comment has been minimized.

Show comment
Hide comment
@tobias-hammerschmidt

tobias-hammerschmidt Oct 24, 2015

The binary can be downloaded here. I only compiled wkhtmltopdf and linked against the raspbian libraries (jessie) so this will work out of the box on rpi with this distro.

tobias-hammerschmidt commented Oct 24, 2015

The binary can be downloaded here. I only compiled wkhtmltopdf and linked against the raspbian libraries (jessie) so this will work out of the box on rpi with this distro.

@GM-Script-Writer-62850

This comment has been minimized.

Show comment
Hide comment
@GM-Script-Writer-62850

GM-Script-Writer-62850 Oct 24, 2015

Thanks, works great, thought i got a couple warning messages, but i think they are unrelated

pi@raspberrypi:/tmp$ ./wkhtmltopdf http://10.0.0.75 ./test.pdf
Fontconfig warning: "/etc/fonts/conf.d/65-droid-sans-fonts.conf", line 103: Having multiple values in <test> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/65-droid-sans-fonts.conf", line 138: Having multiple values in <test> isn't supported and may not work as expected
Loading pages (1/6)
Counting pages (2/6)                                               
Resolving links (4/6)                                                       
Loading headers and footers (5/6)                                           
Printing pages (6/6)
Done   

from that font file:

[snip]
    96    <match target="scan">
    97      <test name="lang" compare="not_eq">
    98        <string>zh-cn</string>
    99        <string>zh-sg</string>
   100        <string>zh-hk</string>
   101        <string>zh-tw</string>
   102        <string>zh</string>
   103      </test>
[snip]
   132      <test name="lang">
   133        <string>zh-cn</string>
   134        <string>zh-sg</string>
   135        <string>zh-hk</string>
   136        <string>zh-tw</string>
   137        <string>zh</string>
   138      </test>
[snip]

I put a copy of the binary file on my pi in a 7z archive if anyone needs it
http://evilkitty.duckdns.org/wkhtmltopdf.7z (~ 10.5 MB)

GM-Script-Writer-62850 commented Oct 24, 2015

Thanks, works great, thought i got a couple warning messages, but i think they are unrelated

pi@raspberrypi:/tmp$ ./wkhtmltopdf http://10.0.0.75 ./test.pdf
Fontconfig warning: "/etc/fonts/conf.d/65-droid-sans-fonts.conf", line 103: Having multiple values in <test> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/65-droid-sans-fonts.conf", line 138: Having multiple values in <test> isn't supported and may not work as expected
Loading pages (1/6)
Counting pages (2/6)                                               
Resolving links (4/6)                                                       
Loading headers and footers (5/6)                                           
Printing pages (6/6)
Done   

from that font file:

[snip]
    96    <match target="scan">
    97      <test name="lang" compare="not_eq">
    98        <string>zh-cn</string>
    99        <string>zh-sg</string>
   100        <string>zh-hk</string>
   101        <string>zh-tw</string>
   102        <string>zh</string>
   103      </test>
[snip]
   132      <test name="lang">
   133        <string>zh-cn</string>
   134        <string>zh-sg</string>
   135        <string>zh-hk</string>
   136        <string>zh-tw</string>
   137        <string>zh</string>
   138      </test>
[snip]

I put a copy of the binary file on my pi in a 7z archive if anyone needs it
http://evilkitty.duckdns.org/wkhtmltopdf.7z (~ 10.5 MB)

@half45

This comment has been minimized.

Show comment
Hide comment
@half45

half45 Oct 27, 2015

@tobias-hammerschmidt could you post build instructions?

half45 commented Oct 27, 2015

@tobias-hammerschmidt could you post build instructions?

@tobias-hammerschmidt

This comment has been minimized.

Show comment
Hide comment
@tobias-hammerschmidt

tobias-hammerschmidt Oct 27, 2015

I can give some rough sketch which might act as a base for proper reproducible builds.

Host system

I've cross-compiled wkhtmltopdf on a Fedora 22 64bit. You'll need to install some packages for development (unix tools like sed and so on, gcc, bison, flex, ...) - the dependencies in the build.py script can be used as a reference.

Cross compiler

The cross compiler can be build using crosstools-ng. I've used git revision crosstool-ng/crosstool-ng@8433e99. The target environment (gcc version, glibc version, ...) was based on the package versions available in Raspbian (Jessie). This is my toolchain config:

#
# Automatically generated file; DO NOT EDIT.
# Crosstool-NG Configuration
#
CT_CONFIGURE_has_xz=y
CT_CONFIGURE_has_cvs=y
CT_CONFIGURE_has_svn=y
CT_MODULES=y

#
# Paths and misc options
#

#
# crosstool-NG behavior
#
# CT_OBSOLETE is not set
# CT_EXPERIMENTAL is not set
# CT_DEBUG_CT is not set

#
# Paths
#
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_WORK_DIR="${CT_TOP_DIR}/.build"
CT_PREFIX_DIR="${HOME}/x-tools/${CT_TARGET}"
CT_INSTALL_DIR="${CT_PREFIX_DIR}"
CT_RM_RF_PREFIX_DIR=y
CT_REMOVE_DOCS=y
CT_INSTALL_DIR_RO=y
CT_STRIP_ALL_TOOLCHAIN_EXECUTABLES=y

#
# Downloading
#
# CT_FORBID_DOWNLOAD is not set
# CT_FORCE_DOWNLOAD is not set
CT_CONNECT_TIMEOUT=10
# CT_ONLY_DOWNLOAD is not set
# CT_USE_MIRROR is not set

#
# Extracting
#
# CT_FORCE_EXTRACT is not set
CT_OVERIDE_CONFIG_GUESS_SUB=y
# CT_ONLY_EXTRACT is not set
CT_PATCH_BUNDLED=y
# CT_PATCH_LOCAL is not set
# CT_PATCH_BUNDLED_LOCAL is not set
# CT_PATCH_LOCAL_BUNDLED is not set
# CT_PATCH_BUNDLED_FALLBACK_LOCAL is not set
# CT_PATCH_LOCAL_FALLBACK_BUNDLED is not set
# CT_PATCH_NONE is not set
CT_PATCH_ORDER="bundled"

#
# Build behavior
#
CT_PARALLEL_JOBS=4
CT_LOAD=""
CT_USE_PIPES=y
CT_EXTRA_CFLAGS_FOR_BUILD=""
CT_EXTRA_LDFLAGS_FOR_BUILD=""
CT_EXTRA_CFLAGS_FOR_HOST=""
CT_EXTRA_LDFLAGS_FOR_HOST=""
# CT_CONFIG_SHELL_SH is not set
# CT_CONFIG_SHELL_ASH is not set
CT_CONFIG_SHELL_BASH=y
# CT_CONFIG_SHELL_CUSTOM is not set
CT_CONFIG_SHELL="${bash}"

#
# Logging
#
# CT_LOG_ERROR is not set
# CT_LOG_WARN is not set
# CT_LOG_INFO is not set
CT_LOG_EXTRA=y
# CT_LOG_ALL is not set
# CT_LOG_DEBUG is not set
CT_LOG_LEVEL_MAX="EXTRA"
# CT_LOG_SEE_TOOLS_WARN is not set
CT_LOG_PROGRESS_BAR=y
CT_LOG_TO_FILE=y
CT_LOG_FILE_COMPRESS=y

#
# Target options
#
CT_ARCH="arm"
CT_ARCH_SUPPORTS_BOTH_MMU=y
CT_ARCH_SUPPORTS_BOTH_ENDIAN=y
CT_ARCH_SUPPORTS_32=y
CT_ARCH_SUPPORTS_64=y
CT_ARCH_SUPPORTS_WITH_ARCH=y
CT_ARCH_SUPPORTS_WITH_CPU=y
CT_ARCH_SUPPORTS_WITH_TUNE=y
CT_ARCH_SUPPORTS_WITH_FLOAT=y
CT_ARCH_SUPPORTS_WITH_FPU=y
CT_ARCH_SUPPORTS_SOFTFP=y
CT_ARCH_DEFAULT_HAS_MMU=y
CT_ARCH_DEFAULT_LE=y
CT_ARCH_DEFAULT_32=y
CT_ARCH_CPU="arm1176jzf-s"
CT_ARCH_FPU="vfp"
# CT_ARCH_BE is not set
CT_ARCH_LE=y
CT_ARCH_32=y
# CT_ARCH_64 is not set
CT_ARCH_BITNESS=32
CT_ARCH_FLOAT_HW=y
# CT_ARCH_FLOAT_SW is not set
CT_TARGET_CFLAGS=""
CT_TARGET_LDFLAGS=""
# CT_ARCH_alpha is not set
CT_ARCH_arm=y
# CT_ARCH_avr is not set
# CT_ARCH_avr32 is not set
# CT_ARCH_blackfin is not set
# CT_ARCH_m68k is not set
# CT_ARCH_mips is not set
# CT_ARCH_nios2 is not set
# CT_ARCH_powerpc is not set
# CT_ARCH_s390 is not set
# CT_ARCH_sh is not set
# CT_ARCH_sparc is not set
# CT_ARCH_x86 is not set
CT_ARCH_alpha_AVAILABLE=y
CT_ARCH_arm_AVAILABLE=y
CT_ARCH_avr_AVAILABLE=y
CT_ARCH_avr32_AVAILABLE=y
CT_ARCH_blackfin_AVAILABLE=y
CT_ARCH_m68k_AVAILABLE=y
CT_ARCH_microblaze_AVAILABLE=y
CT_ARCH_mips_AVAILABLE=y
CT_ARCH_nios2_AVAILABLE=y
CT_ARCH_powerpc_AVAILABLE=y
CT_ARCH_s390_AVAILABLE=y
CT_ARCH_sh_AVAILABLE=y
CT_ARCH_sparc_AVAILABLE=y
CT_ARCH_x86_AVAILABLE=y
CT_ARCH_SUFFIX="v6"

#
# Generic target options
#
# CT_MULTILIB is not set
CT_ARCH_USE_MMU=y
CT_ARCH_ENDIAN="little"

#
# Target optimisations
#
# CT_ARCH_FLOAT_AUTO is not set
# CT_ARCH_FLOAT_SOFTFP is not set
CT_ARCH_FLOAT="hard"

#
# arm other options
#
CT_ARCH_ARM_MODE="arm"
CT_ARCH_ARM_MODE_ARM=y
# CT_ARCH_ARM_MODE_THUMB is not set
# CT_ARCH_ARM_INTERWORKING is not set
CT_ARCH_ARM_EABI_FORCE=y
CT_ARCH_ARM_EABI=y
CT_ARCH_ARM_TUPLE_USE_EABIHF=y

#
# Toolchain options
#

#
# General toolchain options
#
CT_FORCE_SYSROOT=y
CT_USE_SYSROOT=y
CT_SYSROOT_NAME="sysroot"
CT_SYSROOT_DIR_PREFIX=""
CT_WANTS_STATIC_LINK=y
# CT_STATIC_TOOLCHAIN is not set
CT_TOOLCHAIN_PKGVERSION=""
CT_TOOLCHAIN_BUGURL=""

#
# Tuple completion and aliasing
#
CT_TARGET_VENDOR="rpi"
CT_TARGET_ALIAS_SED_EXPR=""
CT_TARGET_ALIAS=""

#
# Toolchain type
#
CT_CROSS=y
# CT_CANADIAN is not set
CT_TOOLCHAIN_TYPE="cross"

#
# Build system
#
CT_BUILD=""
CT_BUILD_PREFIX=""
CT_BUILD_SUFFIX=""

#
# Misc options
#
# CT_TOOLCHAIN_ENABLE_NLS is not set

#
# Operating System
#
CT_KERNEL_SUPPORTS_SHARED_LIBS=y
CT_KERNEL="linux"
CT_KERNEL_VERSION="3.12.47"
# CT_KERNEL_bare_metal is not set
CT_KERNEL_linux=y
CT_KERNEL_bare_metal_AVAILABLE=y
CT_KERNEL_linux_AVAILABLE=y
# CT_KERNEL_V_4_2 is not set
# CT_KERNEL_V_4_1 is not set
# CT_KERNEL_V_3_18 is not set
# CT_KERNEL_V_3_14 is not set
CT_KERNEL_V_3_12=y
# CT_KERNEL_V_3_10 is not set
# CT_KERNEL_V_3_4 is not set
# CT_KERNEL_V_3_2 is not set
# CT_KERNEL_V_2_6_32 is not set
# CT_KERNEL_LINUX_CUSTOM is not set
CT_KERNEL_windows_AVAILABLE=y

#
# Common kernel options
#
CT_SHARED_LIBS=y

#
# linux other options
#
CT_KERNEL_LINUX_VERBOSITY_0=y
# CT_KERNEL_LINUX_VERBOSITY_1 is not set
# CT_KERNEL_LINUX_VERBOSITY_2 is not set
CT_KERNEL_LINUX_VERBOSE_LEVEL=0
CT_KERNEL_LINUX_INSTALL_CHECK=y

#
# Binary utilities
#
CT_ARCH_BINFMT_ELF=y
CT_BINUTILS="binutils"
CT_BINUTILS_binutils=y

#
# GNU binutils
#
# CT_CC_BINUTILS_SHOW_LINARO is not set
# CT_BINUTILS_V_2_25_1 is not set
CT_BINUTILS_V_2_25=y
# CT_BINUTILS_V_2_24 is not set
# CT_BINUTILS_V_2_23_2 is not set
# CT_BINUTILS_V_2_23_1 is not set
# CT_BINUTILS_V_2_22 is not set
# CT_BINUTILS_V_2_21_53 is not set
# CT_BINUTILS_V_2_21_1a is not set
# CT_BINUTILS_V_2_20_1a is not set
# CT_BINUTILS_V_2_19_1a is not set
# CT_BINUTILS_V_2_18a is not set
CT_BINUTILS_VERSION="2.25"
CT_BINUTILS_2_25_or_later=y
CT_BINUTILS_2_24_or_later=y
CT_BINUTILS_2_23_or_later=y
CT_BINUTILS_2_22_or_later=y
CT_BINUTILS_2_21_or_later=y
CT_BINUTILS_2_20_or_later=y
CT_BINUTILS_2_19_or_later=y
CT_BINUTILS_2_18_or_later=y
CT_BINUTILS_HAS_HASH_STYLE=y
CT_BINUTILS_HAS_GOLD=y
CT_BINUTILS_GOLD_SUPPORTS_ARCH=y
CT_BINUTILS_HAS_PLUGINS=y
CT_BINUTILS_HAS_PKGVERSION_BUGURL=y
CT_BINUTILS_FORCE_LD_BFD=y
# CT_BINUTILS_LINKER_LD is not set
CT_BINUTILS_LINKER_LD_GOLD=y
# CT_BINUTILS_LINKER_GOLD_LD is not set
CT_BINUTILS_GOLD_INSTALLED=y
CT_BINUTILS_GOLD_THREADS=y
CT_BINUTILS_LINKER_BOTH=y
CT_BINUTILS_LINKERS_LIST="ld,gold"
CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_LINKER_DEFAULT="bfd"
CT_BINUTILS_PLUGINS=y
CT_BINUTILS_EXTRA_CONFIG_ARRAY=""
# CT_BINUTILS_FOR_TARGET is not set

#
# binutils other options
#

#
# C-library
#
CT_LIBC="glibc"
CT_LIBC_VERSION="2.19"
CT_LIBC_glibc=y
# CT_LIBC_musl is not set
# CT_LIBC_uClibc is not set
CT_LIBC_avr_libc_AVAILABLE=y
CT_LIBC_glibc_AVAILABLE=y
CT_THREADS="nptl"
# CT_CC_GLIBC_SHOW_LINARO is not set
# CT_LIBC_GLIBC_V_2_22 is not set
# CT_LIBC_GLIBC_V_2_21 is not set
# CT_LIBC_GLIBC_V_2_20 is not set
CT_LIBC_GLIBC_V_2_19=y
# CT_LIBC_GLIBC_V_2_18 is not set
# CT_LIBC_GLIBC_V_2_17 is not set
# CT_LIBC_GLIBC_V_2_16_0 is not set
# CT_LIBC_GLIBC_V_2_15 is not set
# CT_LIBC_GLIBC_V_2_14_1 is not set
# CT_LIBC_GLIBC_V_2_14 is not set
# CT_LIBC_GLIBC_V_2_13 is not set
# CT_LIBC_GLIBC_V_2_12_2 is not set
# CT_LIBC_GLIBC_V_2_12_1 is not set
# CT_LIBC_GLIBC_V_2_11_1 is not set
# CT_LIBC_GLIBC_V_2_11 is not set
# CT_LIBC_GLIBC_V_2_10_1 is not set
# CT_LIBC_GLIBC_V_2_9 is not set
# CT_LIBC_GLIBC_V_2_8 is not set
CT_LIBC_GLIBC_2_17_or_later=y
CT_LIBC_mingw_AVAILABLE=y
CT_LIBC_musl_AVAILABLE=y
CT_LIBC_newlib_AVAILABLE=y
CT_LIBC_none_AVAILABLE=y
CT_LIBC_uClibc_AVAILABLE=y
CT_LIBC_SUPPORT_THREADS_ANY=y
CT_LIBC_SUPPORT_THREADS_NATIVE=y

#
# Common C library options
#
CT_THREADS_NATIVE=y
CT_LIBC_XLDD=y

#
# glibc other options
#
# CT_LIBC_GLIBC_PORTS_EXTERNAL is not set
CT_LIBC_GLIBC_MAY_FORCE_PORTS=y
CT_LIBC_glibc_familly=y
CT_LIBC_GLIBC_EXTRA_CONFIG_ARRAY=""
CT_LIBC_GLIBC_CONFIGPARMS=""
CT_LIBC_GLIBC_EXTRA_CFLAGS=""
CT_LIBC_EXTRA_CC_ARGS=""
# CT_LIBC_DISABLE_VERSIONING is not set
CT_LIBC_OLDEST_ABI=""
CT_LIBC_GLIBC_FORCE_UNWIND=y
CT_LIBC_GLIBC_USE_PORTS=y
CT_LIBC_ADDONS_LIST=""

#
# WARNING !!!                                            
#

#
#   For glibc >= 2.8, it can happen that the tarballs    
#

#
#   for the addons are not available for download.       
#

#
#   If that happens, bad luck... Try a previous version  
#

#
#   or try again later... :-(                            
#
CT_LIBC_LOCALES=y

#
# WARNING!                                                     
#

#
#   The built locales will be usable if and only if the build  
#

#
#   machine and the target:                                    
#

#
#    - have the same endianness,                               
#

#
#    - and have the same alignment requirements for uint32_t.  
#

#
#   You will have to check by yourself (for now).              
#
# CT_LIBC_GLIBC_KERNEL_VERSION_NONE is not set
# CT_LIBC_GLIBC_KERNEL_VERSION_AS_HEADERS is not set
CT_LIBC_GLIBC_KERNEL_VERSION_CHOSEN=y
CT_LIBC_GLIBC_MIN_KERNEL_VERSION="3.2.27"
CT_LIBC_GLIBC_MIN_KERNEL="3.2.27"

#
# C compiler
#
CT_CC="gcc"
CT_CC_CORE_PASSES_NEEDED=y
CT_CC_CORE_PASS_1_NEEDED=y
CT_CC_CORE_PASS_2_NEEDED=y
CT_CC_gcc=y
CT_CC_GCC_SHOW_LINARO=y
# CT_CC_GCC_V_5_2_0 is not set
# CT_CC_GCC_V_5_1_0 is not set
# CT_CC_GCC_V_linaro_4_9 is not set
# CT_CC_GCC_V_4_9_3 is not set
CT_CC_GCC_V_4_9_2=y
# CT_CC_GCC_V_4_9_1 is not set
# CT_CC_GCC_V_4_9_0 is not set
# CT_CC_GCC_V_linaro_4_8 is not set
# CT_CC_GCC_V_4_8_5 is not set
# CT_CC_GCC_V_4_8_4 is not set
# CT_CC_GCC_V_4_8_3 is not set
# CT_CC_GCC_V_4_8_2 is not set
# CT_CC_GCC_V_4_8_1 is not set
# CT_CC_GCC_V_4_8_0 is not set
# CT_CC_GCC_V_linaro_4_7 is not set
# CT_CC_GCC_V_4_7_4 is not set
# CT_CC_GCC_V_4_7_3 is not set
# CT_CC_GCC_V_4_7_2 is not set
# CT_CC_GCC_V_4_7_1 is not set
# CT_CC_GCC_V_4_7_0 is not set
# CT_CC_GCC_V_linaro_4_6 is not set
# CT_CC_GCC_V_4_6_4 is not set
# CT_CC_GCC_V_4_6_3 is not set
# CT_CC_GCC_V_4_6_2 is not set
# CT_CC_GCC_V_4_6_1 is not set
# CT_CC_GCC_V_4_6_0 is not set
# CT_CC_GCC_V_linaro_4_5 is not set
# CT_CC_GCC_V_4_5_3 is not set
# CT_CC_GCC_V_4_5_2 is not set
# CT_CC_GCC_V_4_5_1 is not set
# CT_CC_GCC_V_4_5_0 is not set
# CT_CC_GCC_V_linaro_4_4 is not set
# CT_CC_GCC_V_4_4_7 is not set
# CT_CC_GCC_V_4_4_6 is not set
# CT_CC_GCC_V_4_4_5 is not set
# CT_CC_GCC_V_4_4_4 is not set
# CT_CC_GCC_V_4_4_3 is not set
# CT_CC_GCC_V_4_4_2 is not set
# CT_CC_GCC_V_4_4_1 is not set
# CT_CC_GCC_V_4_4_0 is not set
# CT_CC_GCC_V_4_3_6 is not set
# CT_CC_GCC_V_4_3_5 is not set
# CT_CC_GCC_V_4_3_4 is not set
# CT_CC_GCC_V_4_3_3 is not set
# CT_CC_GCC_V_4_3_2 is not set
# CT_CC_GCC_V_4_3_1 is not set
# CT_CC_GCC_V_4_2_4 is not set
# CT_CC_GCC_V_4_2_2 is not set
CT_CC_GCC_4_2_or_later=y
CT_CC_GCC_4_3_or_later=y
CT_CC_GCC_4_4_or_later=y
CT_CC_GCC_4_5_or_later=y
CT_CC_GCC_4_6_or_later=y
CT_CC_GCC_4_7_or_later=y
CT_CC_GCC_4_8_or_later=y
CT_CC_GCC_4_9=y
CT_CC_GCC_4_9_or_later=y
CT_CC_GCC_HAS_GRAPHITE=y
CT_CC_GCC_USE_GRAPHITE=y
CT_CC_GCC_HAS_LTO=y
CT_CC_GCC_USE_LTO=y
CT_CC_GCC_HAS_PKGVERSION_BUGURL=y
CT_CC_GCC_HAS_BUILD_ID=y
CT_CC_GCC_HAS_LNK_HASH_STYLE=y
CT_CC_GCC_ENABLE_PLUGINS=y
CT_CC_GCC_GOLD=y
CT_CC_GCC_USE_GMP_MPFR=y
CT_CC_GCC_USE_MPC=y
CT_CC_GCC_HAS_LIBQUADMATH=y
CT_CC_GCC_HAS_LIBSANITIZER=y
CT_CC_GCC_VERSION="4.9.2"
# CT_CC_LANG_FORTRAN is not set
CT_CC_GCC_ENABLE_CXX_FLAGS=""
CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY=""
CT_CC_GCC_EXTRA_CONFIG_ARRAY=""
CT_CC_GCC_EXTRA_ENV_ARRAY=""
CT_CC_GCC_STATIC_LIBSTDCXX=y
# CT_CC_GCC_SYSTEM_ZLIB is not set

#
# Optimisation features
#

#
# Settings for libraries running on target
#
CT_CC_GCC_ENABLE_TARGET_OPTSPACE=y
# CT_CC_GCC_LIBMUDFLAP is not set
# CT_CC_GCC_LIBGOMP is not set
# CT_CC_GCC_LIBSSP is not set
# CT_CC_GCC_LIBQUADMATH is not set
# CT_CC_GCC_LIBSANITIZER is not set

#
# Misc. obscure options.
#
CT_CC_CXA_ATEXIT=y
CT_CC_GCC_DISABLE_PCH=y
CT_CC_GCC_SJLJ_EXCEPTIONS=m
CT_CC_GCC_LDBL_128=m
CT_CC_GCC_BUILD_ID=y
# CT_CC_GCC_LNK_HASH_STYLE_DEFAULT is not set
# CT_CC_GCC_LNK_HASH_STYLE_SYSV is not set
# CT_CC_GCC_LNK_HASH_STYLE_GNU is not set
CT_CC_GCC_LNK_HASH_STYLE_BOTH=y
CT_CC_GCC_LNK_HASH_STYLE="both"
CT_CC_GCC_DEC_FLOAT_AUTO=y
# CT_CC_GCC_DEC_FLOAT_BID is not set
# CT_CC_GCC_DEC_FLOAT_DPD is not set
# CT_CC_GCC_DEC_FLOATS_NO is not set
CT_CC_SUPPORT_CXX=y
CT_CC_SUPPORT_FORTRAN=y
CT_CC_SUPPORT_JAVA=y
CT_CC_SUPPORT_ADA=y
CT_CC_SUPPORT_OBJC=y
CT_CC_SUPPORT_OBJCXX=y
CT_CC_SUPPORT_GOLANG=y

#
# Additional supported languages:
#
CT_CC_LANG_CXX=y
# CT_CC_LANG_JAVA is not set

#
# Debug facilities
#
# CT_DEBUG_dmalloc is not set
# CT_DEBUG_duma is not set
CT_DEBUG_gdb=y
CT_GDB_CROSS=y
# CT_GDB_CROSS_STATIC is not set
# CT_GDB_CROSS_SIM is not set
# CT_GDB_CROSS_PYTHON is not set
CT_GDB_CROSS_EXTRA_CONFIG_ARRAY=""
# CT_GDB_NATIVE is not set
CT_GDB_GDBSERVER=y
CT_GDB_GDBSERVER_HAS_IPA_LIB=y
CT_GDB_GDBSERVER_STATIC=y

#
# gdb version
#
# CT_DEBUG_GDB_SHOW_LINARO is not set
CT_GDB_V_7_10=y
# CT_GDB_V_7_9_1 is not set
# CT_GDB_V_7_9 is not set
# CT_GDB_V_7_8_2 is not set
# CT_GDB_V_7_8_1 is not set
# CT_GDB_V_7_8 is not set
# CT_GDB_V_7_7_1 is not set
# CT_GDB_V_7_7 is not set
# CT_GDB_V_7_6_1 is not set
# CT_GDB_V_7_5_1 is not set
# CT_GDB_V_7_4_1 is not set
# CT_GDB_V_7_4 is not set
# CT_GDB_V_7_3_1 is not set
# CT_GDB_V_7_3a is not set
# CT_GDB_V_7_2a is not set
# CT_GDB_V_7_1a is not set
# CT_GDB_V_7_0_1a is not set
# CT_GDB_V_7_0a is not set
# CT_GDB_V_6_8a is not set
CT_GDB_7_2_or_later=y
CT_GDB_7_0_or_later=y
CT_GDB_HAS_PKGVERSION_BUGURL=y
CT_GDB_HAS_PYTHON=y
CT_GDB_INSTALL_GDBINIT=y
CT_GDB_VERSION="7.10"
# CT_DEBUG_ltrace is not set
# CT_DEBUG_strace is not set

#
# Companion libraries
#
CT_COMPLIBS_NEEDED=y
CT_GMP_NEEDED=y
CT_MPFR_NEEDED=y
CT_ISL_NEEDED=y
CT_CLOOG_NEEDED=y
CT_MPC_NEEDED=y
CT_COMPLIBS=y
CT_GMP=y
CT_MPFR=y
CT_ISL=y
CT_CLOOG=y
CT_MPC=y
CT_GMP_V_6_0_0=y
# CT_GMP_V_5_1_3 is not set
# CT_GMP_V_5_1_1 is not set
# CT_GMP_V_5_0_2 is not set
# CT_GMP_V_5_0_1 is not set
# CT_GMP_V_4_3_2 is not set
# CT_GMP_V_4_3_1 is not set
# CT_GMP_V_4_3_0 is not set
CT_GMP_5_0_2_or_later=y
CT_GMP_VERSION="6.0.0a"
# CT_MPFR_V_3_1_3 is not set
CT_MPFR_V_3_1_2=y
# CT_MPFR_V_3_1_0 is not set
# CT_MPFR_V_3_0_1 is not set
# CT_MPFR_V_3_0_0 is not set
# CT_MPFR_V_2_4_2 is not set
# CT_MPFR_V_2_4_1 is not set
# CT_MPFR_V_2_4_0 is not set
CT_MPFR_VERSION="3.1.2"
CT_ISL_V_0_12_2=y
# CT_ISL_V_0_11_1 is not set
CT_ISL_V_0_12_or_later=y
CT_ISL_VERSION="0.12.2"
# CT_CLOOG_V_0_18_4 is not set
CT_CLOOG_V_0_18_1=y
# CT_CLOOG_V_0_18_0 is not set
CT_CLOOG_VERSION="0.18.1"
CT_CLOOG_0_18_or_later=y
# CT_MPC_V_1_0_3 is not set
CT_MPC_V_1_0_2=y
# CT_MPC_V_1_0_1 is not set
# CT_MPC_V_1_0 is not set
# CT_MPC_V_0_9 is not set
# CT_MPC_V_0_8_2 is not set
# CT_MPC_V_0_8_1 is not set
# CT_MPC_V_0_7 is not set
CT_MPC_VERSION="1.0.2"

#
# Companion libraries common options
#
# CT_COMPLIBS_CHECK is not set

#
# Companion tools
#

#
# READ HELP before you say 'Y' below !!!
#
# CT_COMP_TOOLS is not set

Build dependencies

Since I didn't want to build all dependencies and my target platform was Raspbian anyway I created a local debian environment. For this I used debootstrap to create a minimal 64 bit Debian Jessie in some folder. Using systemd-nspawn I logged into the system and added the Raspbian repository to the apt sources. By running dpkg --add-architecture armhf I enabled the system to also install the arm packages from the Raspbian repository (I still had to use apt-get download and dpkg -x for downloading and extracting the arm packages). Now the development packages and libraries could be downloaded. I also moved some libraries around and corrected some symbolic links most notably the libz.so which was located somewhere in /lib while most libraries were below /usr/lib. This was solely to ease the maintenance since all libraries would be in one folder (originally I wanted to use the overlay filesystem support in systemd-nspawn and build directly in the debian container but the version of the systemd package in Fedora 22 didn't have that feature).

Build environment

I've put together a small script to prepare the cross build environment. Most notably that prepends the cross compiler bin folder to the PATH and configures QEMU to pick up the libraries from the cross compiler when running arm binaries.

#!/bin/bash

__path_add $HOME/x-tools/armv6-rpi-linux-gnueabihf/bin
export QEMU_LD_PREFIX=$HOME/x-tools/armv6-rpi-linux-gnueabihf/armv6-rpi-linux-gnueabihf/sysroot
export PKG_CONFIG_SYSROOT_DIR=$HOME/x-tools/armv6-rpi-linux-gnueabihf/armv6-rpi-linux-gnueabihf/sysroot

The QEMU_LD_PREFIX is important here since the qt build will build qmake (and the other binaries) for arm. Since the compiled qmake is used for the following build steps you need to enable your host system to run arm binaries (just google for binfmt and arm). I also ended up to copy the libz.so from raspbian to the sysroot lib folder of the cross compiler because my final build linked dynamically against libz and otherwise the cross compiled moc binary failed to start.

Build

I've compiled 8f03630. First 2 changes are required in the qt folder:

1 qt/mkspecs/linux-arm-gnueabi-g++/qmake.conf

#
# qmake configuration for building with arm-linux-gnueabi-g++
#

MAKEFILE_GENERATOR      = UNIX
TARGET_PLATFORM         = unix
TEMPLATE                = app
CONFIG                  += qt warn_on release incremental link_prl gdb_dwarf_index
QT                      += core gui
QMAKE_INCREMENTAL_STYLE = sublib

include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)

# modifications to g++.conf
QMAKE_CC                = armv6-rpi-linux-gnueabihf-gcc
QMAKE_CXX               = armv6-rpi-linux-gnueabihf-g++
QMAKE_LINK              = armv6-rpi-linux-gnueabihf-g++
QMAKE_LINK_SHLIB        = armv6-rpi-linux-gnueabihf-g++

# modifications to linux.conf
QMAKE_AR                = armv6-rpi-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY           = armv6-rpi-linux-gnueabihf-objcopy
QMAKE_STRIP             = armv6-rpi-linux-gnueabihf-strip

QMAKE_INCDIR        = <debian-container>/usr/include/arm-linux-gnueabihf <debian-container>/usr/include
QMAKE_LIBDIR        = <debian-container>/usr/lib/arm-linux-gnueabihf

QMAKE_LFLAGS       += -Wl,-rpath-link,<debian-container>/usr/lib/arm-linux-gnueabihf

QMAKE_TARGET.arch   = armv6

load(qt_config)

Basically this configures qt compilation to use our cross compiler and the rasbpian headers and libraries. The -rpath-link is required because otherwise some of the X11 related config tests are failing.

2 qt/config.tests/unix/freetype/freetype.pri

!cross_compile {
    TRY_INCLUDEPATHS = $$QMAKE_INCDIR $$QMAKE_INCDIR_X11 $$INCLUDEPATH
    # LSB doesn't allow using headers from /include or /usr/include
    linux-lsb-g++:TRY_INCLUDEPATHS = $$QMAKE_INCDIR $$QMAKE_INCDIR_X11 $$INCLUDEPATH
    for(p, TRY_INCLUDEPATHS) {
        p = $$join(p, "", "", "/freetype2")
        exists($$p):INCLUDEPATH *= $$p
    }
}

Basically I removed the hardcoded /include and /usr/include entries from TRY_INCLUDEPATHS since otherwise the build picked up headers from the host system which caused for instance failing of the fontconfig test. After that I've run the usual configure make and make install (based on the build.py script). You need to add the flags -platform linux-arm-gnueabi-g++ and -arch armv6 to the configure run.

Guess with some more love and work this can be turned into some nice automated build ;-)

tobias-hammerschmidt commented Oct 27, 2015

I can give some rough sketch which might act as a base for proper reproducible builds.

Host system

I've cross-compiled wkhtmltopdf on a Fedora 22 64bit. You'll need to install some packages for development (unix tools like sed and so on, gcc, bison, flex, ...) - the dependencies in the build.py script can be used as a reference.

Cross compiler

The cross compiler can be build using crosstools-ng. I've used git revision crosstool-ng/crosstool-ng@8433e99. The target environment (gcc version, glibc version, ...) was based on the package versions available in Raspbian (Jessie). This is my toolchain config:

#
# Automatically generated file; DO NOT EDIT.
# Crosstool-NG Configuration
#
CT_CONFIGURE_has_xz=y
CT_CONFIGURE_has_cvs=y
CT_CONFIGURE_has_svn=y
CT_MODULES=y

#
# Paths and misc options
#

#
# crosstool-NG behavior
#
# CT_OBSOLETE is not set
# CT_EXPERIMENTAL is not set
# CT_DEBUG_CT is not set

#
# Paths
#
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_WORK_DIR="${CT_TOP_DIR}/.build"
CT_PREFIX_DIR="${HOME}/x-tools/${CT_TARGET}"
CT_INSTALL_DIR="${CT_PREFIX_DIR}"
CT_RM_RF_PREFIX_DIR=y
CT_REMOVE_DOCS=y
CT_INSTALL_DIR_RO=y
CT_STRIP_ALL_TOOLCHAIN_EXECUTABLES=y

#
# Downloading
#
# CT_FORBID_DOWNLOAD is not set
# CT_FORCE_DOWNLOAD is not set
CT_CONNECT_TIMEOUT=10
# CT_ONLY_DOWNLOAD is not set
# CT_USE_MIRROR is not set

#
# Extracting
#
# CT_FORCE_EXTRACT is not set
CT_OVERIDE_CONFIG_GUESS_SUB=y
# CT_ONLY_EXTRACT is not set
CT_PATCH_BUNDLED=y
# CT_PATCH_LOCAL is not set
# CT_PATCH_BUNDLED_LOCAL is not set
# CT_PATCH_LOCAL_BUNDLED is not set
# CT_PATCH_BUNDLED_FALLBACK_LOCAL is not set
# CT_PATCH_LOCAL_FALLBACK_BUNDLED is not set
# CT_PATCH_NONE is not set
CT_PATCH_ORDER="bundled"

#
# Build behavior
#
CT_PARALLEL_JOBS=4
CT_LOAD=""
CT_USE_PIPES=y
CT_EXTRA_CFLAGS_FOR_BUILD=""
CT_EXTRA_LDFLAGS_FOR_BUILD=""
CT_EXTRA_CFLAGS_FOR_HOST=""
CT_EXTRA_LDFLAGS_FOR_HOST=""
# CT_CONFIG_SHELL_SH is not set
# CT_CONFIG_SHELL_ASH is not set
CT_CONFIG_SHELL_BASH=y
# CT_CONFIG_SHELL_CUSTOM is not set
CT_CONFIG_SHELL="${bash}"

#
# Logging
#
# CT_LOG_ERROR is not set
# CT_LOG_WARN is not set
# CT_LOG_INFO is not set
CT_LOG_EXTRA=y
# CT_LOG_ALL is not set
# CT_LOG_DEBUG is not set
CT_LOG_LEVEL_MAX="EXTRA"
# CT_LOG_SEE_TOOLS_WARN is not set
CT_LOG_PROGRESS_BAR=y
CT_LOG_TO_FILE=y
CT_LOG_FILE_COMPRESS=y

#
# Target options
#
CT_ARCH="arm"
CT_ARCH_SUPPORTS_BOTH_MMU=y
CT_ARCH_SUPPORTS_BOTH_ENDIAN=y
CT_ARCH_SUPPORTS_32=y
CT_ARCH_SUPPORTS_64=y
CT_ARCH_SUPPORTS_WITH_ARCH=y
CT_ARCH_SUPPORTS_WITH_CPU=y
CT_ARCH_SUPPORTS_WITH_TUNE=y
CT_ARCH_SUPPORTS_WITH_FLOAT=y
CT_ARCH_SUPPORTS_WITH_FPU=y
CT_ARCH_SUPPORTS_SOFTFP=y
CT_ARCH_DEFAULT_HAS_MMU=y
CT_ARCH_DEFAULT_LE=y
CT_ARCH_DEFAULT_32=y
CT_ARCH_CPU="arm1176jzf-s"
CT_ARCH_FPU="vfp"
# CT_ARCH_BE is not set
CT_ARCH_LE=y
CT_ARCH_32=y
# CT_ARCH_64 is not set
CT_ARCH_BITNESS=32
CT_ARCH_FLOAT_HW=y
# CT_ARCH_FLOAT_SW is not set
CT_TARGET_CFLAGS=""
CT_TARGET_LDFLAGS=""
# CT_ARCH_alpha is not set
CT_ARCH_arm=y
# CT_ARCH_avr is not set
# CT_ARCH_avr32 is not set
# CT_ARCH_blackfin is not set
# CT_ARCH_m68k is not set
# CT_ARCH_mips is not set
# CT_ARCH_nios2 is not set
# CT_ARCH_powerpc is not set
# CT_ARCH_s390 is not set
# CT_ARCH_sh is not set
# CT_ARCH_sparc is not set
# CT_ARCH_x86 is not set
CT_ARCH_alpha_AVAILABLE=y
CT_ARCH_arm_AVAILABLE=y
CT_ARCH_avr_AVAILABLE=y
CT_ARCH_avr32_AVAILABLE=y
CT_ARCH_blackfin_AVAILABLE=y
CT_ARCH_m68k_AVAILABLE=y
CT_ARCH_microblaze_AVAILABLE=y
CT_ARCH_mips_AVAILABLE=y
CT_ARCH_nios2_AVAILABLE=y
CT_ARCH_powerpc_AVAILABLE=y
CT_ARCH_s390_AVAILABLE=y
CT_ARCH_sh_AVAILABLE=y
CT_ARCH_sparc_AVAILABLE=y
CT_ARCH_x86_AVAILABLE=y
CT_ARCH_SUFFIX="v6"

#
# Generic target options
#
# CT_MULTILIB is not set
CT_ARCH_USE_MMU=y
CT_ARCH_ENDIAN="little"

#
# Target optimisations
#
# CT_ARCH_FLOAT_AUTO is not set
# CT_ARCH_FLOAT_SOFTFP is not set
CT_ARCH_FLOAT="hard"

#
# arm other options
#
CT_ARCH_ARM_MODE="arm"
CT_ARCH_ARM_MODE_ARM=y
# CT_ARCH_ARM_MODE_THUMB is not set
# CT_ARCH_ARM_INTERWORKING is not set
CT_ARCH_ARM_EABI_FORCE=y
CT_ARCH_ARM_EABI=y
CT_ARCH_ARM_TUPLE_USE_EABIHF=y

#
# Toolchain options
#

#
# General toolchain options
#
CT_FORCE_SYSROOT=y
CT_USE_SYSROOT=y
CT_SYSROOT_NAME="sysroot"
CT_SYSROOT_DIR_PREFIX=""
CT_WANTS_STATIC_LINK=y
# CT_STATIC_TOOLCHAIN is not set
CT_TOOLCHAIN_PKGVERSION=""
CT_TOOLCHAIN_BUGURL=""

#
# Tuple completion and aliasing
#
CT_TARGET_VENDOR="rpi"
CT_TARGET_ALIAS_SED_EXPR=""
CT_TARGET_ALIAS=""

#
# Toolchain type
#
CT_CROSS=y
# CT_CANADIAN is not set
CT_TOOLCHAIN_TYPE="cross"

#
# Build system
#
CT_BUILD=""
CT_BUILD_PREFIX=""
CT_BUILD_SUFFIX=""

#
# Misc options
#
# CT_TOOLCHAIN_ENABLE_NLS is not set

#
# Operating System
#
CT_KERNEL_SUPPORTS_SHARED_LIBS=y
CT_KERNEL="linux"
CT_KERNEL_VERSION="3.12.47"
# CT_KERNEL_bare_metal is not set
CT_KERNEL_linux=y
CT_KERNEL_bare_metal_AVAILABLE=y
CT_KERNEL_linux_AVAILABLE=y
# CT_KERNEL_V_4_2 is not set
# CT_KERNEL_V_4_1 is not set
# CT_KERNEL_V_3_18 is not set
# CT_KERNEL_V_3_14 is not set
CT_KERNEL_V_3_12=y
# CT_KERNEL_V_3_10 is not set
# CT_KERNEL_V_3_4 is not set
# CT_KERNEL_V_3_2 is not set
# CT_KERNEL_V_2_6_32 is not set
# CT_KERNEL_LINUX_CUSTOM is not set
CT_KERNEL_windows_AVAILABLE=y

#
# Common kernel options
#
CT_SHARED_LIBS=y

#
# linux other options
#
CT_KERNEL_LINUX_VERBOSITY_0=y
# CT_KERNEL_LINUX_VERBOSITY_1 is not set
# CT_KERNEL_LINUX_VERBOSITY_2 is not set
CT_KERNEL_LINUX_VERBOSE_LEVEL=0
CT_KERNEL_LINUX_INSTALL_CHECK=y

#
# Binary utilities
#
CT_ARCH_BINFMT_ELF=y
CT_BINUTILS="binutils"
CT_BINUTILS_binutils=y

#
# GNU binutils
#
# CT_CC_BINUTILS_SHOW_LINARO is not set
# CT_BINUTILS_V_2_25_1 is not set
CT_BINUTILS_V_2_25=y
# CT_BINUTILS_V_2_24 is not set
# CT_BINUTILS_V_2_23_2 is not set
# CT_BINUTILS_V_2_23_1 is not set
# CT_BINUTILS_V_2_22 is not set
# CT_BINUTILS_V_2_21_53 is not set
# CT_BINUTILS_V_2_21_1a is not set
# CT_BINUTILS_V_2_20_1a is not set
# CT_BINUTILS_V_2_19_1a is not set
# CT_BINUTILS_V_2_18a is not set
CT_BINUTILS_VERSION="2.25"
CT_BINUTILS_2_25_or_later=y
CT_BINUTILS_2_24_or_later=y
CT_BINUTILS_2_23_or_later=y
CT_BINUTILS_2_22_or_later=y
CT_BINUTILS_2_21_or_later=y
CT_BINUTILS_2_20_or_later=y
CT_BINUTILS_2_19_or_later=y
CT_BINUTILS_2_18_or_later=y
CT_BINUTILS_HAS_HASH_STYLE=y
CT_BINUTILS_HAS_GOLD=y
CT_BINUTILS_GOLD_SUPPORTS_ARCH=y
CT_BINUTILS_HAS_PLUGINS=y
CT_BINUTILS_HAS_PKGVERSION_BUGURL=y
CT_BINUTILS_FORCE_LD_BFD=y
# CT_BINUTILS_LINKER_LD is not set
CT_BINUTILS_LINKER_LD_GOLD=y
# CT_BINUTILS_LINKER_GOLD_LD is not set
CT_BINUTILS_GOLD_INSTALLED=y
CT_BINUTILS_GOLD_THREADS=y
CT_BINUTILS_LINKER_BOTH=y
CT_BINUTILS_LINKERS_LIST="ld,gold"
CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_LINKER_DEFAULT="bfd"
CT_BINUTILS_PLUGINS=y
CT_BINUTILS_EXTRA_CONFIG_ARRAY=""
# CT_BINUTILS_FOR_TARGET is not set

#
# binutils other options
#

#
# C-library
#
CT_LIBC="glibc"
CT_LIBC_VERSION="2.19"
CT_LIBC_glibc=y
# CT_LIBC_musl is not set
# CT_LIBC_uClibc is not set
CT_LIBC_avr_libc_AVAILABLE=y
CT_LIBC_glibc_AVAILABLE=y
CT_THREADS="nptl"
# CT_CC_GLIBC_SHOW_LINARO is not set
# CT_LIBC_GLIBC_V_2_22 is not set
# CT_LIBC_GLIBC_V_2_21 is not set
# CT_LIBC_GLIBC_V_2_20 is not set
CT_LIBC_GLIBC_V_2_19=y
# CT_LIBC_GLIBC_V_2_18 is not set
# CT_LIBC_GLIBC_V_2_17 is not set
# CT_LIBC_GLIBC_V_2_16_0 is not set
# CT_LIBC_GLIBC_V_2_15 is not set
# CT_LIBC_GLIBC_V_2_14_1 is not set
# CT_LIBC_GLIBC_V_2_14 is not set
# CT_LIBC_GLIBC_V_2_13 is not set
# CT_LIBC_GLIBC_V_2_12_2 is not set
# CT_LIBC_GLIBC_V_2_12_1 is not set
# CT_LIBC_GLIBC_V_2_11_1 is not set
# CT_LIBC_GLIBC_V_2_11 is not set
# CT_LIBC_GLIBC_V_2_10_1 is not set
# CT_LIBC_GLIBC_V_2_9 is not set
# CT_LIBC_GLIBC_V_2_8 is not set
CT_LIBC_GLIBC_2_17_or_later=y
CT_LIBC_mingw_AVAILABLE=y
CT_LIBC_musl_AVAILABLE=y
CT_LIBC_newlib_AVAILABLE=y
CT_LIBC_none_AVAILABLE=y
CT_LIBC_uClibc_AVAILABLE=y
CT_LIBC_SUPPORT_THREADS_ANY=y
CT_LIBC_SUPPORT_THREADS_NATIVE=y

#
# Common C library options
#
CT_THREADS_NATIVE=y
CT_LIBC_XLDD=y

#
# glibc other options
#
# CT_LIBC_GLIBC_PORTS_EXTERNAL is not set
CT_LIBC_GLIBC_MAY_FORCE_PORTS=y
CT_LIBC_glibc_familly=y
CT_LIBC_GLIBC_EXTRA_CONFIG_ARRAY=""
CT_LIBC_GLIBC_CONFIGPARMS=""
CT_LIBC_GLIBC_EXTRA_CFLAGS=""
CT_LIBC_EXTRA_CC_ARGS=""
# CT_LIBC_DISABLE_VERSIONING is not set
CT_LIBC_OLDEST_ABI=""
CT_LIBC_GLIBC_FORCE_UNWIND=y
CT_LIBC_GLIBC_USE_PORTS=y
CT_LIBC_ADDONS_LIST=""

#
# WARNING !!!                                            
#

#
#   For glibc >= 2.8, it can happen that the tarballs    
#

#
#   for the addons are not available for download.       
#

#
#   If that happens, bad luck... Try a previous version  
#

#
#   or try again later... :-(                            
#
CT_LIBC_LOCALES=y

#
# WARNING!                                                     
#

#
#   The built locales will be usable if and only if the build  
#

#
#   machine and the target:                                    
#

#
#    - have the same endianness,                               
#

#
#    - and have the same alignment requirements for uint32_t.  
#

#
#   You will have to check by yourself (for now).              
#
# CT_LIBC_GLIBC_KERNEL_VERSION_NONE is not set
# CT_LIBC_GLIBC_KERNEL_VERSION_AS_HEADERS is not set
CT_LIBC_GLIBC_KERNEL_VERSION_CHOSEN=y
CT_LIBC_GLIBC_MIN_KERNEL_VERSION="3.2.27"
CT_LIBC_GLIBC_MIN_KERNEL="3.2.27"

#
# C compiler
#
CT_CC="gcc"
CT_CC_CORE_PASSES_NEEDED=y
CT_CC_CORE_PASS_1_NEEDED=y
CT_CC_CORE_PASS_2_NEEDED=y
CT_CC_gcc=y
CT_CC_GCC_SHOW_LINARO=y
# CT_CC_GCC_V_5_2_0 is not set
# CT_CC_GCC_V_5_1_0 is not set
# CT_CC_GCC_V_linaro_4_9 is not set
# CT_CC_GCC_V_4_9_3 is not set
CT_CC_GCC_V_4_9_2=y
# CT_CC_GCC_V_4_9_1 is not set
# CT_CC_GCC_V_4_9_0 is not set
# CT_CC_GCC_V_linaro_4_8 is not set
# CT_CC_GCC_V_4_8_5 is not set
# CT_CC_GCC_V_4_8_4 is not set
# CT_CC_GCC_V_4_8_3 is not set
# CT_CC_GCC_V_4_8_2 is not set
# CT_CC_GCC_V_4_8_1 is not set
# CT_CC_GCC_V_4_8_0 is not set
# CT_CC_GCC_V_linaro_4_7 is not set
# CT_CC_GCC_V_4_7_4 is not set
# CT_CC_GCC_V_4_7_3 is not set
# CT_CC_GCC_V_4_7_2 is not set
# CT_CC_GCC_V_4_7_1 is not set
# CT_CC_GCC_V_4_7_0 is not set
# CT_CC_GCC_V_linaro_4_6 is not set
# CT_CC_GCC_V_4_6_4 is not set
# CT_CC_GCC_V_4_6_3 is not set
# CT_CC_GCC_V_4_6_2 is not set
# CT_CC_GCC_V_4_6_1 is not set
# CT_CC_GCC_V_4_6_0 is not set
# CT_CC_GCC_V_linaro_4_5 is not set
# CT_CC_GCC_V_4_5_3 is not set
# CT_CC_GCC_V_4_5_2 is not set
# CT_CC_GCC_V_4_5_1 is not set
# CT_CC_GCC_V_4_5_0 is not set
# CT_CC_GCC_V_linaro_4_4 is not set
# CT_CC_GCC_V_4_4_7 is not set
# CT_CC_GCC_V_4_4_6 is not set
# CT_CC_GCC_V_4_4_5 is not set
# CT_CC_GCC_V_4_4_4 is not set
# CT_CC_GCC_V_4_4_3 is not set
# CT_CC_GCC_V_4_4_2 is not set
# CT_CC_GCC_V_4_4_1 is not set
# CT_CC_GCC_V_4_4_0 is not set
# CT_CC_GCC_V_4_3_6 is not set
# CT_CC_GCC_V_4_3_5 is not set
# CT_CC_GCC_V_4_3_4 is not set
# CT_CC_GCC_V_4_3_3 is not set
# CT_CC_GCC_V_4_3_2 is not set
# CT_CC_GCC_V_4_3_1 is not set
# CT_CC_GCC_V_4_2_4 is not set
# CT_CC_GCC_V_4_2_2 is not set
CT_CC_GCC_4_2_or_later=y
CT_CC_GCC_4_3_or_later=y
CT_CC_GCC_4_4_or_later=y
CT_CC_GCC_4_5_or_later=y
CT_CC_GCC_4_6_or_later=y
CT_CC_GCC_4_7_or_later=y
CT_CC_GCC_4_8_or_later=y
CT_CC_GCC_4_9=y
CT_CC_GCC_4_9_or_later=y
CT_CC_GCC_HAS_GRAPHITE=y
CT_CC_GCC_USE_GRAPHITE=y
CT_CC_GCC_HAS_LTO=y
CT_CC_GCC_USE_LTO=y
CT_CC_GCC_HAS_PKGVERSION_BUGURL=y
CT_CC_GCC_HAS_BUILD_ID=y
CT_CC_GCC_HAS_LNK_HASH_STYLE=y
CT_CC_GCC_ENABLE_PLUGINS=y
CT_CC_GCC_GOLD=y
CT_CC_GCC_USE_GMP_MPFR=y
CT_CC_GCC_USE_MPC=y
CT_CC_GCC_HAS_LIBQUADMATH=y
CT_CC_GCC_HAS_LIBSANITIZER=y
CT_CC_GCC_VERSION="4.9.2"
# CT_CC_LANG_FORTRAN is not set
CT_CC_GCC_ENABLE_CXX_FLAGS=""
CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY=""
CT_CC_GCC_EXTRA_CONFIG_ARRAY=""
CT_CC_GCC_EXTRA_ENV_ARRAY=""
CT_CC_GCC_STATIC_LIBSTDCXX=y
# CT_CC_GCC_SYSTEM_ZLIB is not set

#
# Optimisation features
#

#
# Settings for libraries running on target
#
CT_CC_GCC_ENABLE_TARGET_OPTSPACE=y
# CT_CC_GCC_LIBMUDFLAP is not set
# CT_CC_GCC_LIBGOMP is not set
# CT_CC_GCC_LIBSSP is not set
# CT_CC_GCC_LIBQUADMATH is not set
# CT_CC_GCC_LIBSANITIZER is not set

#
# Misc. obscure options.
#
CT_CC_CXA_ATEXIT=y
CT_CC_GCC_DISABLE_PCH=y
CT_CC_GCC_SJLJ_EXCEPTIONS=m
CT_CC_GCC_LDBL_128=m
CT_CC_GCC_BUILD_ID=y
# CT_CC_GCC_LNK_HASH_STYLE_DEFAULT is not set
# CT_CC_GCC_LNK_HASH_STYLE_SYSV is not set
# CT_CC_GCC_LNK_HASH_STYLE_GNU is not set
CT_CC_GCC_LNK_HASH_STYLE_BOTH=y
CT_CC_GCC_LNK_HASH_STYLE="both"
CT_CC_GCC_DEC_FLOAT_AUTO=y
# CT_CC_GCC_DEC_FLOAT_BID is not set
# CT_CC_GCC_DEC_FLOAT_DPD is not set
# CT_CC_GCC_DEC_FLOATS_NO is not set
CT_CC_SUPPORT_CXX=y
CT_CC_SUPPORT_FORTRAN=y
CT_CC_SUPPORT_JAVA=y
CT_CC_SUPPORT_ADA=y
CT_CC_SUPPORT_OBJC=y
CT_CC_SUPPORT_OBJCXX=y
CT_CC_SUPPORT_GOLANG=y

#
# Additional supported languages:
#
CT_CC_LANG_CXX=y
# CT_CC_LANG_JAVA is not set

#
# Debug facilities
#
# CT_DEBUG_dmalloc is not set
# CT_DEBUG_duma is not set
CT_DEBUG_gdb=y
CT_GDB_CROSS=y
# CT_GDB_CROSS_STATIC is not set
# CT_GDB_CROSS_SIM is not set
# CT_GDB_CROSS_PYTHON is not set
CT_GDB_CROSS_EXTRA_CONFIG_ARRAY=""
# CT_GDB_NATIVE is not set
CT_GDB_GDBSERVER=y
CT_GDB_GDBSERVER_HAS_IPA_LIB=y
CT_GDB_GDBSERVER_STATIC=y

#
# gdb version
#
# CT_DEBUG_GDB_SHOW_LINARO is not set
CT_GDB_V_7_10=y
# CT_GDB_V_7_9_1 is not set
# CT_GDB_V_7_9 is not set
# CT_GDB_V_7_8_2 is not set
# CT_GDB_V_7_8_1 is not set
# CT_GDB_V_7_8 is not set
# CT_GDB_V_7_7_1 is not set
# CT_GDB_V_7_7 is not set
# CT_GDB_V_7_6_1 is not set
# CT_GDB_V_7_5_1 is not set
# CT_GDB_V_7_4_1 is not set
# CT_GDB_V_7_4 is not set
# CT_GDB_V_7_3_1 is not set
# CT_GDB_V_7_3a is not set
# CT_GDB_V_7_2a is not set
# CT_GDB_V_7_1a is not set
# CT_GDB_V_7_0_1a is not set
# CT_GDB_V_7_0a is not set
# CT_GDB_V_6_8a is not set
CT_GDB_7_2_or_later=y
CT_GDB_7_0_or_later=y
CT_GDB_HAS_PKGVERSION_BUGURL=y
CT_GDB_HAS_PYTHON=y
CT_GDB_INSTALL_GDBINIT=y
CT_GDB_VERSION="7.10"
# CT_DEBUG_ltrace is not set
# CT_DEBUG_strace is not set

#
# Companion libraries
#
CT_COMPLIBS_NEEDED=y
CT_GMP_NEEDED=y
CT_MPFR_NEEDED=y
CT_ISL_NEEDED=y
CT_CLOOG_NEEDED=y
CT_MPC_NEEDED=y
CT_COMPLIBS=y
CT_GMP=y
CT_MPFR=y
CT_ISL=y
CT_CLOOG=y
CT_MPC=y
CT_GMP_V_6_0_0=y
# CT_GMP_V_5_1_3 is not set
# CT_GMP_V_5_1_1 is not set
# CT_GMP_V_5_0_2 is not set
# CT_GMP_V_5_0_1 is not set
# CT_GMP_V_4_3_2 is not set
# CT_GMP_V_4_3_1 is not set
# CT_GMP_V_4_3_0 is not set
CT_GMP_5_0_2_or_later=y
CT_GMP_VERSION="6.0.0a"
# CT_MPFR_V_3_1_3 is not set
CT_MPFR_V_3_1_2=y
# CT_MPFR_V_3_1_0 is not set
# CT_MPFR_V_3_0_1 is not set
# CT_MPFR_V_3_0_0 is not set
# CT_MPFR_V_2_4_2 is not set
# CT_MPFR_V_2_4_1 is not set
# CT_MPFR_V_2_4_0 is not set
CT_MPFR_VERSION="3.1.2"
CT_ISL_V_0_12_2=y
# CT_ISL_V_0_11_1 is not set
CT_ISL_V_0_12_or_later=y
CT_ISL_VERSION="0.12.2"
# CT_CLOOG_V_0_18_4 is not set
CT_CLOOG_V_0_18_1=y
# CT_CLOOG_V_0_18_0 is not set
CT_CLOOG_VERSION="0.18.1"
CT_CLOOG_0_18_or_later=y
# CT_MPC_V_1_0_3 is not set
CT_MPC_V_1_0_2=y
# CT_MPC_V_1_0_1 is not set
# CT_MPC_V_1_0 is not set
# CT_MPC_V_0_9 is not set
# CT_MPC_V_0_8_2 is not set
# CT_MPC_V_0_8_1 is not set
# CT_MPC_V_0_7 is not set
CT_MPC_VERSION="1.0.2"

#
# Companion libraries common options
#
# CT_COMPLIBS_CHECK is not set

#
# Companion tools
#

#
# READ HELP before you say 'Y' below !!!
#
# CT_COMP_TOOLS is not set

Build dependencies

Since I didn't want to build all dependencies and my target platform was Raspbian anyway I created a local debian environment. For this I used debootstrap to create a minimal 64 bit Debian Jessie in some folder. Using systemd-nspawn I logged into the system and added the Raspbian repository to the apt sources. By running dpkg --add-architecture armhf I enabled the system to also install the arm packages from the Raspbian repository (I still had to use apt-get download and dpkg -x for downloading and extracting the arm packages). Now the development packages and libraries could be downloaded. I also moved some libraries around and corrected some symbolic links most notably the libz.so which was located somewhere in /lib while most libraries were below /usr/lib. This was solely to ease the maintenance since all libraries would be in one folder (originally I wanted to use the overlay filesystem support in systemd-nspawn and build directly in the debian container but the version of the systemd package in Fedora 22 didn't have that feature).

Build environment

I've put together a small script to prepare the cross build environment. Most notably that prepends the cross compiler bin folder to the PATH and configures QEMU to pick up the libraries from the cross compiler when running arm binaries.

#!/bin/bash

__path_add $HOME/x-tools/armv6-rpi-linux-gnueabihf/bin
export QEMU_LD_PREFIX=$HOME/x-tools/armv6-rpi-linux-gnueabihf/armv6-rpi-linux-gnueabihf/sysroot
export PKG_CONFIG_SYSROOT_DIR=$HOME/x-tools/armv6-rpi-linux-gnueabihf/armv6-rpi-linux-gnueabihf/sysroot

The QEMU_LD_PREFIX is important here since the qt build will build qmake (and the other binaries) for arm. Since the compiled qmake is used for the following build steps you need to enable your host system to run arm binaries (just google for binfmt and arm). I also ended up to copy the libz.so from raspbian to the sysroot lib folder of the cross compiler because my final build linked dynamically against libz and otherwise the cross compiled moc binary failed to start.

Build

I've compiled 8f03630. First 2 changes are required in the qt folder:

1 qt/mkspecs/linux-arm-gnueabi-g++/qmake.conf

#
# qmake configuration for building with arm-linux-gnueabi-g++
#

MAKEFILE_GENERATOR      = UNIX
TARGET_PLATFORM         = unix
TEMPLATE                = app
CONFIG                  += qt warn_on release incremental link_prl gdb_dwarf_index
QT                      += core gui
QMAKE_INCREMENTAL_STYLE = sublib

include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)

# modifications to g++.conf
QMAKE_CC                = armv6-rpi-linux-gnueabihf-gcc
QMAKE_CXX               = armv6-rpi-linux-gnueabihf-g++
QMAKE_LINK              = armv6-rpi-linux-gnueabihf-g++
QMAKE_LINK_SHLIB        = armv6-rpi-linux-gnueabihf-g++

# modifications to linux.conf
QMAKE_AR                = armv6-rpi-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY           = armv6-rpi-linux-gnueabihf-objcopy
QMAKE_STRIP             = armv6-rpi-linux-gnueabihf-strip

QMAKE_INCDIR        = <debian-container>/usr/include/arm-linux-gnueabihf <debian-container>/usr/include
QMAKE_LIBDIR        = <debian-container>/usr/lib/arm-linux-gnueabihf

QMAKE_LFLAGS       += -Wl,-rpath-link,<debian-container>/usr/lib/arm-linux-gnueabihf

QMAKE_TARGET.arch   = armv6

load(qt_config)

Basically this configures qt compilation to use our cross compiler and the rasbpian headers and libraries. The -rpath-link is required because otherwise some of the X11 related config tests are failing.

2 qt/config.tests/unix/freetype/freetype.pri

!cross_compile {
    TRY_INCLUDEPATHS = $$QMAKE_INCDIR $$QMAKE_INCDIR_X11 $$INCLUDEPATH
    # LSB doesn't allow using headers from /include or /usr/include
    linux-lsb-g++:TRY_INCLUDEPATHS = $$QMAKE_INCDIR $$QMAKE_INCDIR_X11 $$INCLUDEPATH
    for(p, TRY_INCLUDEPATHS) {
        p = $$join(p, "", "", "/freetype2")
        exists($$p):INCLUDEPATH *= $$p
    }
}

Basically I removed the hardcoded /include and /usr/include entries from TRY_INCLUDEPATHS since otherwise the build picked up headers from the host system which caused for instance failing of the fontconfig test. After that I've run the usual configure make and make install (based on the build.py script). You need to add the flags -platform linux-arm-gnueabi-g++ and -arch armv6 to the configure run.

Guess with some more love and work this can be turned into some nice automated build ;-)

@cm8

This comment has been minimized.

Show comment
Hide comment
@cm8

cm8 Mar 3, 2016

The binaries posted above contain a domain list,
that is also (solely?) posted here: pastebin.ca/2825559

It does not seem to be part of the official qt distribution.

Can someone shed a light /why/ this is included in wkhtmltopdf arm compile?
I'm curious.

Ad hoc, I cannot find it in x86 32/64 compiles.

EDIT: reddit.com/r/oculus/comments/2bpyxd/why_are_there_4287_random_looking_domain_names/ claims it's from this file in Qt-4.8.4 3rdparty includes - still interested what purpose it serves..

EDIT2: seems to be used in src/corelib/io/qtldurl.cpp to find out if a domain string is a tld -- intersting that this is hardcoded.

cm8 commented Mar 3, 2016

The binaries posted above contain a domain list,
that is also (solely?) posted here: pastebin.ca/2825559

It does not seem to be part of the official qt distribution.

Can someone shed a light /why/ this is included in wkhtmltopdf arm compile?
I'm curious.

Ad hoc, I cannot find it in x86 32/64 compiles.

EDIT: reddit.com/r/oculus/comments/2bpyxd/why_are_there_4287_random_looking_domain_names/ claims it's from this file in Qt-4.8.4 3rdparty includes - still interested what purpose it serves..

EDIT2: seems to be used in src/corelib/io/qtldurl.cpp to find out if a domain string is a tld -- intersting that this is hardcoded.

@agungjk

This comment has been minimized.

Show comment
Hide comment
@agungjk

agungjk Mar 27, 2016

@GM-Script-Writer-62850 & @tobias-hammerschmidt i get an error
wkhtmltopdf: cannot execute binary file

can you help me?

agungjk commented Mar 27, 2016

@GM-Script-Writer-62850 & @tobias-hammerschmidt i get an error
wkhtmltopdf: cannot execute binary file

can you help me?

@GM-Script-Writer-62850

This comment has been minimized.

Show comment
Hide comment
@GM-Script-Writer-62850

GM-Script-Writer-62850 Mar 27, 2016

using a pi3?
i have only tested it on wheezy with a pi b r2 and a pi b2
make sure you chmod +x the file
based on that error i would assume you are missing a dependency or executable permission on a file

GM-Script-Writer-62850 commented Mar 27, 2016

using a pi3?
i have only tested it on wheezy with a pi b r2 and a pi b2
make sure you chmod +x the file
based on that error i would assume you are missing a dependency or executable permission on a file

@agungjk

This comment has been minimized.

Show comment
Hide comment
@agungjk

agungjk Mar 28, 2016

@GM-Script-Writer-62850 it running in raspberry pi 2 jessie, it has been running now
Thank you my friend

agungjk commented Mar 28, 2016

@GM-Script-Writer-62850 it running in raspberry pi 2 jessie, it has been running now
Thank you my friend

@brianjsw

This comment has been minimized.

Show comment
Hide comment
@brianjsw

brianjsw Jan 20, 2017

Does anyone have a link to the binary still? The links in this post are no longer functional. Would appreciate it...

brianjsw commented Jan 20, 2017

Does anyone have a link to the binary still? The links in this post are no longer functional. Would appreciate it...

@GM-Script-Writer-62850

This comment has been minimized.

Show comment
Hide comment
@GM-Script-Writer-62850

GM-Script-Writer-62850 Jan 20, 2017

I'll have my link up a in a few hours comment 150851478
My raspberry pi's SD card got corrupted

GM-Script-Writer-62850 commented Jan 20, 2017

I'll have my link up a in a few hours comment 150851478
My raspberry pi's SD card got corrupted

@cm8

This comment has been minimized.

Show comment
Hide comment
@cm8

cm8 Jan 21, 2017

@brianjsw
wkhtmltopdf.zip hosted here ~15mb

wkhtmltopdf hosted on pastefile ~45mb

sha256sum:
d500c6ac3b53cb68f2368ab9eeff2b17f91f452c6b1997475bbe9603774096c6 wkhtmltopdf

cm8 commented Jan 21, 2017

@brianjsw
wkhtmltopdf.zip hosted here ~15mb

wkhtmltopdf hosted on pastefile ~45mb

sha256sum:
d500c6ac3b53cb68f2368ab9eeff2b17f91f452c6b1997475bbe9603774096c6 wkhtmltopdf

@KEL-YJ-E

This comment has been minimized.

Show comment
Hide comment
@KEL-YJ-E

KEL-YJ-E Feb 8, 2017

Thank you so much! Took me a while to figure out how to solve this, turns out there's tons of good people out there that already did it.
(My situation: RPi 2 Raspbian Jessie with Odoo 10 installed, all over ssh; replaced the original wkhtmltopdf with the one in cm8's comment (unzipped the .zip) and restarted the server. Although I didn't try to print a pdf without restarting, but hey.)

KEL-YJ-E commented Feb 8, 2017

Thank you so much! Took me a while to figure out how to solve this, turns out there's tons of good people out there that already did it.
(My situation: RPi 2 Raspbian Jessie with Odoo 10 installed, all over ssh; replaced the original wkhtmltopdf with the one in cm8's comment (unzipped the .zip) and restarted the server. Although I didn't try to print a pdf without restarting, but hey.)

@ashkulz

This comment has been minimized.

Show comment
Hide comment
@ashkulz

ashkulz Apr 30, 2018

Member

If someone still wants this, please create an issue in wkhtmltopdf/packaging and describe which versions of RPi and/or OSes you are using.

Member

ashkulz commented Apr 30, 2018

If someone still wants this, please create an issue in wkhtmltopdf/packaging and describe which versions of RPi and/or OSes you are using.

@ashkulz

This comment has been minimized.

Show comment
Hide comment
@ashkulz

ashkulz May 1, 2018

Member

Would appreciate someone testing and giving feedback on the raspbian build available from

https://builds.wkhtmltopdf.org/0.12.5-dev/wkhtmltox_0.12.5-0.20180430.129.dev~1744d93~raspbian.stretch_armhf.deb

Member

ashkulz commented May 1, 2018

Would appreciate someone testing and giving feedback on the raspbian build available from

https://builds.wkhtmltopdf.org/0.12.5-dev/wkhtmltox_0.12.5-0.20180430.129.dev~1744d93~raspbian.stretch_armhf.deb

@GM-Script-Writer-62850

This comment has been minimized.

Show comment
Hide comment
@GM-Script-Writer-62850

GM-Script-Writer-62850 May 1, 2018

wkhtmltopdf seems to work good

Page Options:
      --print-media-type              Use print media-type instead of screen
      --no-print-media-type           Do not use print media-type instead of
                                      screen (default)

Why would you make --no-print-media-type default for making PDF files?
Aside from that I do not see any problems, well unless you count a unreasonably nit picky point about browser default button styles not matching default themes on a headless server that does not have a system theme in the 1st place

Now what was that other tool wkhtmltoimage now that i am gonna make some use of next time i need to make page screenshots of a project, gone are the days of using multiple screenshots and gimp wonder if that browsers addon still exist for doing that
Yep this one works fine, only tested basic usage (did not use all options), nothing all that fancy

Using a Raspberry PI 3B+ with Raspbian, purchased it on the release date

GM-Script-Writer-62850 commented May 1, 2018

wkhtmltopdf seems to work good

Page Options:
      --print-media-type              Use print media-type instead of screen
      --no-print-media-type           Do not use print media-type instead of
                                      screen (default)

Why would you make --no-print-media-type default for making PDF files?
Aside from that I do not see any problems, well unless you count a unreasonably nit picky point about browser default button styles not matching default themes on a headless server that does not have a system theme in the 1st place

Now what was that other tool wkhtmltoimage now that i am gonna make some use of next time i need to make page screenshots of a project, gone are the days of using multiple screenshots and gimp wonder if that browsers addon still exist for doing that
Yep this one works fine, only tested basic usage (did not use all options), nothing all that fancy

Using a Raspberry PI 3B+ with Raspbian, purchased it on the release date

@ashkulz

This comment has been minimized.

Show comment
Hide comment
@ashkulz

ashkulz May 1, 2018

Member

It's been that way for ages, probably because when the tool was written there was not much support for print CSS and it was better to use the screen media type?

Member

ashkulz commented May 1, 2018

It's been that way for ages, probably because when the tool was written there was not much support for print CSS and it was better to use the screen media type?

@GM-Script-Writer-62850

This comment has been minimized.

Show comment
Hide comment
@GM-Script-Writer-62850

GM-Script-Writer-62850 May 1, 2018

Print CSS rules simply override other rules, well unless the dev used @media screen{} for everything and did not make a @media print{}

body{
  text-align:center;
  font-size:12px;
}
@media print{/* prevent printing [evil laugh] */
  *{
    display:none!important;
  }
}

The browser default for printing is to apply print media and not to apply screen media, anything out side of a media target applies to everything
Since this is essentially printing to a file it should follow that standard by default, most people want a PDF file so they can print it, content providers use pdf files so the page formatting is just like they want it

GM-Script-Writer-62850 commented May 1, 2018

Print CSS rules simply override other rules, well unless the dev used @media screen{} for everything and did not make a @media print{}

body{
  text-align:center;
  font-size:12px;
}
@media print{/* prevent printing [evil laugh] */
  *{
    display:none!important;
  }
}

The browser default for printing is to apply print media and not to apply screen media, anything out side of a media target applies to everything
Since this is essentially printing to a file it should follow that standard by default, most people want a PDF file so they can print it, content providers use pdf files so the page formatting is just like they want it

@ashkulz

This comment has been minimized.

Show comment
Hide comment
@ashkulz

ashkulz May 1, 2018

Member

I don't want to change the default right now, maybe I'll consider it for 0.13.

Member

ashkulz commented May 1, 2018

I don't want to change the default right now, maybe I'll consider it for 0.13.

@GM-Script-Writer-62850

This comment has been minimized.

Show comment
Hide comment
@GM-Script-Writer-62850

GM-Script-Writer-62850 May 1, 2018

it is not that big a deal anyway, once you choose a default changing it will do more harm that good as people will be confused when something breaks just to find out a default setting change, a normal new user will check the --help data and find the option and just use it

GM-Script-Writer-62850 commented May 1, 2018

it is not that big a deal anyway, once you choose a default changing it will do more harm that good as people will be confused when something breaks just to find out a default setting change, a normal new user will check the --help data and find the option and just use it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment