-
-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix naked DMD-style asm emission for non-Mac x86 Darwin targets & add prebuilt druntime/Phobos for iOS/x86_64 to macOS package #3478
Conversation
611531c
to
a9abd23
Compare
77137da
to
e8ddb14
Compare
triple="arm64-apple-ios$IOS_DEPLOYMENT_TARGET" | ||
# TODO: shared libs too, and look into `-fvisibility=hidden` requirement | ||
triple_arm64="arm64-apple-ios$IOS_DEPLOYMENT_TARGET" | ||
triple_x64="x86_64-apple-ios$IOS_DEPLOYMENT_TARGET" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not sure if it matters but Xcode does not use this triple for the simulator. I’m not currently at the computer but, IIRC, it uses iphonesimulator
instead of iOS
.
--dFlags="-mtriple=$triple_x64;-fvisibility=hidden" \ | ||
--ldcSrcDir=$BUILD_SOURCESDIRECTORY \ | ||
CMAKE_SYSTEM_NAME=iOS \ | ||
CMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard coding the path to the SDK should be avoided. The following command can be used retrieve the path: xcrun --show-sdk-path --sdk iphonesimulator
.
\"-Xcc=$triple_x64\", | ||
\"-Xcc=-miphoneos-version-min=$IOS_DEPLOYMENT_TARGET\", | ||
\"-Xcc=-isysroot\", | ||
\"-Xcc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk\", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to run the above mentioned command to avoid hard coding the path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's hardcoded just like the one for the arm64 triple, and noone has complained about that so far.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know. I'm just saying it would be better if it wasn't hard coded. Not for arm64 either. If someone only installs the command line tools and not Xcode, the path to the SDKs will be different. Also, Apple may decide to change the path. Originally when I started developing on Mac, the SDK was located somewhere in /Developer
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we wanted to do this properly for the few users who might run into troubles (and aren't able to fix it themselves by adapting ldc2.conf), we would probably have to do something similar to the MSVC toolchain setup, invoking that xcrun
cmdline and parsing its result to obtain the proper path, and injecting it into the linker/clang cmdline for non-Mac Apple targets. Of course none of this would be necessary (none of these -Xcc
flags) if Apple just used a little preconfigured wrapper à la x86_64-apple-i{os,phonesimulator}12.0-clang
like the Android NDK or most cross-gcc toolchains.
This fixes the issue reported in https://forum.dlang.org/thread/hgkramhteqhfxirigxpq@forum.dlang.org.