macOS Sonoma Linker Issue

Renato renato at athaydes.com
Thu Dec 21 23:25:55 UTC 2023


On Thursday, 21 December 2023 at 19:29:31 UTC, Guillaume Piolat 
wrote:
> On Thursday, 21 December 2023 at 18:06:51 UTC, Renato wrote:
>>
>> Unless silly is completely broken, it seems like this is a 
>> linker issue again.
>
> Hello, why not use ldc instead of dmd for macOS?
>
> sudo ln -f -s /path/to/ldc/compiler/bin/ldc2 /usr/local/bin/ldc2
> sudo ln -f -s /path/to/ldc/compiler/bin/dub /usr/local/bin/dub
>
> You will get multiple targets (dub -a arm64-apple-macos and -a 
> x86_64)

It still doesn't work when I try to run tests with silly and 
ldc2, and try to use this configuration (for better error 
messages):

```
configuration "unittest" {
   dflags "-checkaction=context"
}
```

Error:

```
▶ dub test
              Generating test runner configuration 
'pledged-test-unittest' for 'unittest' (library).
     Starting Performing "unittest" build using 
/Users/renato/dlang/ldc-1.35.0/bin/ldc2 for x86_64.
     Building pledged ~master: building configuration 
[pledged-test-unittest]
      Linking pledged-test-unittest
Undefined symbols for architecture x86_64:
   
"__D4core8internal7dassert__T14_d_assert_failTPkZQuFNaNbNiNfMxAyaMxPkZAya", referenced from:
       
__D3std3uni__T8CowArrayTSQwQu8GcPolicyZQz17freeThisReferenceMFNaNbNiNfZv in pledged-test-unittest.o
   
"__D4core8internal7dassert__T14_d_assert_failTxkZ__TQxTiZQBcFNaNbNiNfMxAyaMKxkMxiZAya", referenced from:
       
__D3std3uni__T9sliceBitsVmi0Vmi8ZQt__T6opCallTwZQkFNaNbNiNfwZk in 
pledged-test-unittest.o
       
__D3std3uni__T9sliceBitsVmi8Vmi21ZQu__T6opCallTwZQkFNaNbNiNfwZk 
in pledged-test-unittest.o
   
"__D4core8internal7dassert__T24miniFormatFakeAttributesTmZQBdFNaNbNiNfMKxmZAya", referenced from:
       
__D4core8internal7dassert__T14_d_assert_failTmZ__TQwTmZQBbFNaNbNiNfMxAyaMKxmMKxmZAya in pledged-test-unittest.o
       
__D4core8internal7dassert__T14_d_assert_failTmZ__TQwTmZQBbFNaNbNiNfMxAyaMKxmMxmZAya in pledged-test-unittest.o
       
__D4core8internal7dassert__T14_d_assert_failTmZ__TQwTmZQBbFNaNbNiNfMxAyaMxmMKxmZAya in pledged-test-unittest.o
       
__D4core8internal7dassert__T14_d_assert_failTmZ__TQwTiZQBbFNaNbNiNfMxAyaMxmMxiZAya in pledged-test-unittest.o
       
__D4core8internal7dassert__T14_d_assert_failTmZ__TQwTiZQBbFNaNbNiNfMxAyaMKxmMxiZAya in pledged-test-unittest.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to 
see invocation)
Error: /usr/bin/cc failed with status: 1
Error /Users/renato/dlang/ldc-1.35.0/bin/ldc2 failed with exit 
code 1.
(ldc-1.35.0)
```


More information about the Digitalmars-d-learn mailing list