From cd171734625415b41266aedbc2a759c227c9b43f Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Tue, 1 Sep 2020 23:32:01 +0000 Subject: [PATCH] Force all OpenLibm `fenv`-related functions to be globally exported We do this in the same manner that OpenLibm itself does it; by defining the `__fenv_static` identifier to be `OLM_DLLEXPORT`. `static` == `DLLEXPORT`. Not confusing at all, right? ;) We do it in this manner to avoid needing to change the default behavior for non-Julia users of OpenLibm, which do exist. This way, a default build of OpenLibm has the same behavior as it always has. --- deps/openlibm.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deps/openlibm.mk b/deps/openlibm.mk index 7af66c6f66deec..77dd6233b6d381 100644 --- a/deps/openlibm.mk +++ b/deps/openlibm.mk @@ -7,9 +7,13 @@ $(eval $(call git-external,openlibm,OPENLIBM,,,$(BUILDDIR))) OPENLIBM_FLAGS := ARCH="$(ARCH)" REAL_ARCH="$(MARCH)" CC="$(CC)" FC="$(FC)" AR="$(AR)" OS="$(OS)" USECLANG=$(USECLANG) USEGCC=$(USEGCC) +# We do this awful awful thing where we override `__fenv_static` to be `OLM_DLLEXPORT` so that the fenv methods +# like `fesetround()` are exported on all platforms. +OPENLIBM_CFLAGS := "-D__fenv_static=OLM_DLLEXPORT" + ifneq ($(USE_BINARYBUILDER_OPENLIBM), 1) $(BUILDDIR)/$(OPENLIBM_SRC_DIR)/build-compiled: $(BUILDDIR)/$(OPENLIBM_SRC_DIR)/source-extracted - $(MAKE) -C $(dir $<) $(OPENLIBM_FLAGS) $(MAKE_COMMON) + CFLAGS_add="$(OPENLIBM_CFLAGS)" $(MAKE) -C $(dir $<) $(OPENLIBM_FLAGS) $(MAKE_COMMON) echo 1 > $@ $(eval $(call staged-install, \