mirror of
https://github.com/janet-lang/janet
synced 2024-11-24 17:27:18 +00:00
Only enable lto on linux for now.
Was failing with clang, as the default clang linker doesn't do LTO.
This commit is contained in:
parent
99c94a78d6
commit
bbed72f39f
3
Makefile
3
Makefile
@ -37,7 +37,7 @@ MANPATH?=$(PREFIX)/share/man/man1/
|
|||||||
PKG_CONFIG_PATH?=$(LIBDIR)/pkgconfig
|
PKG_CONFIG_PATH?=$(LIBDIR)/pkgconfig
|
||||||
DEBUGGER=gdb
|
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)
|
-DJANET_BUILD=$(JANET_BUILD)
|
||||||
LDFLAGS=-rdynamic
|
LDFLAGS=-rdynamic
|
||||||
|
|
||||||
@ -51,6 +51,7 @@ ifeq ($(UNAME), Darwin)
|
|||||||
LDCONFIG:=
|
LDCONFIG:=
|
||||||
else ifeq ($(UNAME), Linux)
|
else ifeq ($(UNAME), Linux)
|
||||||
CLIBS:=$(CLIBS) -lrt -ldl
|
CLIBS:=$(CLIBS) -lrt -ldl
|
||||||
|
CFLAGS+= -flto
|
||||||
endif
|
endif
|
||||||
# For other unix likes, add flags here!
|
# For other unix likes, add flags here!
|
||||||
ifeq ($(UNAME), Haiku)
|
ifeq ($(UNAME), Haiku)
|
||||||
|
10
auxbin/jpm
10
auxbin/jpm
@ -125,11 +125,11 @@
|
|||||||
(def threads? (not (not (env 'thread/new))))
|
(def threads? (not (not (env 'thread/new))))
|
||||||
|
|
||||||
# Default flags for natives, but not required
|
# 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
|
(def default-cflags
|
||||||
(if is-win
|
(if is-win
|
||||||
["/nologo" "/MD"]
|
["/nologo" "/MD"]
|
||||||
["-std=c99" "-Wall" "-Wextra" "-flto"]))
|
["-std=c99" "-Wall" "-Wextra"]))
|
||||||
|
|
||||||
|
|
||||||
# Link to pthreads
|
# Link to pthreads
|
||||||
@ -140,13 +140,13 @@
|
|||||||
(def- dynamic-cflags
|
(def- dynamic-cflags
|
||||||
(if is-win
|
(if is-win
|
||||||
["/LD"]
|
["/LD"]
|
||||||
["-fPIC" "-flto"]))
|
["-fPIC"]))
|
||||||
(def- dynamic-lflags
|
(def- dynamic-lflags
|
||||||
(if is-win
|
(if is-win
|
||||||
["/DLL" ;thread-flags]
|
["/DLL" ;thread-flags]
|
||||||
(if is-mac
|
(if is-mac
|
||||||
["-shared" "-undefined" "dynamic_lookup" "-flto" ;thread-flags]
|
["-shared" "-undefined" "dynamic_lookup" ;thread-flags]
|
||||||
["-shared" "-flto" ;thread-flags])))
|
["-shared" ;thread-flags])))
|
||||||
|
|
||||||
(defn- opt
|
(defn- opt
|
||||||
"Get an option, allowing overrides via dynamic bindings AND some
|
"Get an option, allowing overrides via dynamic bindings AND some
|
||||||
|
Loading…
Reference in New Issue
Block a user