samba-bugs@samba.org
2008-Jan-01 13:30 UTC
DO NOT REPLY [Bug 5170] New: Cross compilation does not work
https://bugzilla.samba.org/show_bug.cgi?id=5170 Summary: Cross compilation does not work Product: rsync Version: 3.0.0 Platform: x86 OS/Version: Linux Status: NEW Severity: normal Priority: P3 Component: core AssignedTo: wayned@samba.org ReportedBy: r.schwebel@pengutronix.de QAContact: rsync-qa@samba.org The makefiles try to build the "mkrounding" tool with the "host" compiler; however, this file is being executed later in the build, so it has to be compiled with the "build" compiler. Usually, autotoolized Makefiles solve this by using CC_FOR_BUILD and the related CFLAGS_FOR_BUILD and LDFLAGS_FOR_BUILD. Error message, taken during a build for ARM here: ----------8<----------8<---------- arm-v4t-linux-gnueabi-gcc -std=gnu99 -g -O2 -DHAVE_CONFIG_H -Wall -W -I./popt -L/some/path/sysroot/arm-v4t-linux-gnueabi/lib -L/some/path/sysroot/arm-v4t-linux-gnueabi/usr/lib -Wl,-rpath-link -Wl,/some/path/sysroot/arm-v4t-linux-gnueabi/usr/lib -o mkrounding -I. ./mkrounding.c ./mkrounding >rounding.h /bin/sh: ./mkrounding: cannot execute binary file ----------8<----------8<---------- Patch follows soon. -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
samba-bugs@samba.org
2008-Jan-01 13:33 UTC
DO NOT REPLY [Bug 5170] Cross compilation does not work
https://bugzilla.samba.org/show_bug.cgi?id=5170 ------- Comment #1 from r.schwebel@pengutronix.de 2008-01-01 07:33 CST ------- Created an attachment (id=3083) --> (https://bugzilla.samba.org/attachment.cgi?id=3083&action=view) [PATCH] Fix cross compilation, build mkrounding with CC_FOR_BUILD -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
samba-bugs@samba.org
2008-Jan-01 15:14 UTC
DO NOT REPLY [Bug 5170] Cross compilation does not work
https://bugzilla.samba.org/show_bug.cgi?id=5170 ------- Comment #2 from matt@mattmccutchen.net 2008-01-01 09:14 CST ------- That is not the right fix. Running "mkrounding" is meant to give information about how the *cross compiler* aligns structures so rsync can adapt accordingly; building and running "mkrounding" for the build machine may give the wrong answer. For cross compilation to work, we would need to find a way to get this information from the cross compiler itself without running an executable that it produces. There is also the issue of the 11 configure tests that run things on the build machine (assumed to be the target machine). -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
samba-bugs@samba.org
2008-Jan-01 16:33 UTC
DO NOT REPLY [Bug 5170] Cross compilation does not work
https://bugzilla.samba.org/show_bug.cgi?id=5170 ------- Comment #3 from vapier@gentoo.org 2008-01-01 10:33 CST ------- autotools has a way of figuring out sizeof() by only cross-compiling by using array indexes ... i bet that could be adapted to do offsetof() which is what you're after, right ? -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
samba-bugs@samba.org
2008-Jan-01 17:09 UTC
DO NOT REPLY [Bug 5170] Cross compilation does not work
https://bugzilla.samba.org/show_bug.cgi?id=5170 wayned@samba.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #4 from wayned@samba.org 2008-01-01 11:09 CST ------- I changed the makefile to output instructions for manually running mkrounding on the target machine when cross-compiling. If someone wishes to automate a cross-compiler build, they should determine the rounding information (perhaps manually) and add their own build command (e.g. an echo) to create the rounding.h file before running "make" (or perhaps as a patch to Makefile.in). The result of the mkrounding command is a simple define, such as this one: #define EXTRA_ROUNDING 0 -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
samba-bugs@samba.org
2008-Jan-01 17:18 UTC
DO NOT REPLY [Bug 5170] Cross compilation does not work
https://bugzilla.samba.org/show_bug.cgi?id=5170 ------- Comment #5 from r.schwebel@pengutronix.de 2008-01-01 11:18 CST ------- (In reply to comment #4)> I changed the makefile to output instructions for manually running mkrounding > on the target machine when cross-compiling.Can you elaborate what mkrounding.c tries to achieve? It compares the size of n 'union file_extra's plus one 'struct file_struct' to the size of a struct containing these all and checks if it is equal for n = 1, 2 or 4. But what's the rationale behind this? Maybe we find a better solution than throwing the file in manually (even overwriting the test on the commandline with some ac_cv_* variable would be better). -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
samba-bugs@samba.org
2008-Jan-01 17:30 UTC
DO NOT REPLY [Bug 5170] Cross compilation does not work
https://bugzilla.samba.org/show_bug.cgi?id=5170 ------- Comment #6 from wayned@samba.org 2008-01-01 11:30 CST ------- Rsync has to determine the proper alignment for its internal struct when it manually aligns it after a leading array. If this can be determined at configure time, that would obviously be preferable. -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
samba-bugs@samba.org
2008-Jan-01 18:26 UTC
DO NOT REPLY [Bug 5170] Cross compilation does not work
https://bugzilla.samba.org/show_bug.cgi?id=5170 ------- Comment #7 from wayned@samba.org 2008-01-01 12:26 CST ------- OK, I took a clue from the configure sizeof check and changed the makefile to try one or more compilations of mkrounding.c with different rounding sizes. This allows it to determine rounding without ever running the mkrounding program. -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
samba-bugs@samba.org
2008-Jan-01 18:31 UTC
DO NOT REPLY [Bug 5170] Cross compilation does not work
https://bugzilla.samba.org/show_bug.cgi?id=5170 ------- Comment #8 from matt@mattmccutchen.net 2008-01-01 12:31 CST ------- Cool! It might be more natural to do the tests in the configure script. -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
Apparently Analagous Threads
- [PATCH] Adjust 'Makefile.in' for builddir != srcdir
- DO NOT REPLY [Bug 4981] New: iconv confusion
- DO NOT REPLY [Bug 5022] New: FreeBSD 4.11 - Compilation Fails - uidlist.c - gcc2 / gcc3
- 3.0.0pre7 compiler warning on ia64
- [PATCH] add linux' arch/$ARCH/include to search path From: Marc Kleine-Budde <mkl@pengutronix.de> Date: Mon, 5 Jan 2009 17:46:47 +0100