Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion druntime/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -497,10 +497,15 @@ $(addsuffix /.run,$(filter-out test/shared,$(ADDITIONAL_TESTS))): $(DRUNTIME)
test/shared/.run: $(DRUNTIMESO)
endif

ifeq (linux,$(OS))
LDD = ldd
IS_MUSL := $(shell $(LDD) --version 2>&1 | grep -q musl && echo 1)
endif

test/%/.run: test/%/Makefile $(DMD)
$(QUIET)$(MAKE) -C test/$* MODEL=$(MODEL) OS=$(OS) DMD=$(abspath $(DMD)) BUILD=$(BUILD) \
DRUNTIME=$(abspath $(DRUNTIME)) DRUNTIMESO=$(abspath $(DRUNTIMESO)) LINKDL=$(LINKDL) \
QUIET=$(QUIET) TIMELIMIT='$(TIMELIMIT)' PIC=$(PIC) SHARED=$(SHARED)
QUIET=$(QUIET) TIMELIMIT='$(TIMELIMIT)' PIC=$(PIC) SHARED=$(SHARED) IS_MUSL=$(IS_MUSL)

test/%/.clean: test/%/Makefile
$(QUIET)$(MAKE) -C test/$* MODEL=$(MODEL) OS=$(OS) BUILD=$(BUILD) clean
Expand Down
2 changes: 2 additions & 0 deletions druntime/test/common.mak
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ QUIET:=
TIMELIMIT:=
PIC:=
SHARED:=
# not empty if musl is detected, empty otherwise
IS_MUSL:=

# Variables that can be specified by users, with the same meaning as used by GNU make
# $(CC) $(CXX) $(DMD) # the compiler
Expand Down
11 changes: 2 additions & 9 deletions druntime/test/exceptions/Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
ifeq ($(OS),linux)
# FIXME: detect musl libc robustly; just checking Alpine Linux' apk tool for now
ifeq (1,$(shell which apk &>/dev/null && echo 1))
IS_MUSL:=1
endif
endif

TESTS=stderr_msg unittest_assert invalid_memory_operation static_dtor \
future_message refcounted rt_trap_exceptions_drt catch_in_finally \
message_with_null

# FIXME: segfaults with musl libc
ifneq ($(IS_MUSL),1)
ifndef IS_MUSL
TESTS += unknown_gc
endif

Expand All @@ -26,7 +19,7 @@ GDB:=gdb
ifeq ($(OS),linux)
TESTS+=line_trace line_trace_21656 long_backtrace_trunc rt_trap_exceptions cpp_demangle
# registerMemoryAssertHandler requires glibc
ifneq ($(IS_MUSL),1)
ifndef IS_MUSL
TESTS+=memoryerror_null_read memoryerror_null_write memoryerror_null_call memoryerror_stackoverflow
endif
line_trace_dflags:=-L--export-dynamic
Expand Down
6 changes: 2 additions & 4 deletions druntime/test/importc_compare/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ TESTS := importc_compare

# FIXME: fails on Alpine v3.21 with conflicting struct declarations in the C headers:
# /usr/include/asm-generic/fcntl.h(195): Error: struct `importc_includes.flock` conflicts with struct `importc_includes.flock` at /usr/include/fcntl.h(24)
ifeq ($(OS),linux)
ifeq (1,$(shell which apk &>/dev/null && echo 1))
TESTS :=
endif
ifdef IS_MUSL
TESTS :=
endif

include ../common.mak
Expand Down
Loading