Skip to content

Commit 56121c8

Browse files
StormBytePPyuwata
authored andcommitted
boot: only link libgcc when compiler is gcc
When compiling in systems which do not have gcc installed (like a musl+llvm system) the forced linkage "-lgcc" is stopping it to compile. As when compiler is clang it do not need to link explicitelly to gcc I've modified meson to only link to gcc library when compiler is gcc. Closes: #35162
1 parent dcd9819 commit 56121c8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

meson.build

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ if get_option('mode') == 'developer' and get_option('debug')
178178
endif
179179

180180
efi_c_ld_args = [
181-
'-lgcc',
182181
'-nostdlib',
183182
'-static-pie',
184183
'-Wl,--entry=efi_main',
@@ -202,6 +201,11 @@ efi_c_ld_args = [
202201
'-z', 'separate-code',
203202
]
204203

204+
# Check if the compiler is GCC and then we link to lgcc in that case only
205+
if cc.get_id() == 'gcc'
206+
efi_c_ld_args += ['-lgcc']
207+
endif
208+
205209
efi_c_ld_args += cc.get_supported_link_arguments(
206210
# binutils >= 2.38
207211
'-Wl,-z,nopack-relative-relocs',

0 commit comments

Comments
 (0)