Date: Tue, 14 Feb 2017 15:57:01 +0000 From: "Meyer, Wolfgang" <wolfgang.meyer@hob.de> To: "'freebsd-arm@FreeBSD.org'" <freebsd-arm@FreeBSD.org>, "'freebsd-toolchain@FreeBSD.org'" <freebsd-toolchain@FreeBSD.org> Subject: RE: How to get a crosscompile toolchain for aarch64 for use in poudriere[?] Message-ID: <EC88118611AE564AB0B10C6A4569004D015C063C28@HOBEX11.hob.de> In-Reply-To: <EC88118611AE564AB0B10C6A4569004D015C0639B0@HOBEX11.hob.de> References: <EC88118611AE564AB0B10C6A4569004D015C063770@HOBEX11.hob.de> <EC88118611AE564AB0B10C6A4569004D015C0639B0@HOBEX11.hob.de>
next in thread | previous in thread | raw e-mail | index | archive | help
> -----Original Message----- > From: Meyer, Wolfgang > Sent: Freitag, 10. Februar 2017 17:19 > To: Meyer, Wolfgang; 'freebsd-arm@FreeBSD.org'; 'freebsd- > toolchain@FreeBSD.org' > Subject: RE: How to get a crosscompile toolchain for aarch64 for use in > poudriere[?] > > > Hello, > > > > > > To make the long story short, after comparing the verbose output of my > > compiling in the jails with that of a direct crosscompile I found out > > that it was able to correctly link some object files when providing > > absolute paths to the crt*.o files and correct library search path for = the > libgcc_something libraries. > > Which of course doesn't help when the linker is implicitly called by > > the compiler. Further research showed that I could crosscompile/link > > when providing the --sysroot=3D/ flag to overwrite the sysroot > > configuration from the build of the crosscompiler. Amending the lines > > > > CFLAGS+=3D--sysroot=3D/ > > CPPFLAGS+=3D--sysroot=3D/ (Don't know if needed) > > CXXFLAGS+=3D--sysroot=3D/ > > LDFLAGS+=3D--sysroot=3D/ > > > > to my poudriere make.conf file I finally was able to produce a working > > cross- compiled package for aarch64 in poudriere. And the gains are > > quite significant (around 21 minutes for building pkg package with > > qemu-user emulation vs 5 minutes using cross-compilation, native amd64 > > build in poudriere finishes in less than a minute). > > > > Still the creation of the cross-compiling toolchain seems to be quite > > cumbersome. Hence advice on getting such a toolchain in a cleaner way > > (ideally probably a working build for the xdev target) are greatly > appreciated. > > > > > After building some more packages besides of pkg it seems, I am still not > there yet. There is quite some fallout mainly during configure due to not > getting the right searchpath for the libraries. Maybe creating a symlink = on the > root directory at the path of the expected sysroot directory might heal t= his. In the meantime I figured out how to tweak the jail to get it to cross-buil= d the desired subset of ports without fallout. Some of the changes are mere= ly cosmetic but lead to a cleaner overall configuration in my point of view= . Changes to the previously described configuration include: - before starting the kernel-toolchain build make two nullfs-mounts: > mount -t nullfs /<root_of_poudriere_jail>/usr/src /usr/src > mount -t nullfs /<root_of_poudriere_jail>/usr/obj /usr/obj - after kernel-toolchain build and copying /<root_of_poudriere_jail>/usr/ob= j/usr/src/tmp/* to /<root_of_poudriere_jail>/usr/aarch64-freebsd delete /<r= oot_of_poudriere_jail>/usr/obj/usr/src/tmp and create a symlink to / at /<r= oot_of_poudriere_jail>/usr/obj/usr/src/tmp Now all tested ports cross-build fine with varying speed gains compared to = the qemu-user emulated (in the ballpark of two- to eightfold, but not analy= sed in detail). ________________________________ Follow HOB: - HOB: http://www.hob.de/redirect/hob.html - Xing: http://www.hob.de/redirect/xing.html - LinkedIn: http://www.hob.de/redirect/linkedin.html - HOBLink Mobile: http://www.hob.de/redirect/hoblinkmobile.html - Facebook: http://www.hob.de/redirect/facebook.html - Twitter: http://www.hob.de/redirect/twitter.html - YouTube: http://www.hob.de/redirect/youtube.html - E-Mail: http://www.hob.de/redirect/mail.html HOB GmbH & Co. KG Schwadermuehlstr. 3 D-90556 Cadolzburg Geschaeftsfuehrung: Klaus Brandstaetter, Zoran Adamovic AG Fuerth, HRA 5180 Steuer-Nr. 218/163/00107 USt-ID-Nr. DE 132747002 Komplementaerin HOB electronic Beteiligungs GmbH AG Fuerth, HRB 3416
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?EC88118611AE564AB0B10C6A4569004D015C063C28>