FreeCalypso > hg > freecalypso-tools
annotate doc/Loadtools-on-GTA0x @ 465:003e48f8ebe1
rvinterf/etmsync/fsnew.c: cast 0 to (char *) for execl sentinel
I generally don't use NULL and use plain 0 instead, based on a "NULL
considered harmful" discussion on the classiccmp mailing list many aeons
ago (I couldn't find it, and I reason that it must have been 2005 or
earlier), but a recent complaint by a packager sent me searching, and I
found this:
https://ewontfix.com/11/
While I don't give a @#$% about "modern" systems and code-nazi tools,
I realized that passing a plain 0 as a pointer sentinel in execl is wrong
because it will break on systems where pointers are longer than the plain
int type. Again, I don't give a @#$% about the abomination of x86_64 and
the like, but if anyone ever manages to port my code to something like a
PDP-11 (16-bit int, 32-bit long and pointers), then passing a plain 0
as a function argument where a pointer is expected most definitely won't
work: if the most natural stack slot and SP alignment unit is 16 bits,
fitting an int, with longs and pointers taking up two such slots, then
the call stack will be totally wrong with a plain 0 passed for a pointer.
Casting the 0 to (char *) ought to be the most kosher solution for the
most retro systems possible.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 11 Feb 2019 00:00:19 +0000 |
parents | 1a658ab756fe |
children |
rev | line source |
---|---|
215
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 FreeCalypso loadtools are currently a part of FC host tools, but they used to |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 be a separate package. In those days that separate package of loadtools could |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 be built in two ways: |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 1) One could compile and install loadtools on a general-purpose host system |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 such as a GNU/Linux PC or laptop, and then potentially use them to operate |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 on multiple Calypso targets of different kinds. |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 2) One could compile loadtools to run on the application processor of a |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 smartphone such as Openmoko GTA0x, in which case it makes no sense for that |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 special build of loadtools to support any target other than the specific |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 modem in that smartphone. |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 Loadtools can be built with compalstage support excluded and with |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 GTA0x-specific modem power control included instead. This build will still |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 include a bunch of functions of no relevance to GTA0x, but oh well.. |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 To build loadtools for the GTA0x AP, you'll need to make the following |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 modifications to loadtools/Makefile: |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 * Change the CC= line to point to the appropriate cross-compiler (which you'll |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 need to provide yourself). |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 * Change the CFLAGS= line: add the right options to target the ARM920T core in |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 the GTA0x AP (e.g., -march=armv4t -mtune=arm920t), and add -DGTA0x_AP_BUILD |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 to enable some code that makes sense only when running on the GTA0x AP. |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 * Change the PROGS= line to not build fc-compalram or fc-buzplay: the latter |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 utilities are not applicable to GTA0x. |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 * Change EXTRA_OBJ= from listing compalload.o to listing compaldummy.o and |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 gtapower.o instead. |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 |
1a658ab756fe
doc/Loadtools-on-GTA0x article added, replacing the corresponding section
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 See loadtools/gta-ap-build.sed for an example. |