summaryrefslogtreecommitdiff
path: root/qtopia-dev/document.en.rest.txt
blob: 55d42318cb84dd76733e92dfd16a9642ee9df3ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
Installing QTopia today
=======================
 
If you have `GCC 2.95.x`_ installed
===================================
 
You can just follow the instruction from `this how-to`_, and all will be good.
 
If you have a newer version
===========================
 
If for example you actually do C++ development, you can't use a GCC before 3.1, as it
would lack some fundamental components (stingstream, just to say one) and have several
quite big bugs.
 
Here lies the problem: the packages suggested by `the afore-mentioned how-to`_ are
compiled using GCC 2.95.2, and since the ABI has changed radically, programs compiled
with GCC 3.x will not link against those qt-embedded libraries.
 
So we just install GCC 2.95.2, right? **Wrong!** GCC 2.95.2 has a bug in the libio
library (basis for C++ streams) which makes it impossible to compile it against glibc
2.2 (and since you have an up-to-date GCC, I'm sure you'll have an up-to-date glibc,
too) (the type for file offsets has changed: from int to a struct containing two int,
to allow for 64 bit file positions). We need to use GCC 2.95.3, which contains a fix
for this problem (as far as I could see from the diff, it shouldn't support files
larger than 4GB, but since we are going to use to test programs intended for a Zaurus,
it's not such a limitation) (the ABI of .3 is the same as the .2 one)
 
Now we don't want 2.95 to overwrite our 3: we want to install it in a separate
directory. This is accomplished passing the --prefix option to the configure script.
 
Step-by-step instructions
-------------------------
 
Ready-made packages
```````````````````
 
Download:
 
*   `gcc 2.95.2 cross compiler x86-arm`_
 
*   `binutils 2.11.2 cross x86-arm`_
 
*   `glibc 2.2.2 arm`_
 
*   `header Linux 2.4.6 arm`_
 
*   `QTopia 1.5.0 free edition, both x86 and arm`_
 
Install all of them (using rpm, as root). Two directories will be created:
/opt/Embedix with the arm toolchain, and /opt/Qtopia with libraries and programs to
compile both for x86 and arm.
 
GCC
```
 
Download gcc-core-2.95.3.tar.gz and gcc-g++-2.95.3.tar.gz from a `GNU mirror`_.
 
To compile (I assume you put the GCC tarballs in /tmp):
 
*   cd /tmp
 
*   tar zxvf gcc-core-2.95.3.tar.gz;tar zxvf gcc-g++-2.95.3.tar.gz
 
*   mkdir gcc-obj;cd gcc-obj
 
*   ../gcc-2.95.3/configure --prefix=/opt/Embedix/native --enable-shared
 
*   make bootstrap
 
*   make install (this should be done as root, unless you gave your normal user write
    permissions on /opt/Embedix)
 
It might be a bit strange to put a native compiler under /opt/Embedix, but it looked
convenient, to make it clear in which context it is used.
 
Some script
```````````
 
A couple of scripts are very usefule to set up enviornment variables in the two cases:
native compilation (during development) and cross-compilation (at the end, to deploy
the program for the Zaurus).
 
Get them from Sharp: `dev-x86-qpe`_ and `dev-arm-qpe`_.
 
In dev-x86-qpe change the lines setting PATH and LD_LIBRARY_PATH with the following:
 
::
 
    PATH=$QTDIR/bin:$QPEDIR/bin:/opt/Embedix/tools/bin:/opt/Embedix/native/bin:${ORG_PATH}
    LD_LIBRARY_PATH=$QTDIR/lib:/opt/Embedix/native/lib:${ORG_LD_LIBRARY_PATH}
..
 
 
 
In this way you'll get the GCC 2.95.3 we just compiled.
 
.. _`dev-x86-qpe`:
    http://docs.zaurus.com/downloads/dev-x86-qpe.sh
 
.. _`binutils 2.11.2 cross x86-arm`:
    http://docs.zaurus.com/downloads/binutils-cross-arm-2.11.2-0.i386.rpm
 
.. _`gnu mirror`:
    http://www.gnu.org/server/list-mirrors.html
 
.. _`qtopia 1.5.0 free edition, both x86 and arm`:
    http://docs.zaurus.com/downloads/qtopia-free-1.5.0-1.i386.rpm
 
.. _`glibc 2.2.2 arm`:
    http://docs.zaurus.com/downloads/glibc-arm-2.2.2-0.i386.rpm
 
.. _`header linux 2.4.6 arm`:
    http://docs.zaurus.com/downloads/linux-headers-arm-sa1100-2.4.6-3.i386.rpm
 
.. _`the afore-mentioned how-to`:
    http://docs.zaurus.com/linux_compiler_setup_howto.shtml
 
.. _`this how-to`:
    http://docs.zaurus.com/linux_compiler_setup_howto.shtml
 
.. _`dev-arm-qpe`:
    http://docs.zaurus.com/downloads/dev-arm-qpe.sh
 
.. _`gcc 2.95.x`:
    http://gcc.gnu.org/gcc-2.95/
 
.. _`gcc 2.95.2 cross compiler x86-arm`:
    http://docs.zaurus.com/downloads/gcc-cross-sa1100-2.95.2-0.i386.rpm