File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -215,9 +215,10 @@ static void construct_linker_job_elf(LinkJob *lj) {
215
215
lj->args .append (getLDMOption (&g->zig_target ));
216
216
217
217
bool is_lib = g->out_type == OutTypeLib;
218
- bool shared = !g->is_static && is_lib;
218
+ bool is_static = g->is_static || (!is_lib && g->link_libs_list .length == 0 );
219
+ bool shared = !is_static && is_lib;
219
220
Buf *soname = nullptr ;
220
- if (g-> is_static ) {
221
+ if (is_static) {
221
222
if (g->zig_target .arch .arch == ZigLLVM_arm || g->zig_target .arch .arch == ZigLLVM_armeb ||
222
223
g->zig_target .arch .arch == ZigLLVM_thumb || g->zig_target .arch .arch == ZigLLVM_thumbeb)
223
224
{
@@ -241,7 +242,7 @@ static void construct_linker_job_elf(LinkJob *lj) {
241
242
if (lj->link_in_crt ) {
242
243
const char *crt1o;
243
244
const char *crtbegino;
244
- if (g-> is_static ) {
245
+ if (is_static) {
245
246
crt1o = " crt1.o" ;
246
247
crtbegino = " crtbeginT.o" ;
247
248
} else {
@@ -292,7 +293,7 @@ static void construct_linker_job_elf(LinkJob *lj) {
292
293
lj->args .append (buf_ptr (g->libc_static_lib_dir ));
293
294
}
294
295
295
- if (!g-> is_static ) {
296
+ if (!is_static) {
296
297
if (g->dynamic_linker != nullptr ) {
297
298
assert (buf_len (g->dynamic_linker ) != 0 );
298
299
lj->args .append (" -dynamic-linker" );
@@ -344,7 +345,7 @@ static void construct_linker_job_elf(LinkJob *lj) {
344
345
345
346
// libc dep
346
347
if (g->libc_link_lib != nullptr ) {
347
- if (g-> is_static ) {
348
+ if (is_static) {
348
349
lj->args .append (" --start-group" );
349
350
lj->args .append (" -lgcc" );
350
351
lj->args .append (" -lgcc_eh" );
You can’t perform that action at this time.
0 commit comments