Qtopia4 fails building - target stage tries to run target binaries on build machine
I am trying to look into how to "fix" Qtopia 4 in Buildroot, at least it does not compile for me (snapshot 20070717).
The makefile seems to generate target specific binaries in build_<arch> directory, and host specific binaries in toolchain_build_<arch>.
As I understand the toolchain_build_<arch> binaries should be installed to $(STAGING_DIR) and the build_<arch> binaries should be installed to $(TARGET_ROOT)?
Have I understood the build setup correctly?
Signature · 2 lines
Regards Hans-Christian Egtvedt
Quoted 9 lines · Hans-Christian Egtvedt
I am trying to look into how to "fix" Qtopia 4 in Buildroot, at least it does not compile for me (snapshot 20070717).
The makefile seems to generate target specific binaries in build_<arch> directory, and host specific binaries in toolchain_build_<arch>.
As I understand the toolchain_build_<arch> binaries should be installed to $(STAGING_DIR) and the build_<arch> binaries should be installed to $(TARGET_ROOT)?
I don't think that this is an accurate description.
<p>
The staging_dir is holding intermediate files (headers, libraries) that are prerequisites of other packages.
The target_dir is the final root filesystem. The target_dir will usually not contain headers nor intermediate libraries (.ar archives or intermediate libs) that are not needed on the target.
</p>
Helper applications that are ment to be run on the host are compiled in <packagename>-host while cross-compiled packages, libraries, binaries are compiled in <packagename>.
<br>
The host-binaries will either be ran directly in the place they were compile or will be installed into toolchain_build_ARCH/bin . Applications that are ment to be run on the host but have prerequisites that are built in buildroot shall use the <packagename>-host directories for the prerequisite libraries, if possible (e.g. <code>--with-gettext=/there/toolchain_build_i386/gettext-0.00-host</code> )
If a prerequisite host-library has to be installed before it can be used, then it should be installed into target_dir_ARCH/packagename (e.g. libgmp which is needed for the cross-compiler:
--with-gmp=/there/toolchain_build_i386/gmp).
Quoted 2 lines
Have I understood the build setup correctly?
See
http://buildroot.uclibc.org/buildroot.html
and look for "staging_dir"
Perhaps somebody will flesh out the above and add it to the abovementioned URL (don't have time ATM).
HTH,
Quoted 3 lines · Hans-Christian Egtvedt
I am trying to look into how to "fix" Qtopia 4 in Buildroot, at least it does not compile for me (snapshot 20070717).
what happens?
Quoted 2 lines
The makefile seems to generate target specific binaries in build_<arch> directory, and host specific binaries in toolchain_build_<arch>.
which is the right thing to do.
Quoted 3 lines
As I understand the toolchain_build_<arch> binaries should be installed to $(STAGING_DIR) and the build_<arch> binaries should be installed to $(TARGET_ROOT)?
But what is the problem?
Thomas.
Quoted 6 lines · Thomas Lundquist
Quoted 3 lines · Hans-Christian Egtvedt
I am trying to look into how to "fix" Qtopia 4 in Buildroot, at least it does not compile for me (snapshot 20070717).
what happens?
As I said, it tries to execute moc, but moc is compiled for the target.
/home/hcegtvedt/gitwork/buildroot/build_avr32/qtopia-core-opensource-src-4.2.2/bin/moc -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_NO_DEBUG -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/qws/linux-avr32-g++ -I. -I../../include -I../../include/QtCore -Iglobal -I.moc/release-shared-emb-avr32 -I.uic/release-shared-emb-avr32 io/qbuffer.h -o .moc/release-shared-emb-avr32/moc_qbuffer.cpp /home/hcegtvedt/gitwork/buildroot/build_avr32/qtopia-core-opensource-src-4.2.2/bin/moc: 1: Syntax error: "(" unexpected
Quoted 4 lines
Quoted 2 lines
The makefile seems to generate target specific binaries in build_<arch> directory, and host specific binaries in toolchain_build_<arch>.
which is the right thing to do.
I actually think the toolchain_build_<arch> must install into $(STAGING_DIR) and the build_<arch> install into $(TARGET_DIR). This is because the build toolchain needs qmake, moc, etc. built with the host compiler to be able to make Qt binaries for the target.
And if you want to compile/use these binaries on the target they need to be native binaries of course.
Quoted 5 lines
Quoted 3 lines
As I understand the toolchain_build_<arch> binaries should be installed to $(STAGING_DIR) and the build_<arch> binaries should be installed to $(TARGET_ROOT)?
But what is the problem?
The problem arises when building the target Qtopia, it tries to use moc et.al compiled for the target architecture. And when running a big-endian AVR32 binary on my little-endian x86 laptop, it fails ;)
Suggestions are very welcome, I am trying to clean up this package.
Signature · 4 lines
With kind regards, Hans-Christian Egtvedt, siv.ing. (M.Sc.) Applications Engineer - AVR32 System Solutions - Atmel Norway
Quoted 2 lines · Hans-Christian Egtvedt
As I said, it tries to execute moc, but moc is compiled for the target.
Weird.
Quoted 3 lines
The problem arises when building the target Qtopia, it tries to use moc et.al compiled for the target architecture. And when running a big-endian AVR32 binary on my little-endian x86 laptop, it fails ;)
But of course.
the weird part is that the makefile was made for compiling qtopia on ARM, which means moc & co was compiled for the right platform(s).
Quoted 1 line
Suggestions are very welcome, I am trying to clean up this package.
I'll start working on fixing this right now.
(Believe me, you'd like not to find out why it's as messy as it is.)
Thomas.
Quoted 6 lines · Thomas Lundquist
Quoted 2 lines · Hans-Christian Egtvedt
As I said, it tries to execute moc, but moc is compiled for the target.
Weird.
Quoted 8 lines
Quoted 3 lines
The problem arises when building the target Qtopia, it tries to use moc et.al compiled for the target architecture. And when running a big-endian AVR32 binary on my little-endian x86 laptop, it fails ;)
But of course.
the weird part is that the makefile was made for compiling qtopia on ARM, which means moc & co was compiled for the right platform(s).
Just to clearify something, is moc & co meant to be compiled for the target architecture?
If not, I do not really understand why this is a two stage build.
Quoted 4 lines
Quoted 1 line
Suggestions are very welcome, I am trying to clean up this package.
I'll start working on fixing this right now.
(Believe me, you'd like not to find out why it's as messy as it is.)
I have already dug a bit into it and have some suggestions when I understand how it was ment to work. If you see a solution quickly, I will gladly test a patch.
Signature · 4 lines
With kind regards, Hans-Christian Egtvedt, siv.ing. (M.Sc.) Applications Engineer - AVR32 System Solutions - Atmel Norway
Quoted 6 lines · Thomas Lundquist
Quoted 2 lines · Hans-Christian Egtvedt
As I said, it tries to execute moc, but moc is compiled for the target.
Weird.
Quoted 8 lines
Quoted 3 lines
The problem arises when building the target Qtopia, it tries to use moc et.al compiled for the target architecture. And when running a big-endian AVR32 binary on my little-endian x86 laptop, it fails ;)
But of course.
the weird part is that the makefile was made for compiling qtopia on ARM, which means moc & co was compiled for the right platform(s).
...but qmake and moc are supposed to run on the build host, not on the target. They are only used during development, not during runtime.
Allan
Quoted 11 lines · Allan Clark
Quoted 10 lines · Thomas Lundquist
Quoted 2 lines · Hans-Christian Egtvedt
As I said, it tries to execute moc, but moc is compiled for the target.
Weird.
Quoted 3 lines
The problem arises when building the target Qtopia, it tries to use moc et.al compiled for the target architecture. And when running a big-endian AVR32 binary on my little-endian x86 laptop, it fails ;)
Quoted 7 lines
Quoted 4 lines
But of course.
the weird part is that the makefile was made for compiling qtopia on ARM, which means moc & co was compiled for the right platform(s).
...but qmake and moc are supposed to run on the build host, not on the target. They are only used during development, not during runtime.
Then why is Qtopia a two stage build? Then only a normal cross-compile is needed.
I could see the need if a user would like to compile Qt applications on target, but I guess not many people does that.
Signature · 4 lines
With kind regards, Hans-Christian Egtvedt, siv.ing. (M.Sc.) Applications Engineer - AVR32 System Solutions - Atmel Norway
Private reply reposted
Quoted 15 lines · Hans-Christian Egtvedt
Quoted 13 lines · Allan Clark
Quoted 12 lines · Thomas Lundquist
Quoted 2 lines · Hans-Christian Egtvedt
As I said, it tries to execute moc, but moc is compiled for the target.
Weird.
Quoted 3 lines
The problem arises when building the target Qtopia, it tries to use moc et.al compiled for the target architecture. And when running a big-endian AVR32 binary on my little-endian x86 laptop, it fails ;)
But of course.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
the weird part is that the makefile was made for compiling qtopia on ARM, which means moc & co was compiled for the right platform(s).
...but qmake and moc are supposed to run on the build host, not on the target. They are only used during development, not during runtime.
Then why is Qtopia a two stage build? Then only a normal cross-compile is needed.
Not sure what you mean; perhaps I need to build the qtopia4 to check it.
Qmake is an "automake/autoconf" replacement, so any Qtopia4 app needs to be built with the qmake app, or the builder has to go track down the platform differences (like porting before automake and autoconf existed, or before Imake existed). ince Qmake has to build the makefile for the target, it needs to run on the build host.
MOC creates the C++ base classes for the signal/event-passing in any QObject; it generates code that needs to be cross-compiled, but MOC runs on the buildhost.
MOC and Qmake link against Qtopia libraries -- they are themselves Qtopia applications.
Does that make sense? Perhaps the two-stage is:
1) building libqt, qmake, and tools for host apps
2) running qmake and moc for the target
3) building libqt for the target
In the end, 2 libqts are needed, plus a host-qmake, plus a host-moc.
I did this for Qt/E pre-2.2.0, but that's outdated now, and it's probably much more complex.
Allan
Quoted 21 lines · Allan Clark
Private reply reposted
Quoted 18 lines · Hans-Christian Egtvedt
Quoted 16 lines · Allan Clark
Quoted 14 lines · Thomas Lundquist
Quoted 2 lines · Hans-Christian Egtvedt
As I said, it tries to execute moc, but moc is compiled for the target.
Weird.
Quoted 3 lines
The problem arises when building the target Qtopia, it tries to use moc et.al compiled for the target architecture. And when running a big-endian AVR32 binary on my little-endian x86 laptop, it fails ;)
But of course.
the weird part is that the makefile was made for compiling qtopia on ARM, which means moc & co was compiled for the right platform(s).
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
...but qmake and moc are supposed to run on the build host, not on the target. They are only used during development, not during runtime.
Then why is Qtopia a two stage build? Then only a normal cross-compile is needed.
Not sure what you mean; perhaps I need to build the qtopia4 to check it.
The Qtopia 4 source is extracted to two different places and compiled almost alike. As I see it, one time should be enough.
Quoted 6 lines
Qmake is an "automake/autoconf" replacement, so any Qtopia4 app needs to be built with the qmake app, or the builder has to go track down the platform differences (like porting before automake and autoconf existed, or before Imake existed). ince Qmake has to build the makefile for the target, it needs to run on the build host.
Quoted 6 lines
MOC creates the C++ base classes for the signal/event-passing in any QObject; it generates code that needs to be cross-compiled, but MOC runs on the buildhost.
MOC and Qmake link against Qtopia libraries -- they are themselves Qtopia applications.
Thanks for the description (-:
Quoted 2 lines
Does that make sense? Perhaps the two-stage is:
1) building libqt, qmake, and tools for host apps
Why does host apps need libqt? Qmake, moc, uic and rcc does not depend on libqt.
Quoted 1 line
2) running qmake and moc for the target
Do buildroot need this? Only if they are to be installed on target and the user plans to build QT application on the target.
Quoted 1 line
3) building libqt for the target
AFAIK Qtopia 4 is somewhat ready for cross compiling, capable of building the tools with HOSTCC and the library with TARGETCC.
Quoted 4 lines
In the end, 2 libqts are needed, plus a host-qmake, plus a host-moc.
I did this for Qt/E pre-2.2.0, but that's outdated now, and it's probably much more complex.
Signature · 4 lines
With kind regards, Hans-Christian Egtvedt, siv.ing. (M.Sc.) Applications Engineer - AVR32 System Solutions - Atmel Norway
Quoted 3 lines · Hans-Christian Egtvedt
The Qtopia 4 source is extracted to two different places and compiled almost alike. As I see it, one time should be enough.
but it isn't. one reason is the hard coding of paths in the qt libraries.
there was other reasons aswell but I can't remember all of'em just right now.
it's been too long time without having to work on it.
Quoted 4 lines
Quoted 1 line
2) running qmake and moc for the target
Do buildroot need this? Only if they are to be installed on target and the user plans to build QT application on the target.
you need qmake & friends on the host to compile applications for the target.
if that was the question.
Quoted 2 lines
AFAIK Qtopia 4 is somewhat ready for cross compiling, capable of building the tools with HOSTCC and the library with TARGETCC.
somewhat is the word here.
Thomas.