Skip to content

Commit 0ee1d78

Browse files
committed
Add -lm to Glibc.modulemap on Linux
Unlike Darwin, on Linux when using functions from math.h the m library needs to be added to the compilation. This should be explicit in the module map, rather than being implicit in the driver. Fixes SR-9198
1 parent cec6d69 commit 0ee1d78

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

stdlib/public/Platform/glibc.modulemap.gyb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ module SwiftGlibc [system] {
120120
export *
121121
}
122122
module math {
123+
% if CMAKE_SDK == "LINUX":
124+
link "m"
125+
% end
123126
header "${GLIBC_INCLUDE_PATH}/math.h"
124127
export *
125128
}

0 commit comments

Comments
 (0)