Skip to content

Commit

Permalink
built-in math Makefile fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriy-chumak committed Mar 6, 2023
1 parent 848397a commit f0c8e4a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,16 @@ CFLAGS_RELEASE += -DCAR_CHECK=0 -DCDR_CHECK=0
CFLAGS += -DHAS_SOCKETS=$(if $(HAS_SOCKETS),1,0)
CFLAGS += -DHAS_DLOPEN=$(if $(HAS_DLOPEN),1,0)
CFLAGS += -DHAS_SANDBOX=$(if $(HAS_SECCOMP),1,0)
CFLAGS += -DOLVM_BUILTIN_FMATH=$(if $(OLVM_BUILTIN_FMATH),1,0)

VERSION ?= $(shell echo `git describe --tags \`git rev-list --tags --max-count=1\``-`git rev-list HEAD --count`-`git log --pretty=format:'%h' -n 1`)

# builtin "sin", "cos", "sqrt", etc. functions support
# can be disabled using -DOLVM_NO_BUILTIN_FMATH=1
# can be disabled using "-DOLVM_BUILTIN_FMATH=0"
ifneq ($(OLVM_BUILTIN_FMATH),0)
CFLAGS += -lm
# CFLAGS += -ffast-math -mfpmath=387
else
CFLAGS += -DOLVM_BUILTIN_FMATH=0
endif

# clang is not a primary compiler and clang have no ability to remove
Expand All @@ -80,7 +81,7 @@ endif
# endif

## 'os dependent' flags

# ------------------------------------------------------
UNAME ?= $(shell uname -s)

# Linux
Expand All @@ -101,13 +102,13 @@ endif

# BSD
ifeq ($(UNAME),FreeBSD)
L := $(if $(HAS_DLOPEN), -lc) -lm \
L := $(if $(HAS_DLOPEN), -lc) \
-Xlinker --export-dynamic

LD := ld.bfd
endif
ifeq ($(UNAME),NetBSD)
L := $(if $(HAS_DLOPEN), -lc) -lm \
L := $(if $(HAS_DLOPEN), -lc) \
-Xlinker --export-dynamic
endif
ifeq ($(UNAME),OpenBSD)
Expand Down

0 comments on commit f0c8e4a

Please sign in to comment.