summaryrefslogtreecommitdiff
path: root/open_issues/binutils.mdwn
blob: 757ebbe9363de3bac099dad91d539a9faa903739 (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
[[!meta copyright="Copyright © 2007, 2008, 2010, 2011, 2012, 2013 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

<!--

git checkout reviewed
git log --reverse --topo-order --pretty=fuller --stat=$COLUMNS,$COLUMNS -w -p -C --cc ..sourceware/master
-i
/^commit |^merge:|^---$|hurd|linux|nacl|nptl|glibc|gs:

-->

Last reviewed up to the [[Git mirror's 944a6010b676b9f80f0a16c65183102b187822c5
(2013-02-08) sources|source_repositories/binutils]].

  * Globally

      * a.out (such as `ld/emulparams/i386linux.sh`, `ld/emultempl/linux.em`,
        etc.), 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 they 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.

  * `__ehdr_start symbol`, c84ed8d89d0b8bf5a2968d465f77ac24bcfc40c2 -- can this
    be helpful in the exec server, glibc, or elsewhere?  Used in GDB (BFD)
    commit bdbd9758806ed855af89244870fdc52cf3ff09bc.

  * `Add HOSTING_SCRT0 for PIE test`, 49cc20aa5c416ea4307931cccf6353247368187d
    -- is for GNU/Linux only; but also seems unused.


# Build

Here's a log of a binutils build run; this is from our [[Git
repository|source_repositories/binutils]]'s `tschwinge/Paul_Desmond` branch,
commit 944a6010b676b9f80f0a16c65183102b187822c5 (2013-02-08), run on
kepler.SCHWINGE and coulomb.SCHWINGE.

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

Different hosts may default to different shells and compiler versions; thus
harmonized.  Debian GCC (which is used in binutils' testsuite) likes to pass
`--sysroot=/` to `ld`, so we need to configure binutils with support for
sysroots.

This takes up around 900 MiB, and needs roughly 11 min on kepler.SCHWINGE and
42 min on coulomb.SCHWINGE.

<!--

    $ (make && touch .go-install) 2>&1 | tee log_build_ && test -f .go-install && (make install && touch .go-test) 2>&1 | tee log_install && test -f .go-test && make -k check 2>&1 | tee log_test

-->


## 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.

    $ toolchain/logs/process binutils build

  * gold GNU/Linux vs. GNU/Hurd

        -checking for glibc ifunc support... both
        +checking for glibc ifunc support... dyn

    Missing [[IFUNC]] support on GNU/Hurd.


# Install

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

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


## Analysis

    $ toolchain/logs/process binutils install

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


# Testsuite

    $ make -k check 2>&1 | tee log_test
    [...]

This needs roughly 6 min on kepler.SCHWINGE and 42 min on coulomb.SCHWINGE.


## Analysis

    $ toolchain/logs/process binutils test

  * <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?  Or, something similar to commit
    49cc20aa5c416ea4307931cccf6353247368187d `Add HOSTING_SCRT0 for PIE test`
    can be used.

    Same issue for `FAIL: Common symbol override ifunc *` ones?

  * <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.

  * `FAIL: gas/i386/rept`

    Added in commit 06f1247c54126b9f1e6acb8ff8c7be35aec6f44c (2012-06-07) as
    part of the fix for [[!sourceware_PR 14201]], renamed in commit
    d654e24bbc2f601df4dc43b26049b0339528b93a (2012-06-07):

        WARNING: program timed out.
        FAIL: gas/i386/rept

  * ld IFUNC execution tests

    Missing [[IFUNC]] support on GNU/Hurd.

    Added in commit 82c5587db078581cfe94a4385ed99de1d1fa6657 (2012-09-19):

        FAIL: Common symbol override ifunc test 1a
        FAIL: Common symbol override ifunc test 1b

  * gold GNU/Linux vs. GNU/Hurd

        -FAIL: relro_test.sh
        +PASS: relro_test.sh

        -PASS: ver_matching_test.sh
        +FAIL: ver_matching_test.sh

        -PASS: script_test_3
        +FAIL: script_test_3

        -PASS: tls_phdrs_script_test
        +FAIL: tls_phdrs_script_test

        -PASS: ifuncmain1static
        -PASS: ifuncmain1picstatic
        -PASS: ifuncmain2static
        -PASS: ifuncmain2picstatic
        -PASS: ifuncmain4static
        -PASS: ifuncmain4picstatic
        -PASS: ifuncmain5static
        -PASS: ifuncmain5picstatic
        -PASS: ifuncmain7static
        -PASS: ifuncmain7picstatic