Skip to content

Commit 7d8abbe

Browse files
committed
Update 'LLVM with Clang' linker options
Pass arguments to linker using "-Wl," prefix where necessary. Add "-fuse-ld=" option to allow selection of the GNU LD or LLVM LLD linker implementation explicitly. Remove obsolete "-verify-each", "-disable-internalize", "-disable-opt" and "-disable-inlining" options.
1 parent 85b3ed3 commit 7d8abbe

2 files changed

Lines changed: 45 additions & 60 deletions

File tree

llvm/org.eclipse.cdt.managedbuilder.llvm.ui/plugin.properties

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
###############################################################################
2-
# Copyright (c) 2010, 2025 Nokia Siemens Networks Oyj and others
2+
# Copyright (c) 2010, 2026 Nokia Siemens Networks Oyj and others
33
#
44
# This program and the accompanying materials
55
# are made available under the terms of the Eclipse Public License 2.0
@@ -11,6 +11,7 @@
1111
# Contributors:
1212
# Nokia Siemens Networks Oyj, initial LLVM support as an add-on to CDT
1313
# John Dallaway, add option for clang '-emit-llvm' (#1277)
14+
# John Dallaway, update linker options for clang (#1427)
1415
###############################################################################
1516

1617
# plugin names
@@ -150,20 +151,22 @@ Option.Posix.Archiver.print.contents=Print the table of contents
150151
#Option.Posix.Linker.NoStartFiles=Do not use standard start files (-nostartfiles)
151152
#Option.Posix.Linker.NoDefLibs=Do not use default libraries (-nodefaultlibs)
152153
#Option.Posix.Linker.NoStdLibs=No startup or default libs (-nostdlib)
153-
Option.Posix.Linker.Strip=Omit all debug and symbol information (-strip-all)
154-
Option.Posix.Linker.Strip.Debug=Omit all debug information (-strip-debug)
155-
Option.Posix.Linker.Stats=Print statistics
156-
Option.Posix.Linker.Verbose=Verbose mode
157-
Option.Posix.Linker.Verification=Verification pass
158-
Option.Posix.Linker.DisableInternalize=Disable Internalize
159-
Option.Posix.Linker.DisableOptimization=Disable Optimization
160-
Option.Posix.Linker.DisableInhiling=Disable Inhiling
154+
Option.Posix.Linker.Strip=Omit all debug and symbol information (-Wl,--strip-all)
155+
Option.Posix.Linker.Strip.Debug=Omit all debug information (-Wl,--strip-debug)
156+
Option.Posix.Linker.Stats=Print statistics (-Wl,--stats)
157+
Option.Posix.Linker.Verbose=Verbose mode (-Wl,--verbose)
158+
159+
Option.Posix.Linker.UseLd=Linker
160+
Option.Posix.Linker.UseLd.default=
161+
Option.Posix.Linker.UseLd.ld=GNU ld (-fuse-ld=ld)
162+
Option.Posix.Linker.UseLd.lld=LLVM lld (-fuse-ld=lld)
163+
161164
#Option.Posix.Linker.Static=No shared libraries (-static)
162165
#Option.Posix.Linker.XLinker=Other options (-Xlinker [option])
163166
Option.Posix.Linker.Flags=Linker flags
164167
Option.Posix.Libs=Libraries (-l)
165168
Option.Posix.Libsearch=Library search path (-L)
166-
Option.Posix.UserBcs=Other bytecode files
169+
Option.Posix.UserBcs=Other bitcode and object files
167170
#Option.Posix.Linker.Shared=Shared (-shared)
168171
#Option.Posix.Linker.SOName=Shared object name (-Wl,-soname=)
169172
#Option.Posix.Linker.Implib=Import Library name (-Wl,--out-implib=)
@@ -206,18 +209,18 @@ Option.Llvm.Assembler.version=Announce version (-v)
206209
#Option.MacOSX.Linker.Shared=Shared (-dynamiclib)
207210

208211
# Artifact types
209-
BuildProperty.type.name.bcexe=LLVM bytecode executable for LLI
210-
BuildProperty.type.name.bclib=LLVM bytecode library
212+
BuildProperty.type.name.bcexe=LLVM bitcode executable for LLI
213+
BuildProperty.type.name.bclib=LLVM bitcode library
211214

212215
# Content types
213-
ContentType.LlvmBytecodeFileName=LLVM bytecode file
216+
ContentType.LlvmBytecodeFileName=LLVM bitcode file
214217
#LLVM assembler file (human-readable)
215218
ContentType.LlvmSourceFileName=LLVM
216219
ContentType.LlvmExecutableFileName=LLVM executable
217220
ContentType.LlvmAssemblerCode=LLVM Assembly Code
218221

219222
# Languages
220-
Language.LlvmAssembly=LLVM bytecode assembly
223+
Language.LlvmAssembly=LLVM bitcode assembly
221224

222225
option.name = Clang Option
223226
page.name = LLVM
@@ -228,10 +231,6 @@ extension.name.2 = LLVM-GCC managed make per project SCD profile
228231
option.tip = In this mode the linker will print additional information about the actions it takes, programs it executes, etc.
229232
option.tip.0 = Strip all debug and symbol information from the executable to make it smaller.
230233
option.tip.1 = Strip all debug information from the executable to make it smaller.
231-
option.tip.2 = Run the verification pass after each of the passes to verify intermediate results.
232-
option.tip.3 = Do not mark all symbols as internal.
233-
option.tip.4 = Completely disable optimization.
234-
option.tip.5 = Do not run the inlining pass. Functions will not be inlined into other functions.
235234
option.tip.6 = Generate a native machine code executable.
236235
option.tip.7 = Generate a native machine code executable with the LLVM C backend. Uses the C backend to generate code for the program instead of an LLVM native code generator.
237236
option.tip.8 = Link the bitcode files together as a library, not an executable. In this mode, undefined symbols will be permitted.
@@ -244,4 +243,5 @@ enumeratedOptionValue.name.0 = false
244243
option.tip.13 = Causes lli to generate software floating point library calls instead of equivalent hardware instructions.
245244
option.tip.14 = Causes lli to enable optimizations that may decrease floating point precision.
246245
option.tip.15 = Disable optimizations that may increase floating point precision.
247-
option.tip.16 = Enable optimizations that assumes only finite floating point math. That is, there is no NAN or Inf values.
246+
option.tip.16 = Enable optimizations that assumes only finite floating point math. That is, there is no NAN or Inf values.
247+
option.tip.useld = Select the linker implementation explicitly.

llvm/org.eclipse.cdt.managedbuilder.llvm.ui/plugin.xml

Lines changed: 26 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<?eclipse version="3.4"?>
33
<!--
4-
Copyright (c) 2010-2025 Nokia Siemens Networks Oyj and others
4+
Copyright (c) 2010, 2026 Nokia Siemens Networks Oyj and others
55
This program and the accompanying materials
66
are made available under the terms of the Eclipse Public License 2.0
77
which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@ SPDX-License-Identifier: EPL-2.0
1212
Contributors:
1313
Nokia Siemens Networks - initial implementation
1414
John Dallaway - add option for clang '-emit-llvm' (#1277)
15+
John Dallaway - update linker options for clang (#1427)
1516
-->
1617
<plugin>
1718
<extension
@@ -50,15 +51,35 @@ Contributors:
5051
</optionCategory>
5152
<option
5253
category="llvm.c.link.category.general"
53-
command="-stats"
54+
id="llvm.c.link.option.linker.useld"
55+
name="%Option.Posix.Linker.UseLd"
56+
tip="%option.tip.useld"
57+
valueType="enumerated">
58+
<enumeratedOptionValue
59+
name="%Option.Posix.Linker.UseLd.default"
60+
command=""
61+
isDefault="true"
62+
id="llvm.c.link.option.linker.useld.default" />
63+
<enumeratedOptionValue
64+
name="%Option.Posix.Linker.UseLd.ld"
65+
command="-fuse-ld=ld"
66+
id="llvm.c.link.option.linker.useld.ld" />
67+
<enumeratedOptionValue
68+
name="%Option.Posix.Linker.UseLd.lld"
69+
command="-fuse-ld=lld"
70+
id="llvm.c.link.option.linker.useld.lld" />
71+
</option>
72+
<option
73+
category="llvm.c.link.category.general"
74+
command="-Wl,--stats"
5475
defaultValue="false"
5576
id="llvm.c.link.option.stats"
5677
name="%Option.Posix.Linker.Stats"
5778
valueType="boolean">
5879
</option>
5980
<option
6081
category="llvm.c.link.category.general"
61-
command="-v"
82+
command="-Wl,--verbose"
6283
defaultValue="false"
6384
id="llvm.c.link.option.verbose"
6485
name="%Option.Posix.Linker.Verbose"
@@ -93,7 +114,7 @@ Contributors:
93114
</optionCategory>
94115
<option
95116
category="llvm.c.link.category.optimizations"
96-
command="-strip-all"
117+
command="-Wl,--strip-all"
97118
defaultValue="false"
98119
id="llvm.c.link.option.strip.debug"
99120
name="%Option.Posix.Linker.Strip"
@@ -102,49 +123,13 @@ Contributors:
102123
</option>
103124
<option
104125
category="llvm.c.link.category.optimizations"
105-
command="-strip-debug"
126+
command="-Wl,--strip-debug"
106127
defaultValue="false"
107128
id="llvm.c.link.option.strip"
108129
name="%Option.Posix.Linker.Strip.Debug"
109130
tip="%option.tip.1"
110131
valueType="boolean">
111132
</option>
112-
<option
113-
category="llvm.c.link.category.optimizations"
114-
command="-verify-each"
115-
defaultValue="false"
116-
id="llvm.c.link.option.verification"
117-
name="%Option.Posix.Linker.Verification"
118-
tip="%option.tip.2"
119-
valueType="boolean">
120-
</option>
121-
<option
122-
category="llvm.c.link.category.optimizations"
123-
command="-disable-internalize"
124-
defaultValue="false"
125-
id="llvm.c.link.option.disable_internalize"
126-
name="%Option.Posix.Linker.DisableInternalize"
127-
tip="%option.tip.3"
128-
valueType="boolean">
129-
</option>
130-
<option
131-
category="llvm.c.link.category.optimizations"
132-
command="-disable-opt"
133-
defaultValue="false"
134-
id="llvm.c.link.option.disable_optimization"
135-
name="%Option.Posix.Linker.DisableOptimization"
136-
tip="%option.tip.4"
137-
valueType="boolean">
138-
</option>
139-
<option
140-
category="llvm.c.link.category.optimizations"
141-
command="-disable-inlining"
142-
defaultValue="false"
143-
id="llvm.c.link.option.disable_inhiling"
144-
name="%Option.Posix.Linker.DisableInhiling"
145-
tip="%option.tip.5"
146-
valueType="boolean">
147-
</option>
148133
<option
149134
category="llvm.c.link.category.other"
150135
id="llvm.c.link.option.ldflags"

0 commit comments

Comments
 (0)