From 63805a025b7e2bc929a42f2481ddcadb43c62878 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Thu, 10 Nov 2011 21:47:03 +0000 Subject: [PATCH] Fix building with both LTO and VPX support enabled. Specifically, don't use the 'optimize' function attribute if LTO is enabled. git-svn-id: https://svn.eduke32.com/eduke32@2107 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/Makefile.common | 2 +- polymer/eduke32/source/animvpx.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/polymer/eduke32/Makefile.common b/polymer/eduke32/Makefile.common index d6b110bfb..2704278a8 100644 --- a/polymer/eduke32/Makefile.common +++ b/polymer/eduke32/Makefile.common @@ -84,7 +84,7 @@ ifneq (0,$(RELEASE)) endif ifneq (0,$(LTO)) LIBS+= -flto - debug+= -flto + debug+= -DUSING_LTO -flto endif else # Debugging enabled diff --git a/polymer/eduke32/source/animvpx.c b/polymer/eduke32/source/animvpx.c index 16a72a6a3..a9cbdf736 100644 --- a/polymer/eduke32/source/animvpx.c +++ b/polymer/eduke32/source/animvpx.c @@ -208,10 +208,12 @@ const char *animvpx_nextpic_errmsg[] = { // retrieves one picture-frame from the stream // pic format: lines of [Y U V 0] pixels // *picptr==NULL means EOF has been reached -#ifdef DEBUGGINGAIDS +#ifndef USING_LTO +# ifdef DEBUGGINGAIDS ATTRIBUTE((optimize("O1"))) -#else +# else ATTRIBUTE((optimize("O3"))) +# endif #endif int32_t animvpx_nextpic(animvpx_codec_ctx *codec, uint8_t **picptr) {