summaryrefslogtreecommitdiff
path: root/open_issues/binutils.mdwn
blob: 5123a0d33ae8b6de4f34457e324de718b36222e6 (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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
[[!meta copyright="Copyright © 2007, 2008, 2010, 2011 Free Software Foundation,
Inc."]]

[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
id="license" text="Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no Invariant
Sections, no Front-Cover Texts, and no Back-Cover Texts.  A copy of the license
is included in the section entitled [[GNU Free Documentation
License|/fdl]]."]]"""]]

[[!tag stable_URL open_issue_binutils]]

Here's what's to be done for maintaining GNU Binutils.

As these tools primarily deal with low-level parts of the target architecture
and the object file format (ELF ABI), which are essentially (at least meant to
be) the same, there shouldn't be many differences comparing the binutils
between the GNU/Hurd and GNU/Linux ports, for example.  There are a few,
though, as explained below.

[[!toc levels=2]]


# [[General information|/binutils]]


# [[Sources|source_repositories/binutils]]


# Configuration

Last reviewed up to the [[Git mirror's 38b56eda7ea117def3d5075110c0221fa1989878
(2011-06-18) sources|source_repositories/binutils]].

  * Open Issues

      * 51b2f560ad035dffad3371093f8e5c80608d196c: [[toolchain/ELFOSABI_HURD]].

      * 0df7bac224004772a380db3e3b29933c16411940: restricts tests to
        `*-*-linux*`.  [Patch
        posted](http://sourceware.org/ml/binutils/2011-06/msg00217.html).

  * Globally

      * a.out, COFF, PE image support and 64 bit support are not interesting.

      * In the testsuites, `.exp` and `.d` files very likely should not only
        care for `*-*-linux*`, but also `*-*-gnu*`.  (If the need to be
        conditionalized like this at all.)

  * `bfd/`

      * `config.bfd`

          * `i[3-7]86-*-gnu*`

            Comparing to `i[3-7]86-*-linux-*`:

              * `i386linux_vec` -- a.out.

              * `i386pei_vec` -- PE.

              * 64 bit.

      * `configure.host`

        Souldn't need anything.  x86 Linux neither.

      * `configure.in`

        Linux:

          * `COREFILE=trad-core.lo` with `TRAD_HEADER='"hosts/i386linux.h"'`

            We don't have any such core file support configured.  TODO: should
            we?  Where is this core file reading exactly used?  GDB?

          * `i386linux_vec` -- a.out.

          * `i386pei_vec` -- PE.

  * `binutils/`

      * `configure.tgt`

  * `gas/`

      * `config/te-gnu.h`

        C.f. `te-linux.h`; search tree for `TE_LINUX` vs. `TE_GNU` usage.

          * `tc-i386.h`

            Sole `TE_LINUX` usage is for a.out.

      * `configure.tgt`

  * `ld/`

     * `configure.host`

         * `*-*-gnu*`

            TODO: resolve `crt0.o` vs. `crt1.o` issue.  [[Testsuite
            failures|binutils#static]].

      * `configure.tgt`

          * `i[3-7]86-*-gnu*`

            Compare to `i[3-7]86-*-linux-*`, but don't need a.out (`i386linux`)
            and 64 bit support.


# Build

Here's a log of a binutils build run; this is from our [[Git repository's
ab9f9e3e30d95fe653957ce5f554a01dcd453370 (2011-06-19)
sources|source_repositories/binutils]], run on kepler.SCHWINGE and
coulomb.SCHWINGE.

    $ export LC_ALL=C
    $ ../master/configure --prefix="$PWD".install SHELL=/bin/dash CC=gcc-4.6 CXX=g++-4.6 2>&1 | tee log_build
    [...]
    $ make 2>&1 | tee log_build_
    [...]

(Different hosts may default to different shells and compiler versions; thus
harmonized.)

This takes up around 100 MiB, and needs roughly 4 min on kepler.SCHWINGE, and
15 min on coulomb.SCHWINGE.


## Analysis

x86 GNU/Linux and GNU/Hurd's configurations are slightly
different, thus mask out most of the differences that are due to
GNU/Linux supporting more core file formats, and more emulation vectors.

    $ diff -wu <(ssh kepler.SCHWINGE 'cd tmp/source/binutils/ && cat hurd/master.build/log_build* | sed -e "s%\(/media/data\)\?${PWD}%[...]%g"' | sed -f open_issues/binutils/log_build-linux.sed) <(ssh coulomb.SCHWINGE 'cd tmp/binutils/ && cat hurd/master.build/log_build* | sed "s%\(/media/erich\)\?${PWD}%[...]%g"' | sed -f open_issues/binutils/log_build-hurd.sed) > open_issues/binutils/log_build.diff

[[log_build.diff]].


# Install

    $ make install 2>&1 | tee log_install
    [...]

This takes up around 60 MiB, and needs roughly 1 min on kepler.SCHWINGE, and 5
min on coulomb.SCHWINGE.


## Analysis

    $ diff -wu <(ssh kepler.SCHWINGE 'cd tmp/source/binutils/ && cat hurd/master.build/log_install | sed -e "s%\(/media/data\)\?${PWD}%[...]%g"' | sed -f open_issues/binutils/log_install-linux.sed) <(ssh coulomb.SCHWINGE 'cd tmp/binutils/ && cat hurd/master.build/log_install | sed "s%\(/media/erich\)\?${PWD}%[...]%g"' | sed -f open_issues/binutils/log_install-hurd.sed) > open_issues/binutils/log_install.diff

[[log_install.diff]].

  * `libtool: finish`: `ldconfig` is not run for the Hurd.


# Testsuite

    $ make -k check
    [...]

This needs roughly 5 min on kepler.SCHWINGE, and 15 min on coulomb.SCHWINGE.

    $ ssh kepler.SCHWINGE 'cd tmp/source/binutils/ && cat hurd/master.build/*/*.sum hurd/master.build/*/*/*.sum | sed -e "s%\(/media/data\)\?${PWD}%[...]%g"' > open_issues/binutils/sum_linux
    $ ssh coulomb.SCHWINGE 'cd tmp/binutils/ && cat hurd/master.build/*/*.sum hurd/master.build/*/*/*.sum | sed "s%\(/media/erich\)\?${PWD}%[...]%g"' > open_issues/binutils/sum_hurd

Comparing the results files, [[sum_linux]] to [[sum_hurd]]:

    $ diff -u -F ^Running open_issues/binutils/sum_linux open_issues/binutils/sum_hurd
    --- open_issues/binutils/sum_linux	2011-06-19 18:37:02.000000000 +0200
    +++ open_issues/binutils/sum_hurd	2011-06-19 20:40:21.000000000 +0200
    @@ -1,5 +1,5 @@
    -Test Run By thomas on Sun Jun 19 18:26:46 2011
    -Native configuration is i686-pc-linux-gnu
    +Test Run By thomas on Sun Jun 19 20:16:01 2011
    +Native configuration is i686-unknown-gnu0.3
     
     		=== binutils tests ===
     
    @@ -117,8 +117,8 @@ Running [...]/hurd/master/binutils/tests
     
     # of expected passes		86
     # of unsupported tests		2
    -Test Run By thomas on Sun Jun 19 18:27:17 2011
    -Native configuration is i686-pc-linux-gnu
    +Test Run By thomas on Sun Jun 19 20:17:58 2011
    +Native configuration is i686-unknown-gnu0.3
     
     		=== ld tests ===
     
    @@ -322,10 +322,10 @@ Running [...]/hurd/master/ld/testsuite/l
     PASS: PIE init array
     PASS: PIE fini array
     PASS: PIE init array mixed
    -PASS: static preinit array
    -PASS: static init array
    -PASS: static fini array
    -PASS: static init array mixed
    +XFAIL: static preinit array
    +XFAIL: static init array
    +XFAIL: static fini array
    +XFAIL: static init array mixed
     Running [...]/hurd/master/ld/testsuite/ld-elf/exclude.exp ...
     PASS: ld link shared library
     PASS: ld export symbols from archive
    @@ -579,8 +579,8 @@ Running [...]/hurd/master/ld/testsuite/l
     PASS: ELF DSO weak func last DSO
     PASS: ELF weak func first
     PASS: ELF weak func last
    -PASS: ELF weak func first DSO
    -PASS: ELF weak func last DSO
    +XFAIL: ELF weak func first DSO
    +XFAIL: ELF weak func last DSO
     PASS: ELF DSO weak data first
     PASS: ELF DSO weak data last
     PASS: ELF DSO weak data first DSO
    @@ -591,10 +591,10 @@ Running [...]/hurd/master/ld/testsuite/l
     PASS: ELF weak data last
     PASS: ELF weak data first common
     PASS: ELF weak data last common
    -PASS: ELF weak data first DSO
    -PASS: ELF weak data last DSO
    -PASS: ELF weak data first DSO common
    -PASS: ELF weak data last DSO common
    +XFAIL: ELF weak data first DSO
    +XFAIL: ELF weak data last DSO
    +XFAIL: ELF weak data first DSO common
    +XFAIL: ELF weak data last DSO common
     PASS: ELF DSO small bar (size)
     PASS: ELF DSO foo with small bar (size)
     PASS: ELF DSO big bar (size)
    @@ -921,13 +921,13 @@ Running [...]/hurd/master/ld/testsuite/l
     
     		=== ld Summary ===
     
    -# of expected passes		659
    -# of expected failures		8
    +# of expected passes		649
    +# of expected failures		18
     # of untested testcases		6
     [...]/hurd/master.build/ld/ld-new 2.21.52.20110618
     
    -Test Run By thomas on Sun Jun 19 18:26:56 2011
    -Native configuration is i686-pc-linux-gnu
    +Test Run By thomas on Sun Jun 19 20:16:27 2011
    +Native configuration is i686-unknown-gnu0.3
     
     		=== gas tests ===
     


## Analysis

  * <a name="static"><!-- stable_URL -->`FAIL: static [...]`</a>

    The testsuite isn't prepared for using `crt0.o` instead of `crt1.o`
    depending on whether a static or dynamic executable is created.  Documented
    in `ld/configure.host`.  Perhaps we should finally rewrite this messy code
    in glibc?

  * <a name="64ksec">`FAIL: ld-elf/64ksec`</a>

    On the idle grubber, this one takes a few minutes wall time to complete
    successfully ([[I/O system
    weakness|performance/io_system/binutils_ld_64ksec]]), so assuming some
    system load variation, the testsuite's timeout may trigger.

  * <a name="weak"><!-- stable_URL -->`FAIL: ELF weak [...]`</a>

    [[I|tschwinge]] suppose this is due to us having an override w.r.t. weak
    symbol handling in glibc, needed for our external [[/libpthread]].  TODO:
    document properly.