Fix Bugzilla 24399 - Link failure on MacOS with address=0x0 points to section(2) with no content

This commit is contained in:
Iain Buclaw 2024-02-22 09:34:23 +01:00 committed by The Dlang Bot
parent 6139abb202
commit 985f64ba03
2 changed files with 14 additions and 0 deletions

View file

@ -92,6 +92,11 @@ extern (C++) void Initializer_toDt(Initializer init, ref DtBuilder dtb, bool isC
if (tb.ty == Tvector)
tb = (cast(TypeVector)tb).basetype;
if (ai.dim == 0 && tb.isZeroInit(ai.loc))
{
dtb.nzeros(cast(uint)ai.type.size());
return;
}
Type tn = tb.nextOf().toBasetype();
//printf("\tdim = %d\n", ai.dim);

View file

@ -0,0 +1,9 @@
// REQUIRED_ARGS: -main
// LINK:
template rt_options()
{
__gshared string[] rt_options = [];
string[] rt_options_tls = [];
}
alias _ = rt_options!();