Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Qtopia4 fails building - target stage tries to run target binaries on build machine
@ 2007-07-30 11:58 Hans-Christian Egtvedt
  2007-07-30 12:43 ` Bernhard Fischer
  2007-07-30 18:54 ` Thomas Lundquist
  0 siblings, 2 replies; 11+ messages in thread
From: Hans-Christian Egtvedt @ 2007-07-30 11:58 UTC (permalink / raw)
  To: buildroot

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?

-- 
Regards
Hans-Christian Egtvedt

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] Qtopia4 fails building - target stage tries to run target binaries on build machine
  2007-07-30 11:58 [Buildroot] Qtopia4 fails building - target stage tries to run target binaries on build machine Hans-Christian Egtvedt
@ 2007-07-30 12:43 ` Bernhard Fischer
  2007-07-30 18:54 ` Thomas Lundquist
  1 sibling, 0 replies; 11+ messages in thread
From: Bernhard Fischer @ 2007-07-30 12:43 UTC (permalink / raw)
  To: buildroot

On Mon, Jul 30, 2007 at 01:58:45PM +0200, Hans-Christian Egtvedt wrote:
>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
&lt;packagename&gt;-host while cross-compiled packages, libraries,
binaries are compiled in &lt;packagename&gt;.
<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 &lt;packagename&gt;-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).
>
>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,

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] Qtopia4 fails building - target stage tries to run target binaries on build machine
  2007-07-30 11:58 [Buildroot] Qtopia4 fails building - target stage tries to run target binaries on build machine Hans-Christian Egtvedt
  2007-07-30 12:43 ` Bernhard Fischer
@ 2007-07-30 18:54 ` Thomas Lundquist
  2007-07-31  8:22   ` Hans-Christian Egtvedt
  1 sibling, 1 reply; 11+ messages in thread
From: Thomas Lundquist @ 2007-07-30 18:54 UTC (permalink / raw)
  To: buildroot

On Mon, Jul 30, 2007 at 01:58:45PM +0200, Hans-Christian Egtvedt wrote:
> 
> 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? 

> 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.

> 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.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] Qtopia4 fails building - target stage tries to run target binaries on build machine
  2007-07-30 18:54 ` Thomas Lundquist
@ 2007-07-31  8:22   ` Hans-Christian Egtvedt
  2007-07-31  9:38     ` Thomas Lundquist
  0 siblings, 1 reply; 11+ messages in thread
From: Hans-Christian Egtvedt @ 2007-07-31  8:22 UTC (permalink / raw)
  To: buildroot


On Mon, 2007-07-30 at 20:54 +0200, Thomas Lundquist wrote:
> On Mon, Jul 30, 2007 at 01:58:45PM +0200, Hans-Christian Egtvedt wrote:
> > 
> > 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

> > 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.

> > 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.

-- 
With kind regards,

Hans-Christian Egtvedt, siv.ing. (M.Sc.)
Applications Engineer - AVR32 System Solutions - Atmel Norway

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] Qtopia4 fails building - target stage tries to run target binaries on build machine
  2007-07-31  8:22   ` Hans-Christian Egtvedt
@ 2007-07-31  9:38     ` Thomas Lundquist
  2007-07-31 10:15       ` Hans-Christian Egtvedt
  2007-07-31 12:26       ` Allan Clark
  0 siblings, 2 replies; 11+ messages in thread
From: Thomas Lundquist @ 2007-07-31  9:38 UTC (permalink / raw)
  To: buildroot

On Tue, Jul 31, 2007 at 10:22:03AM +0200, Hans-Christian Egtvedt wrote:
> 
> As I said, it tries to execute moc, but moc is compiled for the target.

Weird.

> 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).

> 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.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] Qtopia4 fails building - target stage tries to run target binaries on build machine
  2007-07-31  9:38     ` Thomas Lundquist
@ 2007-07-31 10:15       ` Hans-Christian Egtvedt
  2007-07-31 12:26       ` Allan Clark
  1 sibling, 0 replies; 11+ messages in thread
From: Hans-Christian Egtvedt @ 2007-07-31 10:15 UTC (permalink / raw)
  To: buildroot


On Tue, 2007-07-31 at 11:38 +0200, Thomas Lundquist wrote:
> On Tue, Jul 31, 2007 at 10:22:03AM +0200, Hans-Christian Egtvedt wrote:
> > 
> > As I said, it tries to execute moc, but moc is compiled for the target.
> 
> Weird.
> 
> > 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.

> > 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.

-- 
With kind regards,

Hans-Christian Egtvedt, siv.ing. (M.Sc.)
Applications Engineer - AVR32 System Solutions - Atmel Norway

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] Qtopia4 fails building - target stage tries to run target binaries on build machine
  2007-07-31  9:38     ` Thomas Lundquist
  2007-07-31 10:15       ` Hans-Christian Egtvedt
@ 2007-07-31 12:26       ` Allan Clark
  2007-07-31 12:35         ` Hans-Christian Egtvedt
  1 sibling, 1 reply; 11+ messages in thread
From: Allan Clark @ 2007-07-31 12:26 UTC (permalink / raw)
  To: buildroot

On 7/31/07, Thomas Lundquist <lists@zelow.no> wrote:
> On Tue, Jul 31, 2007 at 10:22:03AM +0200, Hans-Christian Egtvedt wrote:
> >
> > As I said, it tries to execute moc, but moc is compiled for the target.
>
> Weird.
>
> > 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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] Qtopia4 fails building - target stage tries to run target binaries on build machine
  2007-07-31 12:26       ` Allan Clark
@ 2007-07-31 12:35         ` Hans-Christian Egtvedt
  2007-07-31 14:27           ` Allan Clark
  0 siblings, 1 reply; 11+ messages in thread
From: Hans-Christian Egtvedt @ 2007-07-31 12:35 UTC (permalink / raw)
  To: buildroot


On Tue, 2007-07-31 at 08:26 -0400, Allan Clark wrote:
> On 7/31/07, Thomas Lundquist <lists@zelow.no> wrote:
> > On Tue, Jul 31, 2007 at 10:22:03AM +0200, Hans-Christian Egtvedt wrote:
> > >
> > > As I said, it tries to execute moc, but moc is compiled for the target.
> >
> > Weird.
> >
> > > 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.

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.

-- 
With kind regards,

Hans-Christian Egtvedt, siv.ing. (M.Sc.)
Applications Engineer - AVR32 System Solutions - Atmel Norway

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] Qtopia4 fails building - target stage tries to run target binaries on build machine
  2007-07-31 12:35         ` Hans-Christian Egtvedt
@ 2007-07-31 14:27           ` Allan Clark
  2007-07-31 14:41             ` Hans-Christian Egtvedt
  0 siblings, 1 reply; 11+ messages in thread
From: Allan Clark @ 2007-07-31 14:27 UTC (permalink / raw)
  To: buildroot

Private reply reposted

On 7/31/07, Hans-Christian Egtvedt <hcegtvedt@atmel.com> wrote:
>
> On Tue, 2007-07-31 at 08:26 -0400, Allan Clark wrote:
> > On 7/31/07, Thomas Lundquist <lists@zelow.no> wrote:
> > > On Tue, Jul 31, 2007 at 10:22:03AM +0200, Hans-Christian Egtvedt wrote:
> > > >
> > > > As I said, it tries to execute moc, but moc is compiled for the target.
> > >
> > > Weird.
> > >
> > > > 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.
>
> 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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] Qtopia4 fails building - target stage tries to run target binaries on build machine
  2007-07-31 14:27           ` Allan Clark
@ 2007-07-31 14:41             ` Hans-Christian Egtvedt
  2007-08-01  7:45               ` Thomas Lundquist
  0 siblings, 1 reply; 11+ messages in thread
From: Hans-Christian Egtvedt @ 2007-07-31 14:41 UTC (permalink / raw)
  To: buildroot


On Tue, 2007-07-31 at 10:27 -0400, Allan Clark wrote:
> Private reply reposted
> 
> On 7/31/07, Hans-Christian Egtvedt <hcegtvedt@atmel.com> wrote:
> >
> > On Tue, 2007-07-31 at 08:26 -0400, Allan Clark wrote:
> > > On 7/31/07, Thomas Lundquist <lists@zelow.no> wrote:
> > > > On Tue, Jul 31, 2007 at 10:22:03AM +0200, Hans-Christian Egtvedt wrote:
> > > > >
> > > > > As I said, it tries to execute moc, but moc is compiled for the target.
> > > >
> > > > Weird.
> > > >
> > > > > 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.
> >
> > 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.

> 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.

Thanks for the description (-:

> 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.

> 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.

> 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.

> 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.

-- 
With kind regards,

Hans-Christian Egtvedt, siv.ing. (M.Sc.)
Applications Engineer - AVR32 System Solutions - Atmel Norway

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] Qtopia4 fails building - target stage tries to run target binaries on build machine
  2007-07-31 14:41             ` Hans-Christian Egtvedt
@ 2007-08-01  7:45               ` Thomas Lundquist
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas Lundquist @ 2007-08-01  7:45 UTC (permalink / raw)
  To: buildroot

On Tue, Jul 31, 2007 at 04:41:18PM +0200, Hans-Christian Egtvedt wrote:
> 
> 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.

> > 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.

> 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.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-08-01  7:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-30 11:58 [Buildroot] Qtopia4 fails building - target stage tries to run target binaries on build machine Hans-Christian Egtvedt
2007-07-30 12:43 ` Bernhard Fischer
2007-07-30 18:54 ` Thomas Lundquist
2007-07-31  8:22   ` Hans-Christian Egtvedt
2007-07-31  9:38     ` Thomas Lundquist
2007-07-31 10:15       ` Hans-Christian Egtvedt
2007-07-31 12:26       ` Allan Clark
2007-07-31 12:35         ` Hans-Christian Egtvedt
2007-07-31 14:27           ` Allan Clark
2007-07-31 14:41             ` Hans-Christian Egtvedt
2007-08-01  7:45               ` Thomas Lundquist

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox