Skip to content

Commit

Permalink
Force all OpenLibm fenv-related functions to be globally exported
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
staticfloat committed Sep 1, 2020
1 parent 11f18fe commit cd17173
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion deps/openlibm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down

0 comments on commit cd17173

Please sign in to comment.