Thread overview
DMD on Macbook M1 Pro unable to compile source code.
Mar 27, 2022
Michael Brown
Mar 27, 2022
Nicholas Wilson
Mar 27, 2022
Nicholas Wilson
Mar 27, 2022
Michael Brown
March 27, 2022

Hello All,

(please be patient with me, I am new to D)

I recently installed DMD.2.099.0 on my
MacBook Pro M1 (MacOS Monterey 12.3) a few days ago via
the dmg instal file via url : https://s3.us-west-2.amazonaws.com/downloads.dlang.org/releases/2022/dmd.2.099.0.dmg

I was able to compile and run a test app after installation(if I remember correctly);
but for the last few days I haven't been able to compile for the past few days.
Whenever I attempt to compile using either DUB or DMD, I get the following exception thrown below.
I am trying to figure out what I am missing here, but the exception doesn't make a whole lot of obvious sense to me
and my Google searches are not turning up much.

Any help provided would be greatly appreciated. Thanks!!!!!

mikeyb@Michaels-MacBook-Pro foobar % dub build
Performing "debug" build using /Library/D/dmd/bin/dmd for x86_64.
foobar ~master: building configuration "application"...
Linking...
ld: in /Library/D/dmd/lib/libphobos2.a(dwarfeh_9d5_5f8.o), section __DATA/__thread_bss has type zero-fill but non-zero file offset for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: linker exited with status 1
uncaught exception
object.Exception@source/dub/compilers/compiler.d(134): /Library/D/dmd/bin/dmd failed with exit code 1.
----------------
??:? pure @safe bool std.exception.enforce!().enforce!(bool).enforce(bool, lazy const(char)[], immutable(char)[], ulong) [0x104a036da]
??:? void dub.compilers.compiler.Compiler.invokeTool(immutable(char)[][], void delegate(int, immutable(char)[]), immutable(char)[][immutable(char)[]]) [0x10481f57a]
??:? void dub.compilers.dmd.DMDCompiler.invokeLinker(in dub.compilers.buildsettings.BuildSettings, in dub.platform.BuildPlatform, immutable(char)[][], void delegate(int, immutable(char)[])) [0x104828aa4]
??:? void dub.generators.build.BuildGenerator.buildWithCompiler(dub.generators.generator.GeneratorSettings, dub.compilers.buildsettings.BuildSettings) [0x10481347a]
??:? bool dub.generators.build.BuildGenerator.performCachedBuild(dub.generators.generator.GeneratorSettings, dub.compilers.buildsettings.BuildSettings, in dub.package_.Package, immutable(char)[], immutable(char)[], in dub.package_.Package[], in dub.internal.vibecompat.inet.path.NativePath[], out dub.internal.vibecompat.inet.path.NativePath) [0x1048117c0]
zsh: abort      dub build
March 27, 2022

On Sunday, 27 March 2022 at 01:13:40 UTC, Michael Brown wrote:

>

Hello All,

(please be patient with me, I am new to D)

I recently installed DMD.2.099.0 on my
MacBook Pro M1 (MacOS Monterey 12.3) a few days ago via
the dmg instal file via url : https://s3.us-west-2.amazonaws.com/downloads.dlang.org/releases/2022/dmd.2.099.0.dmg

I was able to compile and run a test app after installation(if I remember correctly);
but for the last few days I haven't been able to compile for the past few days.
Whenever I attempt to compile using either DUB or DMD, I get the following exception thrown below.
I am trying to figure out what I am missing here, but the exception doesn't make a whole lot of obvious sense to me
and my Google searches are not turning up much.

Any help provided would be greatly appreciated. Thanks!!!!!

These questions are better suited to the learn forum.
The short answer is use LDC:

https://github.com/ldc-developers/ldc/releases/tag/v1.28.1
March 27, 2022

On Sunday, 27 March 2022 at 01:13:40 UTC, Michael Brown wrote:

>

Hello All,

(please be patient with me, I am new to D)

>

Linking...
ld: in /Library/D/dmd/lib/libphobos2.a(dwarfeh_9d5_5f8.o), section __DATA/__thread_bss has type zero-fill but non-zero file offset for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This has just been fixed in master and stable and so will be in the next release.

March 27, 2022

On Sunday, 27 March 2022 at 01:37:45 UTC, Nicholas Wilson wrote:

>

On Sunday, 27 March 2022 at 01:13:40 UTC, Michael Brown wrote:

>

Hello All,

(please be patient with me, I am new to D)

>

Linking...
ld: in /Library/D/dmd/lib/libphobos2.a(dwarfeh_9d5_5f8.o), section __DATA/__thread_bss has type zero-fill but non-zero file offset for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This has just been fixed in master and stable and so will be in the next release.

Thank you!