macOS Sonoma Linker Issue

Renato renato at athaydes.com
Fri Dec 22 17:45:27 UTC 2023


On Friday, 22 December 2023 at 12:49:35 UTC, Guillaume Piolat 
wrote:
> On Thursday, 21 December 2023 at 23:25:55 UTC, Renato wrote:
>> ld: symbol(s) not found for architecture x86_64
>
> Make sure you're using the "osx-universal" package in order to 
> have both arch.
> https://github.com/ldc-developers/ldc/releases/tag/v1.35.0
>
> That said, for consumer software it may be a good idea to use 
> eg: LDC 1.28 for x86_64 and LDC 1.35 for arm64 builds. You can 
> stich the binaries together, which will give compatibility with 
> all macOS from 10.12 up to Sonoma (well, if you also: codesign, 
> notarize, make a DMG...).

I went to the effort of downloading this universal release, 
manually creating the `activate` script with the right paths to 
avoid issues (as the download didn't include one)... and it still 
fails.

```
▶ dub test
              Generating test runner configuration 
'pledged-test-unittest' for 'unittest' (library).
     Starting Performing "unittest" build using 
/Users/renato/dlang/ldc2-1.35.0-osx-universal/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/ldc2-1.35.0-osx-universal/bin/ldc2 
failed with exit code 1.
(ldc-1.35.0)
```

You can see it was using the universal release.

I even tried setting the LIBRARY_PATH and LD_LIBRARY_PATH to use 
`lib-arm64` and `lib-ios-x86_64` besides the obvious `lib-x86_64` 
but nothing worked.

I'm afraid I've lost interest to make it work at this point :(


More information about the Digitalmars-d-learn mailing list