Skip to content

Commit

Permalink
fixes/cleanup for use-system-unwind make flags (#55639)
Browse files Browse the repository at this point in the history
Assuming non-windows and libunwind not disabled:

The flag `-DLLVMLIBUNWIND` is currently set on macos only for
`USE_SYSTEM_UNWIND=0` which seems wrong to me and causes build issues
for macos on Yggdrasil in combination with the recent
#55049 which should only affect
gnu libunwind (`error: call to undeclared function 'unw_ensure_tls'`).
This flag is now set independently of the system-libunwind flag (on
Darwin and OpenBSD as before).

`LIBUNWIND=-lunwind` is set for `USE_SYSTEM_UNWIND=0` ||
`USE_SYSTEM_UNWIND=1` && `OS != Darwin`.
I don't think the check for Darwin make sense and might be a leftover
from using osxunwind a (long) while ago.
Changed that to always set `-lunwind` if enabled.

x-ref: JuliaPackaging/Yggdrasil#9331
  • Loading branch information
benlorenz authored Aug 31, 2024
1 parent e22e4de commit 0622123
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1095,20 +1095,13 @@ LIBUNWIND:=
else ifneq ($(DISABLE_LIBUNWIND), 0)
LIBUNWIND:=
else
ifeq ($(USE_SYSTEM_LIBUNWIND), 1)
ifneq ($(OS),Darwin)
LIBUNWIND:=-lunwind
# Only for linux since we want to use not yet released libunwind features
JCFLAGS+=-DSYSTEM_LIBUNWIND
JCPPFLAGS+=-DSYSTEM_LIBUNWIND
endif
else
ifneq ($(findstring $(OS),Darwin OpenBSD),)
LIBUNWIND:=-lunwind
JCPPFLAGS+=-DLLVMLIBUNWIND
else
LIBUNWIND:=-lunwind
endif
else ifeq ($(USE_SYSTEM_LIBUNWIND), 1)
# Only for linux and freebsd since we want to use not yet released gnu libunwind features
JCFLAGS+=-DSYSTEM_LIBUNWIND
JCPPFLAGS+=-DSYSTEM_LIBUNWIND
endif
endif

Expand Down

0 comments on commit 0622123

Please sign in to comment.