User:VladVukicevic/Maemo 2007q3: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
 
(9 intermediate revisions by the same user not shown)
Line 3: Line 3:
* Ubuntu 7.04 as host; should work fine with others, but I'm using preexisting debs here.
* Ubuntu 7.04 as host; should work fine with others, but I'm using preexisting debs here.


* install all scratchbox debs from http://scratchbox.org/~jhakala/unofficial/ -- except for the sb1 arm toolchain (which I believe is for scratchbox1? I'm not sure about this)
* install scratchbox from http://scratchbox.org/ -- you want the cs2007q3-arm6 toolchain.
** deb http://scratchbox.org/debian apophis main


* grab the maemo rootstrap tgz from http://repository.maemo.org/stable/chinook/armel/
* grab the maemo rootstrap tgz from http://repository.maemo.org/stable/chinook/armel/
Line 22: Line 23:
*** apt-get install libgtk2.0-dev libxaw7-dev libfreetype6-dev libxi-dev
*** apt-get install libgtk2.0-dev libxaw7-dev libfreetype6-dev libxi-dev
*** (might be some more missing, install as necessary)
*** (might be some more missing, install as necessary)
<strike>
* fix up libgobject
** there is an incompatability between the new compiler, the shipping libgobject, and qemu; you will get errors about "Unable to create executable stack as required" or somesuch upon trying to execute binaries linked with libgobject.
** Rebuilding glib seems to fix this:
*** apt-get source libglib2.0
*** you'll need the gtk-doc-tools package: apt-get install gtk-doc-tools
*** cd glib2.0-2.12.12
*** fakeroot dpkg-buildpackage
*** go get lunch; the build is fairly fast, but the gtk-doc-tools do some huge xslt transforms, all under qemu.
*** install your newly created glib 2.0 debs
</strike>


* the old compiler generates binaries without the executable stack bit flag present to indicate whether an executable stack is needed; this is assumed to mean that it is needed.  You'll need to fix all the installed libraries, otherwise you'll get errors such as:
* the old compiler generates binaries without the executable stack bit flag present to indicate whether an executable stack is needed; this is assumed to mean that it is needed.  You'll need to fix all the installed libraries, otherwise you'll get errors such as:
** foo: error while loading shared libraries: libfreetype.so.6: cannot enable executable stack as shared object requires: Invalid argument
** foo: error while loading shared libraries: libfreetype.so.6: cannot enable executable stack as shared object requires: Invalid argument
** Grab execstack.armel from http://people.mozilla.com/~vladimir/misc/execstack.armel (comes from the prelink package, but you have to rebuild a few things to build it)
** Grab execstack.armel from http://people.mozilla.com/~vladimir/misc/execstack.armel (comes from the prelink package, but you have to rebuild a few things to build it)
** apt-get install libelfg0
** fix up the libs in /lib and /usr/lib:
** ./execstack.armel /lib/*.so.[0-9] /usr/lib/*.so.[0-9]
*** cd /lib ; execstack -c `find . -name \*.so.\* -type f`
*** cd /usr/lib ; execstack -c `find . -name \*.so.\* -type f`


* You should be good to go; you'll need to manually build libIDL (packages to be provided soon)
* You should be good to go; you'll need to manually build libIDL (packages to be provided soon)
Line 45: Line 35:
== Mozilla Quirks ==
== Mozilla Quirks ==


* -fshort-wchar must not be specified, even though configure.in specifies it if it's available.  The maemo libs seem to be built with sizeof(wchar_t) == 4. See {{bug|423913}}.  Hack it out of configure.in.
* -rpath-link processing changed in gcc 4.2; you may need to add :/usr/lib:/lib to the -rpath-link args in configure.in (MOZ_EXTRA_LINK_FLAGS, iirc)
* -Werror is enabled in a few places, notably in netwerk/cookies -- but with gcc 4.2, we get a lot of warnings about "cast increases required alignment of target type", especially in nsVoidArray.h (cast from char* to nsVoidArray::Impl*).  Those need to be fixed, but in the meantime, get rid of the -Werror flag in configure.in.
* <strike>-fshort-wchar must not be specified, even though configure.in specifies it if it's available.  The maemo libs seem to be built with sizeof(wchar_t) == 4. See {{bug|423913}}.  Hack it out of configure.in -- or change the compile check to an AC_TRY_LINK (see bug).</strike>
* You'll need the workaround to avoid a NSS crash in {{bug|408071}}
* <strike>-Werror is enabled in a few places, notably in netwerk/cookies -- but with gcc 4.2, we get a lot of warnings about "cast increases required alignment of target type", especially in nsVoidArray.h (cast from char* to nsVoidArray::Impl*).  Those need to be fixed, but in the meantime, <strike>get rid of the -Werror flag in configure.in</strike> build with "make -s WARNINGS_AS_ERRORS="</strike>
* <strike>You'll need the workaround to avoid a NSS crash in {{bug|408071}}</strike>
* <strike>You'll need the patch to avoid miscompilation or failure to compile xpc stubs from {{bug|426563}}</strike>
 
== Qt Stuff ==
 
=== Qt Build ===
 
* [[http://trolltech.com/developer/downloads/qtopia/coregpl|Grab Qt/Embedded for linux]]
* ./configure -prefix /usr/local/qte -no-webkit -no-svg -plugin-mouse-tslib -embedded arm -nomake examples -nomake demos -nomake docs
** If you don't disable examples/demos, you'll have some build failures on examples due to not including svg; comment them out of the .pro files, or just skip the -no-svg
* Install, then copy over relevant stuff to device (e.g. skip debug files, docs, translations, etc.)
* Don't forget to set PKG_CONFIG_PATH=/usr/local/qte/lib/pkgconfig:/usr/lib/pkgconfig, PATH=/usr/local/qte/bin:$PATH, and LD_LIBRARY_PATH=/usr/local/qte/lib:$LD_LIBRARY_PATH when building stuff to use this install of Qt
 
=== On Device ===
 
* Assuming Qt/E is in /usr/local/qte...
* env vars:
** PATH=/usr/local/qte/bin:$PATH
** LD_LIBRARY_PATH=/usr/local/qte/lib:$LD_LIBRARY_PATH
** QWS_MOUSE_PROTO=Tslib
** TSLIB_TSDEVICE=/dev/input/event3
* You'll need an updated and/or rebuilt tslib, otherwise you'll get errors about ts_config failing and you won't be able to use the mouse -- see patch at https://lists.berlios.de/pipermail/tslib-general/2007-February/000002.html
* You'll want to build something like [[http://people.mozilla.com/~vladimir/misc/omap-fb.c|omap-fb.c]] ([[http://people.mozilla.com/~vladimir/misc/omap-fb|armel build]]) for turning off manual updates for omapfb.  Run "./omap-fb auto".
* X runs on VT 2; change to VT 3 first:
** chvt 3
* Fire up some app to run as a window server:
** pixeltool -qws
* When the windowserver app exists, switch back to the X VT:
** chvt 2

Latest revision as of 07:49, 9 July 2008

Environment Setup

  • Ubuntu 7.04 as host; should work fine with others, but I'm using preexisting debs here.
  • use sb-menu to configure a new target
    • select the 2007q3 compiler
    • select cputransp, debian-etch, maemo-tools, and perl devkits
    • select qemu-0.8.2-sb2 as cpu transparency method (qemu-cvs has problems)
    • install the rootstrap you selected
    • install the C library, /etc, and fakeroot
    • select the new target
  • ensure the base stuff works; create foo.c: '#include <stdio.h>\n int main(int argc, char **argv) { printf("hello world\n"); }'; gcc -o foo foo.c; ./foo
  • install packages inside scratchbox
    • ensure that 'deb http://repository.maemo.org/ chinook free non-free' and 'deb-src http://repository.maemo.org/ chinook free' are in /etc/apt/sources.list
    • there's a whole bunch of dev packages you need to pull in:
      • apt-get install libgtk2.0-dev libxaw7-dev libfreetype6-dev libxi-dev
      • (might be some more missing, install as necessary)
  • the old compiler generates binaries without the executable stack bit flag present to indicate whether an executable stack is needed; this is assumed to mean that it is needed. You'll need to fix all the installed libraries, otherwise you'll get errors such as:
    • foo: error while loading shared libraries: libfreetype.so.6: cannot enable executable stack as shared object requires: Invalid argument
    • Grab execstack.armel from http://people.mozilla.com/~vladimir/misc/execstack.armel (comes from the prelink package, but you have to rebuild a few things to build it)
    • fix up the libs in /lib and /usr/lib:
      • cd /lib ; execstack -c `find . -name \*.so.\* -type f`
      • cd /usr/lib ; execstack -c `find . -name \*.so.\* -type f`
  • You should be good to go; you'll need to manually build libIDL (packages to be provided soon)

Mozilla Quirks

  • -rpath-link processing changed in gcc 4.2; you may need to add :/usr/lib:/lib to the -rpath-link args in configure.in (MOZ_EXTRA_LINK_FLAGS, iirc)
  • -fshort-wchar must not be specified, even though configure.in specifies it if it's available. The maemo libs seem to be built with sizeof(wchar_t) == 4. See bug 423913. Hack it out of configure.in -- or change the compile check to an AC_TRY_LINK (see bug).
  • -Werror is enabled in a few places, notably in netwerk/cookies -- but with gcc 4.2, we get a lot of warnings about "cast increases required alignment of target type", especially in nsVoidArray.h (cast from char* to nsVoidArray::Impl*). Those need to be fixed, but in the meantime, get rid of the -Werror flag in configure.in build with "make -s WARNINGS_AS_ERRORS="
  • You'll need the workaround to avoid a NSS crash in bug 408071
  • You'll need the patch to avoid miscompilation or failure to compile xpc stubs from bug 426563

Qt Stuff

Qt Build

  • [Qt/Embedded for linux]
  • ./configure -prefix /usr/local/qte -no-webkit -no-svg -plugin-mouse-tslib -embedded arm -nomake examples -nomake demos -nomake docs
    • If you don't disable examples/demos, you'll have some build failures on examples due to not including svg; comment them out of the .pro files, or just skip the -no-svg
  • Install, then copy over relevant stuff to device (e.g. skip debug files, docs, translations, etc.)
  • Don't forget to set PKG_CONFIG_PATH=/usr/local/qte/lib/pkgconfig:/usr/lib/pkgconfig, PATH=/usr/local/qte/bin:$PATH, and LD_LIBRARY_PATH=/usr/local/qte/lib:$LD_LIBRARY_PATH when building stuff to use this install of Qt

On Device

  • Assuming Qt/E is in /usr/local/qte...
  • env vars:
    • PATH=/usr/local/qte/bin:$PATH
    • LD_LIBRARY_PATH=/usr/local/qte/lib:$LD_LIBRARY_PATH
    • QWS_MOUSE_PROTO=Tslib
    • TSLIB_TSDEVICE=/dev/input/event3
  • You'll need an updated and/or rebuilt tslib, otherwise you'll get errors about ts_config failing and you won't be able to use the mouse -- see patch at https://lists.berlios.de/pipermail/tslib-general/2007-February/000002.html
  • You'll want to build something like [[1]] ([build]) for turning off manual updates for omapfb. Run "./omap-fb auto".
  • X runs on VT 2; change to VT 3 first:
    • chvt 3
  • Fire up some app to run as a window server:
    • pixeltool -qws
  • When the windowserver app exists, switch back to the X VT:
    • chvt 2