From c986325763e1387b7e7fc358af91c2341a038dbe Mon Sep 17 00:00:00 2001 From: smatz Date: Wed, 29 Dec 2010 20:46:35 +0000 Subject: (svn r21662) -Codechange: use -flto=jobserver for GCC 4.6, it makes linking with LTO use number of processes passed to make -j --- Makefile.src.in | 4 ++-- 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 -- cgit v1.2.3-70-g09d2