@@ -3294,8 +3294,17 @@ const CsuObjects = struct {
3294
3294
.static_pie = > result .set ( "rcrt1.o" , "crti.o" , "crtbeginS.o" , "crtendS.o" , "crtn.o" ),
3295
3295
// zig fmt: on
3296
3296
}
3297
- // Bundled glibc only has Scrt1.o .
3298
- if (result .crt0 != null and link_options .target .isGnuLibC ()) result .crt0 = "Scrt1.o" ;
3297
+ if (link_options .libc_installation ) | _ | {
3298
+ // hosted-glibc provides crtbegin/end objects in platform/compiler-specific dirs
3299
+ // and they are not known at comptime. For now null-out crtbegin/end objects;
3300
+ // there is no feature loss, zig has never linked those objects in before.
3301
+ // TODO: probe for paths, ie. `cc -print-file-name`
3302
+ result .crtbegin = null ;
3303
+ result .crtend = null ;
3304
+ } else {
3305
+ // Bundled glibc only has Scrt1.o .
3306
+ if (result .crt0 != null and link_options .target .isGnuLibC ()) result .crt0 = "Scrt1.o" ;
3307
+ }
3299
3308
},
3300
3309
.dragonfly = > switch (mode ) {
3301
3310
// zig fmt: off
@@ -3359,11 +3368,7 @@ const CsuObjects = struct {
3359
3368
else = > {
3360
3369
inline for (std .meta .fields (@TypeOf (result ))) | f ,i | {
3361
3370
if (@field (result , f .name )) | * obj | {
3362
- if (comp .crt_files .get (obj .* )) | crtf | {
3363
- obj .* = crtf .full_object_path ;
3364
- } else {
3365
- @field (result , f .name ) = null ;
3366
- }
3371
+ obj .* = try fs .path .join (arena , &[_ ][]const u8 { crt_dir_path , obj .* });
3367
3372
}
3368
3373
}
3369
3374
}
0 commit comments