diff --git a/Makefile b/Makefile index 21c19a68..fba77804 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ MANPATH?=$(PREFIX)/share/man/man1/ PKG_CONFIG_PATH?=$(LIBDIR)/pkgconfig DEBUGGER=gdb -CFLAGS:=$(CFLAGS) -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fPIC -O2 -fvisibility=hidden -flto \ +CFLAGS:=$(CFLAGS) -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fPIC -O2 -fvisibility=hidden \ -DJANET_BUILD=$(JANET_BUILD) LDFLAGS=-rdynamic @@ -51,6 +51,7 @@ ifeq ($(UNAME), Darwin) LDCONFIG:= else ifeq ($(UNAME), Linux) CLIBS:=$(CLIBS) -lrt -ldl + CFLAGS+= -flto endif # For other unix likes, add flags here! ifeq ($(UNAME), Haiku) diff --git a/auxbin/jpm b/auxbin/jpm index 2c863e0b..ae52ff64 100755 --- a/auxbin/jpm +++ b/auxbin/jpm @@ -125,11 +125,11 @@ (def threads? (not (not (env 'thread/new)))) # Default flags for natives, but not required -(def default-lflags (if is-win ["/nologo"] ["-flto"])) +(def default-lflags (if is-win ["/nologo"] [])) (def default-cflags (if is-win ["/nologo" "/MD"] - ["-std=c99" "-Wall" "-Wextra" "-flto"])) + ["-std=c99" "-Wall" "-Wextra"])) # Link to pthreads @@ -140,13 +140,13 @@ (def- dynamic-cflags (if is-win ["/LD"] - ["-fPIC" "-flto"])) + ["-fPIC"])) (def- dynamic-lflags (if is-win ["/DLL" ;thread-flags] (if is-mac - ["-shared" "-undefined" "dynamic_lookup" "-flto" ;thread-flags] - ["-shared" "-flto" ;thread-flags]))) + ["-shared" "-undefined" "dynamic_lookup" ;thread-flags] + ["-shared" ;thread-flags]))) (defn- opt "Get an option, allowing overrides via dynamic bindings AND some