]>
Commit | Line | Data |
---|---|---|
1b577b00 | 1 | README for BINUTILS |
252b5132 | 2 | |
1b577b00 NC |
3 | These are the GNU binutils. These are utilities of use when dealing |
4 | with binary files, either object files or executables. These tools | |
5 | consist of the linker (ld), the assembler (gas), and the profiler | |
6 | (gprof) each of which have their own sub-directory named after them. | |
7 | There is also a collection of other binary tools, including the | |
8 | disassembler (objdump) in this directory. These tools make use of a | |
9 | pair of libraries (bfd and opcodes) and a common set of header files | |
10 | (include). | |
252b5132 | 11 | |
1b577b00 NC |
12 | There are README and NEWS files in most of the program sub-directories |
13 | which give more information about those specific programs. | |
252b5132 | 14 | |
252b5132 RH |
15 | |
16 | Unpacking and Installation -- quick overview | |
17 | ============================================ | |
18 | ||
1b577b00 NC |
19 | When you unpack the binutils archive file, you will get a directory |
20 | called something like `binutils-XXX', where XXX is the number of the | |
a99996bb | 21 | release. (Probably 2.13 or higher). This directory contains |
1b577b00 NC |
22 | various files and sub-directories. Most of the files in the top |
23 | directory are for information and for configuration. The actual | |
24 | source code is in sub-directories. | |
252b5132 RH |
25 | |
26 | To build binutils, you can just do: | |
27 | ||
1b577b00 | 28 | cd binutils-XXX |
252b5132 RH |
29 | ./configure [options] |
30 | make | |
31 | make install # copies the programs files into /usr/local/bin | |
32 | # by default. | |
33 | ||
34 | This will configure and build all the libraries as well as the | |
35 | assembler, the binutils, and the linker. | |
36 | ||
37 | If you have GNU make, we recommend building in a different directory: | |
38 | ||
39 | mkdir objdir | |
40 | cd objdir | |
1b577b00 | 41 | ../binutils-XXX/configure [options] |
252b5132 RH |
42 | make |
43 | make install | |
44 | ||
45 | This relies on the VPATH feature of GNU make. | |
46 | ||
47 | By default, the binutils will be configured to support the system on | |
48 | which they are built. When doing cross development, use the --target | |
1b577b00 NC |
49 | configure option to specify a different target, eg: |
50 | ||
51 | ./configure --target=foo-elf | |
252b5132 RH |
52 | |
53 | The --enable-targets option adds support for more binary file formats | |
54 | besides the default. List them as the argument to --enable-targets, | |
55 | separated by commas. For example: | |
56 | ||
57 | ./configure --enable-targets=sun3,rs6000-aix,decstation | |
58 | ||
1b577b00 | 59 | The name 'all' compiles in support for all valid BFD targets: |
252b5132 RH |
60 | |
61 | ./configure --enable-targets=all | |
62 | ||
1b577b00 NC |
63 | On 32-bit hosts though, this support will be restricted to 32-bit |
64 | target unless the --enable-64-bit-bfd option is also used: | |
65 | ||
66 | ./configure --enable-64-bit-bfd --enable-targets=all | |
67 | ||
252b5132 RH |
68 | You can also specify the --enable-shared option when you run |
69 | configure. This will build the BFD and opcodes libraries as shared | |
70 | libraries. You can use arguments with the --enable-shared option to | |
71 | indicate that only certain libraries should be built shared; for | |
72 | example, --enable-shared=bfd. The only potential shared libraries in | |
73 | a binutils release are bfd and opcodes. | |
74 | ||
75 | The binutils will be linked against the shared libraries. The build | |
1b577b00 | 76 | step will attempt to place the correct library in the run-time search |
252b5132 RH |
77 | path for the binaries. However, in some cases, after you install the |
78 | binaries, you may have to set an environment variable, normally | |
79 | LD_LIBRARY_PATH, so that the system can find the installed libbfd | |
80 | shared library. | |
81 | ||
82 | To build under openVMS/AXP, see the file makefile.vms in the top level | |
83 | directory. | |
84 | ||
1b577b00 | 85 | |
a99996bb NC |
86 | Native Language Support |
87 | ======================= | |
88 | ||
89 | By default Native Language Support will be enabled for binutils. On | |
90 | some systems however this support is not present and can lead to error | |
91 | messages such as "undefined reference to `libintl_gettext'" when | |
92 | building there tools. If that happens the NLS support can be disabled | |
93 | by adding the --disable-nls switch to the configure line like this: | |
94 | ||
95 | ../binutils-XXX/configure --disable-nls | |
96 | ||
97 | ||
252b5132 RH |
98 | If you don't have ar |
99 | ==================== | |
100 | ||
1b577b00 | 101 | If your system does not already have an 'ar' program, the normal |
252b5132 RH |
102 | binutils build process will not work. In this case, run configure as |
103 | usual. Before running make, run this script: | |
104 | ||
105 | #!/bin/sh | |
106 | MAKE_PROG="${MAKE-make}" | |
107 | MAKE="${MAKE_PROG} AR=true LINK=true" | |
108 | export MAKE | |
109 | ${MAKE} $* all-libiberty | |
110 | ${MAKE} $* all-intl | |
111 | ${MAKE} $* all-bfd | |
112 | cd binutils | |
113 | MAKE="${MAKE_PROG}" | |
114 | export MAKE | |
08213ebb | 115 | ${MAKE} $* ar_DEPENDENCIES= ar_LDADD='../bfd/*.o ../libiberty/*.o `if test -f ../intl/gettext.o; then echo '../intl/*.o'; fi`' ar |
252b5132 RH |
116 | |
117 | This script will build an ar program in binutils/ar. Move binutils/ar | |
118 | into a directory on your PATH. After doing this, you can run make as | |
119 | usual to build the complete binutils distribution. You do not need | |
120 | the ranlib program in order to build the distribution. | |
121 | ||
122 | Porting | |
123 | ======= | |
124 | ||
a99996bb | 125 | Binutils-2.13 supports many different architectures, but there |
252b5132 | 126 | are many more not supported, including some that were supported |
1b577b00 NC |
127 | by earlier versions. We are hoping for volunteers to improve this |
128 | situation. | |
252b5132 RH |
129 | |
130 | The major effort in porting binutils to a new host and/or target | |
131 | architecture involves the BFD library. There is some documentation | |
132 | in ../bfd/doc. The file ../gdb/doc/gdbint.texinfo (distributed | |
effb0601 | 133 | with gdb-5.x) may also be of help. |
252b5132 RH |
134 | |
135 | Reporting bugs | |
136 | ============== | |
137 | ||
1b577b00 NC |
138 | Send bug reports and patches to: |
139 | ||
1f554c69 | 140 | [email protected]. |
1b577b00 NC |
141 | |
142 | Always mention the version number you are running; this is printed by | |
143 | running any of the binutils with the --version option. We appreciate | |
144 | reports about bugs, but we do not promise to fix them. | |
252b5132 RH |
145 | |
146 | VMS | |
147 | === | |
148 | ||
149 | This section was written by Klaus K"ampf <[email protected]>. It | |
150 | describes how to build and install the binutils on openVMS (Alpha and | |
151 | Vax). (The BFD library only supports reading Vax object files.) | |
152 | ||
153 | Compiling the release: | |
154 | ||
155 | To compile the gnu binary utilities and the gnu assembler, you'll | |
156 | need DEC C or GNU C for openVMS/Alpha. You'll need *both* compilers | |
157 | on openVMS/Vax. | |
158 | ||
159 | Compiling with either DEC C or GNU C works on openVMS/Alpha only. Some | |
160 | of the opcodes and binutils files trap a bug in the DEC C optimizer, | |
161 | so these files must be compiled with /noopt. | |
162 | ||
163 | Compiling on openVMS/Vax is a bit complicated, as the bfd library traps | |
164 | a bug in GNU C and the gnu assembler a bug in (my version of) DEC C. | |
165 | ||
166 | I never tried compiling with VAX C. | |
167 | ||
168 | ||
169 | You further need GNU Make Version 3.76 or later. This is available | |
170 | at ftp.progis.de or any GNU archive site. The makefiles assume that | |
171 | gmake starts gnu make as a foreign command. | |
172 | ||
173 | If you're compiling with DEC C or VAX C, you must run | |
174 | ||
175 | $ @setup | |
176 | ||
177 | before starting gnu-make. This isn't needed with GNU C. | |
178 | ||
179 | On the Alpha you can choose the compiler by editing the toplevel | |
180 | makefile.vms. Either select CC=cc (for DEC C) or CC=gcc (for GNU C) | |
181 | ||
182 | ||
183 | Installing the release | |
184 | ||
185 | Provided that your directory setup conforms to the GNU on openVMS | |
1b577b00 | 186 | standard, you already have a concealed device named 'GNU_ROOT'. |
252b5132 RH |
187 | In this case, a simple |
188 | ||
189 | $ gmake install | |
190 | ||
191 | suffices to copy all programs and libraries to the proper directories. | |
192 | ||
193 | Define the programs as foreign commands by adding these lines to your | |
194 | login.com: | |
195 | ||
196 | $ gas :== $GNU_ROOT:[bin]as.exe | |
197 | $ size :== $GNU_ROOT:[bin]size.exe | |
198 | $ nm :== $GNU_ROOT:[bin]nm.exe | |
199 | $ objdump :== $GNU_ROOT:[bin]objdump.exe | |
200 | $ strings :== $GNU_ROOT:[bin]strings.exe | |
201 | ||
202 | If you have a different directory setup, copy the binary utilities | |
203 | ([.binutils]size.exe, [.binutils]nm.exe, [.binutils]objdump.exe, | |
204 | and [.binutils]strings.exe) and the gnu assembler and preprocessor | |
205 | ([.gas]as.exe and [.gas]gasp.exe]) to a directory of your choice | |
206 | and define all programs as foreign commands. | |
207 | ||
208 | ||
1b577b00 | 209 | If you're satisfied with the compilation, you may want to remove |
252b5132 RH |
210 | unneeded objects and libraries: |
211 | ||
212 | $ gmake clean | |
213 | ||
214 | ||
215 | If you have any problems or questions about the binutils on VMS, feel | |
216 | free to mail me at [email protected]. |