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