Skip to content

Commit 503bd9d

Browse files
authored
Emit a dSYM archive on MacOS with C backend (#27101)
Adjusts the Chapel executable Makefiles to invoke dsymutil on MacOS when debugging information is requested. This is only done when the target compiler is not LLVM, as the Chapel compiler already handles this case for LLVM. This improves the generated debug symbols on MacOS when using the C backend, without needing to save the generated C files This PR builds on the work in #24436 [Reviewed by @dlongnecke-cray]
2 parents 7689365 + 2608103 commit 503bd9d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

runtime/etc/Makefile.exe

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,36 @@ ifneq ($(SKIP_COMPILE_LINK),skip)
4747
$(COMP_GEN_USER_LDFLAGS) $(COMP_GEN_LFLAGS) $(LIBS) \
4848
$(CHPL_MAKE_TARGET_SYSTEM_LINK_ARGS)
4949
endif
50+
ifeq ($(COMP_GEN_DEBUG),1)
51+
ifeq ($(CHPL_MAKE_TARGET_PLATFORM),darwin)
52+
ifneq ($(CHPL_MAKE_TARGET_COMPILER),llvm)
53+
dsymutil $(TMPBINNAME) -o $(TMPBINNAME).dSYM
54+
endif
55+
endif
56+
endif
5057
ifneq ($(CHPL_MAKE_LAUNCHER),none)
5158
$(MAKE) -f $(CHPL_MAKE_HOME)/runtime/etc/Makefile.launcher all CHPL_MAKE_HOME=$(CHPL_MAKE_HOME) TMPBINNAME=$(TMPBINNAME) BINNAME=$(BINNAME) TMPDIRNAME=$(TMPDIRNAME) CHPL_MAKE_RUNTIME_LIB=$(CHPL_MAKE_RUNTIME_LIB) CHPL_MAKE_RUNTIME_INCL=$(CHPL_MAKE_RUNTIME_INCL) CHPL_MAKE_THIRD_PARTY=$(CHPL_MAKE_THIRD_PARTY)
5259
endif
5360
ifneq ($(TMPBINNAME),$(BINNAME))
61+
ifeq ($(COMP_GEN_DEBUG),1)
62+
ifeq ($(CHPL_MAKE_TARGET_PLATFORM),darwin)
63+
ifneq ($(CHPL_MAKE_TARGET_COMPILER),llvm)
64+
rm -f $(BINNAME)
65+
rm -rf $(BINNAME).dSYM
66+
mv $(TMPBINNAME) $(BINNAME)
67+
mv $(TMPBINNAME).dSYM $(BINNAME).dSYM
68+
else
69+
rm -f $(BINNAME)
70+
mv $(TMPBINNAME) $(BINNAME)
71+
endif
72+
else
73+
rm -f $(BINNAME)
74+
mv $(TMPBINNAME) $(BINNAME)
75+
endif
76+
else
5477
rm -f $(BINNAME)
5578
mv $(TMPBINNAME) $(BINNAME)
5679
endif
80+
endif
5781

5882
FORCE:

0 commit comments

Comments
 (0)