User:VladVukicevic/Maemo 2007q3

From MozillaWiki
Jump to: navigation, search

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, <strike>get rid of the -Werror flag in configure.in build with "make -s WARNINGS_AS_ERRORS="</strike>
  • 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