diff options
author | smatz <smatz@openttd.org> | 2010-12-29 20:46:35 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2010-12-29 20:46:35 +0000 |
commit | c986325763e1387b7e7fc358af91c2341a038dbe (patch) | |
tree | 4048fdea85e5d0ee7699abe9b4ce3bec80bf1b02 | |
parent | 14d8ef9add17b002ee9583aca9686184c3a521b2 (diff) | |
download | openttd-c986325763e1387b7e7fc358af91c2341a038dbe.tar.xz |
(svn r21662) -Codechange: use -flto=jobserver for GCC 4.6, it makes linking with LTO use number of processes passed to make -j
-rw-r--r-- | Makefile.src.in | 4 | ||||
-rw-r--r-- | config.lib | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/Makefile.src.in b/Makefile.src.in index cb5bb5d19..d03ecbd69 100644 --- a/Makefile.src.in +++ b/Makefile.src.in @@ -256,9 +256,9 @@ ifeq ($(OS), PSP) # Because of a bug in the PSP GCC tools, linking via CXX results # in total chaos and more problems then you can handle. So we need # CC to link OpenTTD for PSP - $(Q)$(CC_HOST) $(LDFLAGS) $(OBJS) $(LIBS) -o $@ + $(Q)+$(CC_HOST) $(LDFLAGS) $(OBJS) $(LIBS) -o $@ else - $(Q)$(CXX_HOST) $(LDFLAGS) $(OBJS) $(LIBS) -o $@ + $(Q)+$(CXX_HOST) $(LDFLAGS) $(OBJS) $(LIBS) -o $@ endif ifdef STRIP $(Q)$(STRIP) $@ diff --git a/config.lib b/config.lib index ab9576f01..c6ef17d74 100644 --- a/config.lib +++ b/config.lib @@ -1295,7 +1295,11 @@ make_compiler_cflags() { has_lto=`$1 -dumpspecs | grep '\%{flto'` if [ -n "$has_lto" ]; then # Use LTO only if we see LTO exists and is requested - flags="$flags -flto" + if [ $cc_version -lt 46 ]; then + flags="$flags -flto" + else + flags="$flags -flto=jobserver" + fi ldflags="$ldflags -fwhole-program" features="$features lto" fi |