Mercurial > hg > index.cgi
annotate extra/README @ 409:c8ae69cdb5a9
Update gcc6809 patch to work with pragma=newsource
An updated version of the gcc6809 patch is provided. This update removes
some incompatible syntax left over from the original gcc6809 patch that used
as6809. It was doing something that doesn't work with lwtools anyway.
Namely, trying to use the assembler to set the layout used by the linker.
Now thats all back to front when you think about it.
With this update, it is now possible to use the "as" wrapper with
--pragma=newsource enabled and be able to pass assembly code through the C
preprocessor without worrying about extraneous spaces causing problems.
author | William Astle <lost@l-w.ca> |
---|---|
date | Thu, 03 Mar 2016 22:33:40 -0700 |
parents | d0c0fede5021 |
children | 40de99bde5e0 |
rev | line source |
---|---|
72
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
1 These files are extra utility type scripts that can be used for various |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
2 purposes. |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
3 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
4 as |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
5 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
6 This is a sort of front-end script that makes lwasm look approximately like |
182 | 7 gnu as which is useful for using lwasm as a backend to gcc. You may need to |
8 edit it to make it work fully. | |
72
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
9 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
10 ld |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
11 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
12 Similar to the "as" script above except for lwlink. |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
13 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
14 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
15 ar |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
16 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
17 Similar to the "as" script above except for lwar. |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
18 |
396
d0c0fede5021
Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
340
diff
changeset
|
19 gcc6809lw-*.patch |
182 | 20 |
21 These are patches to the main gcc source distribution for specific releases. | |
340
b0fb675d1ed4
Add gcc 4.6.4 version of gcc6809
William Astle <lost@l-w.ca>
parents:
196
diff
changeset
|
22 The last number after the dash is a patch level for the specific patch. It |
b0fb675d1ed4
Add gcc 4.6.4 version of gcc6809
William Astle <lost@l-w.ca>
parents:
196
diff
changeset
|
23 is worth noting that a patch for a particular minor version of GCC may work |
b0fb675d1ed4
Add gcc 4.6.4 version of gcc6809
William Astle <lost@l-w.ca>
parents:
196
diff
changeset
|
24 with later minor versions in the same release sequence. That is, a patch |
b0fb675d1ed4
Add gcc 4.6.4 version of gcc6809
William Astle <lost@l-w.ca>
parents:
196
diff
changeset
|
25 for 4.6.1 might work with 4.6.4. These are different to the official |
b0fb675d1ed4
Add gcc 4.6.4 version of gcc6809
William Astle <lost@l-w.ca>
parents:
196
diff
changeset
|
26 gcc6809 releases in the following ways. First, all the source for as-6809 |
b0fb675d1ed4
Add gcc 4.6.4 version of gcc6809
William Astle <lost@l-w.ca>
parents:
196
diff
changeset
|
27 is removed. Also, the special "helper" makefile and directory is removed. |
b0fb675d1ed4
Add gcc 4.6.4 version of gcc6809
William Astle <lost@l-w.ca>
parents:
196
diff
changeset
|
28 Also, as of this writing, the latest "official" release was for gcc 4.3.4 |
b0fb675d1ed4
Add gcc 4.6.4 version of gcc6809
William Astle <lost@l-w.ca>
parents:
196
diff
changeset
|
29 which does not build on 64 bit linux. |
182 | 30 |
196
83bb31ca8b6a
Elaborated the readme for the gcc6809 patch
William Astle <lost@l-w.ca>
parents:
182
diff
changeset
|
31 In the event you have used the "official" gcc6809 with the default as6809 |
83bb31ca8b6a
Elaborated the readme for the gcc6809 patch
William Astle <lost@l-w.ca>
parents:
182
diff
changeset
|
32 assembler that comes with it, you should be aware that while lwasm is mostly |
83bb31ca8b6a
Elaborated the readme for the gcc6809 patch
William Astle <lost@l-w.ca>
parents:
182
diff
changeset
|
33 compatible with it syntax wise, there are differences, particularly in |
83bb31ca8b6a
Elaborated the readme for the gcc6809 patch
William Astle <lost@l-w.ca>
parents:
182
diff
changeset
|
34 pseudo operations and source line syntax (most notably that you must have |
83bb31ca8b6a
Elaborated the readme for the gcc6809 patch
William Astle <lost@l-w.ca>
parents:
182
diff
changeset
|
35 whitespace preceeding assembler directives and instructions). You will |
83bb31ca8b6a
Elaborated the readme for the gcc6809 patch
William Astle <lost@l-w.ca>
parents:
182
diff
changeset
|
36 likely not run into these unless you are using inline asm. Refer to the |
83bb31ca8b6a
Elaborated the readme for the gcc6809 patch
William Astle <lost@l-w.ca>
parents:
182
diff
changeset
|
37 lwtools documentation for the specific line format required by lwasm. |
83bb31ca8b6a
Elaborated the readme for the gcc6809 patch
William Astle <lost@l-w.ca>
parents:
182
diff
changeset
|
38 |
83bb31ca8b6a
Elaborated the readme for the gcc6809 patch
William Astle <lost@l-w.ca>
parents:
182
diff
changeset
|
39 It is worth noting that neither gcc6809 nor lwtools comes with a standard C |
83bb31ca8b6a
Elaborated the readme for the gcc6809 patch
William Astle <lost@l-w.ca>
parents:
182
diff
changeset
|
40 library. |
83bb31ca8b6a
Elaborated the readme for the gcc6809 patch
William Astle <lost@l-w.ca>
parents:
182
diff
changeset
|
41 |
83bb31ca8b6a
Elaborated the readme for the gcc6809 patch
William Astle <lost@l-w.ca>
parents:
182
diff
changeset
|
42 It is also worth noting that for many projects, it will be more flexible to |
83bb31ca8b6a
Elaborated the readme for the gcc6809 patch
William Astle <lost@l-w.ca>
parents:
182
diff
changeset
|
43 invoke lwlink directly rather than using the ld script or gcc as a front |
83bb31ca8b6a
Elaborated the readme for the gcc6809 patch
William Astle <lost@l-w.ca>
parents:
182
diff
changeset
|
44 end. See the lwtools documentation for details on using lwlink. |
72
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
45 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
46 To use these scripts, you really need to understand how to build a gcc as a |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
47 cross compiler. The basics are that you put the as, ld, and ar scripts |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
48 whereever you plan to put your cross-development binaries. Then, when |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
49 building the cross compiler, you tell it where the scripts are. |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
50 |
196
83bb31ca8b6a
Elaborated the readme for the gcc6809 patch
William Astle <lost@l-w.ca>
parents:
182
diff
changeset
|
51 Please note that the following recipe is an example only. If you are |
83bb31ca8b6a
Elaborated the readme for the gcc6809 patch
William Astle <lost@l-w.ca>
parents:
182
diff
changeset
|
52 planning to install multiple instances of gcc6809 for different targets, you |
83bb31ca8b6a
Elaborated the readme for the gcc6809 patch
William Astle <lost@l-w.ca>
parents:
182
diff
changeset
|
53 will most certainly need to modify the steps below. Providing a complete |
83bb31ca8b6a
Elaborated the readme for the gcc6809 patch
William Astle <lost@l-w.ca>
parents:
182
diff
changeset
|
54 understanding of building a gcc toolchain for cross compilation is well |
83bb31ca8b6a
Elaborated the readme for the gcc6809 patch
William Astle <lost@l-w.ca>
parents:
182
diff
changeset
|
55 beyond the scope of this document. |
83bb31ca8b6a
Elaborated the readme for the gcc6809 patch
William Astle <lost@l-w.ca>
parents:
182
diff
changeset
|
56 |
83bb31ca8b6a
Elaborated the readme for the gcc6809 patch
William Astle <lost@l-w.ca>
parents:
182
diff
changeset
|
57 The following works for a single installation. |
72
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
58 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
59 1. Install the ar, as, and ld scripts named m6809-unknown-{as,ar,ld} in a |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
60 directory in your path, say /usr/local/coco/bin/. |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
61 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
62 2. Make symbolic links to /bin/true for similarly named nm, objdump, ranlib, |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
63 and strip in the same directory Some of these may not be necessary. |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
64 |
182 | 65 3. Unpack gcc and apply the gcc6809 patch. The gcc6809lw* patch file |
66 in this directory is known to work with these instructions. | |
72
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
67 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
68 4. Make sure /usr/local/coco/bin is in your PATH |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
69 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
70 5. Make sure "." is NOT in your path or is at the END of PATH. If you have |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
71 gazillions of errors pop up compiling "gemodes.c", this is your problem. |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
72 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
73 6. In a directory (other than the gcc source, say "gcc-build" at the same |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
74 level as the main gcc directory, do (assuming gcc 4.3.4): |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
75 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
76 configure --enable-languages=c --target=m6809-unknown \ |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
77 --program-prefix=m6809-unknown- --enable-obsolete \ |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
78 --srcdir=../gcc-4.3.4 --disable-threads --disable-nls \ |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
79 --disable-libssp --prefix=/usr/local/coco \ |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
80 --with-as=/usr/local/coco/bin/m6809-unknown-as \ |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
81 --with-ld=/usr/local/coco/bin/m6809-unknown-ld \ |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
82 --with-ar=/usr/local/coco/bin/m6809-unknown-ar |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
83 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
84 NOTE: the last three are required to prevent selection of the wrong binutils |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
85 programs at runtime. |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
86 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
87 --with-sysroot might be useful if you have a C library involved. |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
88 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
89 7. Run "make". If errors appear, troubleshoot. |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
90 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
91 8. Run "make install". Note that you will have to have your PATH variable |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
92 for "root" set up correctly if your install prefix requires root privileges. |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
93 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
94 The above is WOMM certified. YMMV. |
396
d0c0fede5021
Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
340
diff
changeset
|
95 |
d0c0fede5021
Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
340
diff
changeset
|
96 NOTES ABOUT SPECIFIC PATCHES |
d0c0fede5021
Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
340
diff
changeset
|
97 ============================ |
d0c0fede5021
Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
340
diff
changeset
|
98 |
d0c0fede5021
Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
340
diff
changeset
|
99 gcc6809lw-4.6.4-2.patch |
d0c0fede5021
Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
340
diff
changeset
|
100 |
d0c0fede5021
Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
340
diff
changeset
|
101 This patch essentially disables the "soft registers". These were causing |
d0c0fede5021
Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
340
diff
changeset
|
102 problems leading to compiler crashes. Removing the "t" constraint from |
d0c0fede5021
Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
340
diff
changeset
|
103 the instruction patterns allowed various issues to go away. It is not clear |
d0c0fede5021
Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
340
diff
changeset
|
104 if the original reasoning behind these soft registers is even valid any |
d0c0fede5021
Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
340
diff
changeset
|
105 more. |
d0c0fede5021
Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
340
diff
changeset
|
106 |
d0c0fede5021
Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
340
diff
changeset
|
107 Also fixes a clearly incorrect comparision when determining if a constant |
d0c0fede5021
Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
340
diff
changeset
|
108 fits in 16 bits. For clarity, both the 8 bit and 16 bit comparisons are |
d0c0fede5021
Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
340
diff
changeset
|
109 replaced with straight forward range comparisons rather than the excessively |
d0c0fede5021
Update to gcc6809lw patch which may help compilation of some sources
William Astle <lost@l-w.ca>
parents:
340
diff
changeset
|
110 clever scheme that was present before. |
409
c8ae69cdb5a9
Update gcc6809 patch to work with pragma=newsource
William Astle <lost@l-w.ca>
parents:
396
diff
changeset
|
111 |
c8ae69cdb5a9
Update gcc6809 patch to work with pragma=newsource
William Astle <lost@l-w.ca>
parents:
396
diff
changeset
|
112 gcc6809lw-4.6.4-3.patch |
c8ae69cdb5a9
Update gcc6809 patch to work with pragma=newsource
William Astle <lost@l-w.ca>
parents:
396
diff
changeset
|
113 |
c8ae69cdb5a9
Update gcc6809 patch to work with pragma=newsource
William Astle <lost@l-w.ca>
parents:
396
diff
changeset
|
114 This is identical to the -2 version except it fixes the crt0.S file so it |
c8ae69cdb5a9
Update gcc6809 patch to work with pragma=newsource
William Astle <lost@l-w.ca>
parents:
396
diff
changeset
|
115 builds properly with the --pragma=newsource option. In fact, it never did |
c8ae69cdb5a9
Update gcc6809 patch to work with pragma=newsource
William Astle <lost@l-w.ca>
parents:
396
diff
changeset
|
116 build properly due to spaces in operands anyway. However, since gcc6809 |
c8ae69cdb5a9
Update gcc6809 patch to work with pragma=newsource
William Astle <lost@l-w.ca>
parents:
396
diff
changeset
|
117 doesn't come with a C library, it hasn't proved to be an issue. |
c8ae69cdb5a9
Update gcc6809 patch to work with pragma=newsource
William Astle <lost@l-w.ca>
parents:
396
diff
changeset
|
118 |
c8ae69cdb5a9
Update gcc6809 patch to work with pragma=newsource
William Astle <lost@l-w.ca>
parents:
396
diff
changeset
|
119 Patches to provide a proper crt0.S file based around the actual way lwtools |
c8ae69cdb5a9
Update gcc6809 patch to work with pragma=newsource
William Astle <lost@l-w.ca>
parents:
396
diff
changeset
|
120 works will be considered. |
c8ae69cdb5a9
Update gcc6809 patch to work with pragma=newsource
William Astle <lost@l-w.ca>
parents:
396
diff
changeset
|
121 |
c8ae69cdb5a9
Update gcc6809 patch to work with pragma=newsource
William Astle <lost@l-w.ca>
parents:
396
diff
changeset
|
122 It's also worth noting that there are features inherited from previous |
c8ae69cdb5a9
Update gcc6809 patch to work with pragma=newsource
William Astle <lost@l-w.ca>
parents:
396
diff
changeset
|
123 versions of gcc6809 that are not properly supported by these patches. In |
c8ae69cdb5a9
Update gcc6809 patch to work with pragma=newsource
William Astle <lost@l-w.ca>
parents:
396
diff
changeset
|
124 particular, banking and "far calls" are not supported because there are no |
c8ae69cdb5a9
Update gcc6809 patch to work with pragma=newsource
William Astle <lost@l-w.ca>
parents:
396
diff
changeset
|
125 targets supported by lwtools that do anything meaningful in the face of such |
c8ae69cdb5a9
Update gcc6809 patch to work with pragma=newsource
William Astle <lost@l-w.ca>
parents:
396
diff
changeset
|
126 things. Patches to clean that up are also welcome. Either to do something |
c8ae69cdb5a9
Update gcc6809 patch to work with pragma=newsource
William Astle <lost@l-w.ca>
parents:
396
diff
changeset
|
127 meaningful or to remove such features entirely. |
c8ae69cdb5a9
Update gcc6809 patch to work with pragma=newsource
William Astle <lost@l-w.ca>
parents:
396
diff
changeset
|
128 |