@@ -3290,11 +3290,6 @@ const CsuObjects = struct {
3290
3290
}
3291
3291
// Bundled glibc only has Scrt1.o .
3292
3292
if (result .crt0 != null and link_options .target .isGnuLibC ()) result .crt0 = "Scrt1.o" ;
3293
- // Target linux does not currently support host system toolchain/libc which
3294
- // supplies crt begin/end objects so we must disable linking them.
3295
- // We leave the above switch data fully populated for future purposes.
3296
- result .crtbegin = null ;
3297
- result .crtend = null ;
3298
3293
},
3299
3294
.dragonfly = > switch (mode ) {
3300
3295
// zig fmt: off
@@ -3334,28 +3329,17 @@ const CsuObjects = struct {
3334
3329
},
3335
3330
else = > {},
3336
3331
}
3337
-
3338
- // Bundled { glibc, musl } do not supply begin/end objects.
3339
- if (comp .wantBuildLibCFromSource ()) {
3340
- result .crtbegin = null ;
3341
- result .crtend = null ;
3342
- }
3343
-
3344
- // Musl does not supply crti/crtn for all architectures.
3345
- if (link_options .target .isMusl () and ! musl .libc_needs_crti_crtn (link_options .target )) {
3346
- result .crti = null ;
3347
- result .crtn = null ;
3348
- }
3349
3332
}
3350
3333
3351
3334
// Convert each object to a full pathname.
3352
- if (comp .wantBuildGLibCFromSource () or
3353
- comp .wantBuildMuslFromSource () or
3354
- comp .wantBuildMinGWFromSource ())
3355
- {
3335
+ if (link_options .libc_installation == null ) {
3356
3336
inline for (std .meta .fields (@TypeOf (result ))) | f ,i | {
3357
3337
if (@field (result , f .name )) | * obj | {
3358
- obj .* = comp .crt_files .get (obj .* ).? .full_object_path ;
3338
+ if (comp .crt_files .get (obj .* )) | crtf | {
3339
+ obj .* = crtf .full_object_path ;
3340
+ } else {
3341
+ @field (result , f .name ) = null ;
3342
+ }
3359
3343
}
3360
3344
}
3361
3345
} else {
@@ -3380,7 +3364,11 @@ const CsuObjects = struct {
3380
3364
else = > {
3381
3365
inline for (std .meta .fields (@TypeOf (result ))) | f ,i | {
3382
3366
if (@field (result , f .name )) | * obj | {
3383
- obj .* = try fs .path .join (arena , &[_ ][]const u8 { crt_dir_path , obj .* });
3367
+ if (comp .crt_files .get (obj .* )) | crtf | {
3368
+ obj .* = crtf .full_object_path ;
3369
+ } else {
3370
+ @field (result , f .name ) = null ;
3371
+ }
3384
3372
}
3385
3373
}
3386
3374
}
0 commit comments