summaryrefslogtreecommitdiff
path: root/config/binutils/binutils.in
blob: 286ed4b54a9040304895cdc829bf86065c3b45c2 (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
# binutils options

comment "GNU binutils"

# gold only suports the listed architectures
config BINUTILS_GOLD_SUPPORTS_ARCH
    bool
    default y if ARCH_ARM
    default y if ARCH_X86

config BINUTILS_GOLD_SUPPORT
    bool
    default y
    depends on BINUTILS_GOLD_SUPPORTS_ARCH
    depends on ! STATIC_TOOLCHAIN

# Force using the BFD linker if needed. There are two options:
# - For some C libraries (eg. glibc at least), BFD ld must be
#   built and be selected by default.
# - For elf2flt, BFD ld must be the only linker built.
config BINUTILS_FORCE_LD_BFD_DEFAULT
    bool

config BINUTILS_FORCE_LD_BFD_ONLY
    bool

choice
    bool
    prompt "Linkers to enable"

config BINUTILS_LINKER_LD
    bool
    prompt "ld"
    help
      The historical, bfd linker.

config BINUTILS_LINKER_GOLD
    bool
    prompt "gold"
    depends on BINUTILS_GOLD_SUPPORT
    depends on !BINUTILS_FORCE_LD_BFD_DEFAULT && !BINUTILS_FORCE_LD_BFD_ONLY
    select BINUTILS_GOLD_INSTALLED
    help
      gold is a new, optimised, multi-threaded linker with support
      for plugins. Designed to be a drop-in replacement for the
      original linker, ld, it can be much faster, with a 5:1 or
      bigger ratio being not uncommon, YMMV.

config BINUTILS_LINKER_LD_GOLD
    bool
    prompt "ld, gold"
    depends on !BINUTILS_FORCE_LD_BFD_ONLY
    depends on BINUTILS_GOLD_SUPPORT
    select BINUTILS_GOLD_INSTALLED
    select BINUTILS_LINKER_BOTH
    help
      Both the historical ld and the new gold linkers will be
      installed, with ld being the default linker used.

      See help for gold, above.

config BINUTILS_LINKER_GOLD_LD
    bool
    prompt "gold, ld"
    depends on !BINUTILS_FORCE_LD_BFD_DEFAULT && !BINUTILS_FORCE_LD_BFD_ONLY
    depends on BINUTILS_GOLD_SUPPORT
    select BINUTILS_GOLD_INSTALLED
    select BINUTILS_LINKER_BOTH
    select BINUTILS_LD_WRAPPER if BINUTILS_FORCE_LD_BFD_DEFAULT
    help
      Both the historical ld and the new gold linkers will be
      installed, with gold being the default linker used.

      See help for gold, above.

endchoice # Enable linkers

if BINUTILS_LINKER_GOLD
comment "WARNING! gold is not capable of"
comment "|         building glibc!"
endif # BINUTILS_LINKER_GOLD

config BINUTILS_GOLD_INSTALLED
    bool

config BINUTILS_GOLD_THREADS
    bool
    prompt "|  Enable threaded gold"
    depends on BINUTILS_GOLD_INSTALLED
    help
      When configured with threads, gold can link in parallel,
      possibly cooperating with a make jobserver.

config BINUTILS_LINKER_BOTH
    bool

config BINUTILS_LINKERS_LIST
    string
    default "ld"        if BINUTILS_LINKER_LD
    default "gold"      if BINUTILS_LINKER_GOLD
    default "ld,gold"   if BINUTILS_LINKER_LD_GOLD
    default "gold,ld"   if BINUTILS_LINKER_GOLD_LD

config BINUTILS_LD_WRAPPER
    bool
    prompt "|  Add ld wrapper"
    depends on BINUTILS_LINKER_BOTH
    help
      Add an ld wrapper that calls to either gold or ld.

      By default, the wrapper will call to the default wrapper,
      but if you set the environment variable CTNG_LD_IS, you
      can change which linker will get called:
        CTNG_LD_IS=gold     will unconditionally call the gold linker
        CTNG_LD_IS=bfd      will unconditionally call the old bfd ld linker

config BINUTILS_LINKER_DEFAULT
    string
    default "bfd"   if BINUTILS_LINKER_LD || BINUTILS_LINKER_LD_GOLD
    default "gold"  if BINUTILS_LINKER_GOLD || BINUTILS_LINKER_GOLD_LD

config BINUTILS_PLUGINS
    bool
    prompt "Enable support for plugins"
    depends on ! STATIC_TOOLCHAIN
    help
      binutils can be extended through the use of plugins.
      Especially, gold can use the lto-plugin, as installed
      by gcc, to handle LTO.

config BINUTILS_RELRO
    tristate
    prompt "Enable -z relro in ELF linker by default" if BINUTILS_2_27_or_later
    default m
    help
      Setting this option forces "-z relro" by default in the ELF linker.
      Clearing this option forces "-z norelro" by default in the ELF linker.
      Setting this option to 'M' configures binutils with their internal
      default for the selected architecture.

config BINUTILS_DETERMINISTIC_ARCHIVES
    bool
    prompt "Enable deterministic archives by default"
    default y
    help
      Setting this option will enable deterministic mode by default (-D).
      ar and ranlib will use zero for UIDs, GIDs,
      timestamps, and use consistent file modes for all files.

config BINUTILS_EXTRA_CONFIG_ARRAY
    string
    prompt "binutils extra config"
    default ""
    help
      Extra flags passed onto ./configure when configuring

      You can enter multiple arguments here, and arguments can contain spaces
      if they are properly quoted (or escaped, but prefer quotes). Eg.:
          --with-foo="1st arg with 4 spaces" --with-bar=2nd-arg-without-space

config BINUTILS_FOR_TARGET
    bool
    prompt "binutils libraries for the target"
    depends on ! BARE_METAL
    help
      Some utilities may need binutils libraries to be available on
      the target, eg. oprofile.

if BINUTILS_FOR_TARGET

config BINUTILS_FOR_TARGET_IBERTY
    bool
    prompt "libiberty"
    default y

config BINUTILS_FOR_TARGET_BFD
    bool
    prompt "libbfd"
    default y

endif # BINUTILS_FOR_TARGET

if ARCH_BINFMT_FLAT

comment "elf2flt"

config ELF2FLT_REQUIRES
    def_bool y
    select ZLIB_NEEDED
    select BINUTILS_FORCE_LD_BFD_ONLY

source "config/versions/elf2flt.in"

config ELF2FLT_EXTRA_CONFIG_ARRAY
    string
    prompt "elf2flt extra config"
    default ""
    help
      Extra flags passed onto ./configure when configuring

      You can enter multiple arguments here, and arguments can contain spaces
      if they are properly quoted (or escaped, but prefer quotes). Eg.:
          --with-foo="1st arg with 4 spaces" --with-bar=2nd-arg-without-space

endif # ARCH_BINFMT_FLAT