File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66- Android: NDK for prebuilt package bumped from r26d to r27. (#4711 )
77- ldc2.conf: %%ldcconfigpath%% placeholder added - specifies the directory where current configuration file is located. (#4717 )
88- Add support for building against a system copy of zlib through ` -DPHOBOS_SYSTEM_ZLIB=ON ` . (#4742 )
9+ - Emscripten: The compiler now mimicks a regular musl Linux platform wrt. extra predefined versions (` linux ` , ` Posix ` and ` CRuntime_Musl ` ). (#4750 )
910
1011#### Platform support
1112
Original file line number Diff line number Diff line change @@ -923,6 +923,10 @@ void registerPredefinedTargetVersions() {
923923 break ;
924924 case llvm::Triple::Emscripten:
925925 VersionCondition::addPredefinedGlobalIdent (" Emscripten" );
926+ // Emscripten uses musl, so mimic a musl Linux platform:
927+ VersionCondition::addPredefinedGlobalIdent (" linux" );
928+ VersionCondition::addPredefinedGlobalIdent (" Posix" );
929+ VersionCondition::addPredefinedGlobalIdent (" CRuntime_Musl" );
926930 break ;
927931 default :
928932 if (triple.getEnvironment () == llvm::Triple::Android) {
Original file line number Diff line number Diff line change 1+ // REQUIRES: target_WebAssembly
2+
3+ // RUN: %ldc -mtriple=wasm32-unknown-emscripten -c %s
4+
5+
6+ // test predefined versions:
7+
8+ version (Emscripten ) {} else static assert (0 );
9+ version (linux ) {} else static assert (0 );
10+ version (Posix ) {} else static assert (0 );
11+ version (CRuntime_Musl ) {} else static assert (0 );
12+
13+
14+ // verify that some druntime C bindings are importable:
15+
16+ import core.stdc.stdio ;
17+
18+ extern (C ) void _start() {
19+ puts(" Hello world" );
20+ }
You can’t perform that action at this time.
0 commit comments