There are numerous problems with trying to cross compile Xlib (either the old version in CVS or the new version in git). In all cases --target was specified with the desired target architecture. I have a correctly installed cross compiler (yay crosstools) installed called ${TARGET}-gcc, etc. 1. Specifying --host to autogen.sh results in the warning: configure: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used. 2. Specifying either --build alone or with --host to autogen.sh results in the error: checking whether the C compiler works... configure: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. 3. When --host is specified and CC, AR, RANLIB, and CCLD are over-ridden to specify the desicred cross tools, building in src/util incorrectly uses that compiler for the target system instead of the compiler for the host system. I've tried various gymnastics in src/util/Makefile.am, but I just can't get it to do the right thing. I managed to hack something up that will at least build right, but, since it doesn't use the proper macros, the clean targets are not properly generated. I will attach that patch shortly. I have literally spent 2 days trying to get this to work. I'm so frustrated with it that I want imake back!!! :( It is a tragic mistake that we have zero documentation (at least zero that I could find) on how to actually *use* our build system. The little bit that is in http://wiki.x.org/wiki/ModularDevelopersGuide is no where near sufficient for anyone trying to modify or create either Makefile.am or configure.ac files in this project. Ugh.
Created attachment 5388 [details] [review] Ugly patch to build makekeys when crosscompiling This the patch mentioned in the initial bug report.
Cross-compiling is a bit of a horror show minefield that is incredibly difficult to get right, with any build system. If Scratchbox continues to annoy me here, I'll start looking into making the whole stack cross-compilable.
See also http://xorg.freedesktop.org/wiki/CrossCompilingXorg
*** Bug 6214 has been marked as a duplicate of this bug. ***
Sorry about the phenomenal bug spam, guys. Adding xorg-team@ to the QA contact so bugs don't get lost in future.
should be fixed since 1.1.99.2
*** Bug 13463 has been marked as a duplicate of this bug. ***
*** Bug 16484 has been marked as a duplicate of this bug. ***
*** Bug 20981 has been marked as a duplicate of this bug. ***
This is still broken. It uses the native gcc, but it uses LIBS and CFLAGS for the host system. LIBS can probably be forced to "", but CFLAGS is another matter. We need to access the X11 headers, but we want the native stdio and such. Not sure how to solve it.
Created attachment 29415 [details] [review] libX11-cross-fix-1.2.2.patch I managed to fix this. It appears that the dependency on the X11 libs is very superficial, and we can avoid the dependency by pulling in the relevant portions directly into makekeys.c. Included is a patch that clears out CFLAGS and LIB and modifies makekeys.c to build without the X11 headers.
I think this is fixed. Please send a patch to xorg-devel@lists.x.org if it is not. Putting patches on bugzilla is a great way for them to get lost.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.