Skip to content

Commit 85cc74b

Browse files
committed
[reduce LDC-specific diff wrt. IS_MUSL]
Based on dlang/dmd#21779. For LDC, always define IS_MUSL externally, not just to `1` for musl targets.
1 parent 1ae7808 commit 85cc74b

3 files changed

Lines changed: 21 additions & 5 deletions

File tree

runtime/DRuntimeIntegrationTests.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ else()
5757
list(REMOVE_ITEM testnames uuid)
5858
endif()
5959

60-
set(musl "")
60+
set(musl "IS_MUSL=0")
6161
if(TARGET_SYSTEM MATCHES "musl")
6262
set(musl "IS_MUSL=1")
6363
endif()

runtime/druntime/test/exceptions/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ ifdef IN_LDC
33
include ../../../../dmd/osmodel.mak
44
endif
55

6+
ifndef IS_MUSL # LDC defines it externally
7+
ifeq ($(OS),linux)
8+
# FIXME: detect musl libc robustly; just checking Alpine Linux' apk tool for now
9+
ifeq (1,$(shell which apk >/dev/null 2>&1 && echo 1))
10+
IS_MUSL := 1
11+
endif
12+
endif
13+
endif
14+
615
TESTS=stderr_msg unittest_assert invalid_memory_operation static_dtor \
716
future_message refcounted rt_trap_exceptions_drt catch_in_finally \
817
message_with_null

runtime/druntime/test/importc_compare/Makefile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,19 @@ endif
55

66
TESTS := importc_compare
77

8+
ifndef IS_MUSL # LDC defines it externally
9+
ifeq ($(OS),linux)
10+
# FIXME: detect musl libc robustly; just checking Alpine Linux' apk tool for now
11+
ifeq (1,$(shell which apk >/dev/null 2>&1 && echo 1))
12+
IS_MUSL := 1
13+
endif
14+
endif
15+
endif
16+
817
# FIXME: fails on Alpine v3.21 with conflicting struct declarations in the C headers:
918
# /usr/include/asm-generic/fcntl.h(195): Error: struct `importc_includes.flock` conflicts with struct `importc_includes.flock` at /usr/include/fcntl.h(24)
10-
ifeq ($(OS),linux)
11-
ifeq (1,$(IS_MUSL))
12-
TESTS :=
13-
endif
19+
ifeq ($(IS_MUSL),1)
20+
TESTS :=
1421
endif
1522

1623
# FIXME: fails on macOS arm64, e.g., due to unsupported `_Float16`

0 commit comments

Comments
 (0)