1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

builder: exclude LDFLAGS in .o builds (#15977)

This commit is contained in:
Larpon 2022-10-06 16:18:48 +02:00 committed by GitHub
parent 87a364ff24
commit 58bf2838c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -425,8 +425,8 @@ fn (v &Builder) all_args(ccoptions CcompilerOptions) []string {
// building an (.o) object file, that will be linked later. // building an (.o) object file, that will be linked later.
if v.pref.build_mode != .build_module { if v.pref.build_mode != .build_module {
all << ccoptions.linker_flags all << ccoptions.linker_flags
all << ccoptions.env_ldflags
} }
all << ccoptions.env_ldflags
return all return all
} }
@ -435,7 +435,9 @@ fn (v &Builder) thirdparty_object_args(ccoptions CcompilerOptions, middle []stri
all << ccoptions.env_cflags all << ccoptions.env_cflags
all << ccoptions.args all << ccoptions.args
all << middle all << middle
all << ccoptions.env_ldflags // NOTE do not append linker flags in .o build process,
// compilers are inconsistent about how they handle:
// all << ccoptions.env_ldflags
return all return all
} }