-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: remove hard-coded build setup
the macos specific linker flags are specific to Xcode version 15 (which is a bug and should be fixed) - so workaround documented and linker flags removed from build settings
- Loading branch information
Showing
5 changed files
with
72 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,15 @@ | ||
.dub | ||
/dub.settings.json | ||
|
||
# per-directory dmd configuration: | ||
/dmd.conf | ||
|
||
# documentation files: | ||
docs.json | ||
__dummy.html | ||
docs/ | ||
/myrc | ||
myrc.so | ||
myrc.dylib | ||
myrc.dll | ||
myrc.a | ||
myrc.lib | ||
myrc-test-* | ||
*.exe | ||
*.pdb | ||
*.o | ||
*.obj | ||
|
||
# generated binaries: | ||
/myrc* | ||
# code coverage files: | ||
*.lst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1 @@ | ||
### MacOS Build issues | ||
|
||
issue: | ||
``` | ||
ld: warning: pointer not aligned at address 0x10016509F ('anon' + 146 from ../../../.dub/cache/sdlite/1.2.0/build/library-debug-Euv1mnZz1Zk-3iGZsMSgFQ/libsdlite.a(parser_419_6ff.o)) | ||
ld: warning: pointer not aligned at address 0x1001650E5 ('anon' + 216 from ../../../.dub/cache/sdlite/1.2.0/build/library-debug-Euv1mnZz1Zk-3iGZsMSgFQ/libsdlite.a(parser_419_6ff.o)) | ||
ld: unaligned pointer(s) for architecture x86_64 | ||
``` | ||
fix: | ||
in dub.settings.json: | ||
```json | ||
{ | ||
"defaultBuildEnvironments": { | ||
"MACOSX_DEPLOYMENT_TARGET": "11" | ||
} | ||
} | ||
``` | ||
|
||
issue: | ||
dub lint doesnt work (fails on running scanner) | ||
open dscanner (dub list dscanner) dub.json and add | ||
```json | ||
"lflags-osx": ["-ld_classic"], | ||
``` | ||
and modify: | ||
```diff | ||
- "\"$DC\" -run \"$PACKAGE_DIR/dubhash.d\"" | ||
+ "\"$DC\" -L-ld_classic -run \"$PACKAGE_DIR/dubhash.d\"" | ||
``` | ||
## myrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
## MacOS build issues | ||
|
||
#### unaligned pointer(s) | ||
|
||
issue: | ||
|
||
linking errors like this: | ||
|
||
``` | ||
ld: warning: pointer not aligned at address 0x10016509F ('anon' + 146 from ../../../.dub/cache/sdlite/1.2.0/build/library-debug-Euv1mnZz1Zk-3iGZsMSgFQ/libsdlite.a(parser_419_6ff.o)) | ||
ld: warning: pointer not aligned at address 0x1001650E5 ('anon' + 216 from ../../../.dub/cache/sdlite/1.2.0/build/library-debug-Euv1mnZz1Zk-3iGZsMSgFQ/libsdlite.a(parser_419_6ff.o)) | ||
ld: unaligned pointer(s) for architecture x86_64 | ||
``` | ||
|
||
fix: | ||
|
||
set `MACOSX_DEPLOYMENT_TARGET` environment variable to `11` (or `12`): | ||
```bash | ||
env MACOSX_DEPLOYMENT_TARGET=11 dub | ||
``` | ||
|
||
#### symbol count from symbol table and dynamic symbol table differ | ||
|
||
issue: | ||
|
||
linking, when XCode version is | ||
[15](https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Known-Issues), errors like this: | ||
|
||
``` | ||
ld: multiple errors: symbol count from symbol table and dynamic symbol table differ in '/Users/kucaahbe/.dub/cache/myrc/0.2.1/build/application-debug-adg7nRO7nk0vUCCcUFqMMw/myrc.o' in '/Users/kucaahbe/.dub/cache/myrc/0.2.1/build/application-debug-adg7nRO7nk0vUCCcUFqMMw/myrc.o'; address=0x0 points to section(2) with no content in '/Library/D/dmd/lib/libphobos2.a[3233](config_a98_4c3.o)' | ||
clang: error: linker command failed with exit code 1 (use -v to see invocation) | ||
``` | ||
|
||
fix: | ||
|
||
add `-L-ld_classic` to dmd flags, either: | ||
|
||
```bash | ||
env DFLAGS="-L-ld_classic" dub | ||
``` | ||
|
||
or issue could be solved globally for dmd, by copying [`dmd.conf`](https://dlang.org/dmd-osx.html#dmd-conf) file to | ||
any [allowed location](https://dlang.org/dmd-osx.html#dmd-conf) and appending `-L-ld_classic` there: | ||
|
||
```ini | ||
; ~/.dmd.conf | ||
[Environment] | ||
|
||
; on OSX (when dmd isntalled from .dmg) the original config file is located at | ||
; /Library/D/dmd/bin/dmd.conf and its content should be used as base. | ||
; Original content: | ||
;DFLAGS=-I/Library/D/dmd/src/phobos -I/Library/D/dmd/src/druntime/import -L-L/Library/D/dmd/lib | ||
DFLAGS=-I/Library/D/dmd/src/phobos -I/Library/D/dmd/src/druntime/import -L-L/Library/D/dmd/lib -L-ld_classic | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters