www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23119] New: Compiling glui example results in linker error

https://issues.dlang.org/show_bug.cgi?id=23119

          Issue ID: 23119
           Summary: Compiling glui example results in linker error
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Mac OS X
            Status: NEW
          Keywords: wrong-code
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: schveiguy gmail.com

According to
https://github.com/dlang/dmd/blob/e9ba29d71b557fe079e95ee6554f116b24159bab/src/dmd/toobj.d#L524-L528
it appears the compiler intentionally does not produce working object files on
Mach-O 64 bit.

I ran into such a case.

dub run glui:example-scroll

This results in the following error:

```
Performing "debug" build using
/Users/steves/.dvm/compilers/dmd-2.100.0/osx/bin/dmd for x86_64.
ddmp 0.0.1-0.dev.3: target for configuration "library" is up to date.
stdx-allocator 2.77.5: target for configuration "library" is up to date.
libdparse 0.14.0: target for configuration "library" is up to date.
fluent-asserts 0.13.3: target for configuration "library" is up to date.
glui 0.5.0+commit.2.ge5c75a0: target for configuration "raylib3" is up to date.
glui:example-scroll 0.5.0+commit.2.ge5c75a0: building configuration
"application"...
Linking...
ld: in
.dub/build/raylib3-debug-posix.osx.darwin-x86_64-dmd_v2.100.0-C3319142170DADE6FCBC42540E140297/libglui.a(style_macros_2be_a0bf.o),
in section __TEXT,__textcoal_nt reloc 0: symbol index out of range
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: linker exited with status 1
```

This matches the description in the source (added with this PR:
https://github.com/dlang/dmd/pull/10680)

Note: you have to change the source for glui at the moment, or it won't build
at all. Comment out the offending version line to see the error. I have a PR to
fix this, will update once it is merged/released.

--
May 17 2022