-
-
Notifications
You must be signed in to change notification settings - Fork 260
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
Add "Posix" global version conditional for Emscripten targets #4738
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -752,8 +752,26 @@ void registerPredefinedTargetVersions() { | |||||||
VersionCondition::addPredefinedGlobalIdent("D_HardFloat"); | ||||||||
break; | ||||||||
case llvm::Triple::wasm32: | ||||||||
VersionCondition::addPredefinedGlobalIdent("WebAssembly"); | ||||||||
if (triple.getOS() == llvm::Triple::Emscripten) { | ||||||||
// Emscripten reimplements Posix APIs | ||||||||
VersionCondition::addPredefinedGlobalIdent("linux"); | ||||||||
VersionCondition::addPredefinedGlobalIdent("Posix"); | ||||||||
VersionCondition::addPredefinedGlobalIdent("CRuntime_Musl"); | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this correct? Musl? that is more than just posix. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. emscripten uses musl, musl is POSIX compliant There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm interesting. Do you have a link to confirm this? I found emscripten-core/emscripten#13006 which seems to support this. The proper place to add the musl-compatible predefined versions is Lines 921 to 923 in dd0ff1e
|
||||||||
VersionCondition::addPredefinedGlobalIdent("X86_Any"); | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. X86 for sure is wrong |
||||||||
VersionCondition::addPredefinedGlobalIdent("X86"); | ||||||||
} | ||||||||
break; | ||||||||
case llvm::Triple::wasm64: | ||||||||
VersionCondition::addPredefinedGlobalIdent("WebAssembly"); | ||||||||
if (triple.getOS() == llvm::Triple::Emscripten) { | ||||||||
// Emscripten reimplements Posix APIs | ||||||||
VersionCondition::addPredefinedGlobalIdent("linux"); | ||||||||
VersionCondition::addPredefinedGlobalIdent("Posix"); | ||||||||
VersionCondition::addPredefinedGlobalIdent("CRuntime_Musl"); | ||||||||
VersionCondition::addPredefinedGlobalIdent("X86_Any"); | ||||||||
VersionCondition::addPredefinedGlobalIdent("X86_64"); | ||||||||
} | ||||||||
break; | ||||||||
#if LDC_LLVM_VER >= 1600 | ||||||||
case llvm::Triple::loongarch32: | ||||||||
|
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.
linux
probably also incorrect?