From db94366657fb01f0ec0f52bd1343173ea0037acf Mon Sep 17 00:00:00 2001 From: helixhorned Date: Fri, 20 Jan 2012 13:23:53 +0000 Subject: [PATCH] Use ATTRIBUTE((used)) for symbols used only in inline asm. This may fix compilation for optimized builds with GCC or clang where the compiler would otherwise decide that those symbols are unused. git-svn-id: https://svn.eduke32.com/eduke32@2271 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/engine.c | 9 +-------- polymer/eduke32/build/src/kplib.c | 11 ++--------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 36339482c..72ac31f84 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -142,7 +142,7 @@ static int32_t artsize = 0, cachesize = 0; static char *artptrs[MAXTILEFILES]; static int16_t radarang2[MAXXDIM]; -static uint16_t sqrtable[4096], shlookup[4096+256]; +static uint16_t ATTRIBUTE((used)) sqrtable[4096], ATTRIBUTE((used)) shlookup[4096+256]; char pow2char[8] = {1,2,4,8,16,32,64,128}; int32_t pow2long[32] = { @@ -1815,13 +1815,6 @@ int32_t checksectorpointer(int16_t i, int16_t sectnum) #undef WALLS_ARE_CONSISTENT -#ifdef __clang__ -int32_t engine_dummy_function_to_keep_symbols(void) -{ - return shlookup[0] | sqrtable[0]; -} -#endif - #if defined(_MSC_VER) && !defined(NOASM) diff --git a/polymer/eduke32/build/src/kplib.c b/polymer/eduke32/build/src/kplib.c index 5bb8f07fa..54f212c1b 100644 --- a/polymer/eduke32/build/src/kplib.c +++ b/polymer/eduke32/build/src/kplib.c @@ -174,13 +174,13 @@ static int32_t bakr = 0x80, bakg = 0x80, bakb = 0x80; //this used to be public.. static int32_t gslidew = 0, gslider = 0, xm, xmn[4], xr0, xr1, xplc, yplc; static intptr_t nfplace; static int32_t clen[320], cclen[19], bitpos, filt, xsiz, ysiz; -static int32_t xsizbpl, ixsiz, ixoff, iyoff, ixstp, iystp, intlac, nbpl, trnsrgb ASMNAME("trnsrgb"); +static int32_t xsizbpl, ixsiz, ixoff, iyoff, ixstp, iystp, intlac, nbpl, ATTRIBUTE((used)) trnsrgb ASMNAME("trnsrgb"); static int32_t ccind[19] = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15}; static int32_t hxbit[59][2], ibuf0[288], nbuf0[32], ibuf1[32], nbuf1[32]; static const uint8_t *filptr; static uint8_t slidebuf[32768], opixbuf0[4], opixbuf1[4]; static uint8_t pnginited = 0, olinbuf[131072] ASMNAME("olinbuf"); //WARNING:max xres is: 131072/bpp-1 -static int32_t gotcmov = -2, abstab10[1024] ASMNAME("abstab10"); +static int32_t gotcmov = -2, ATTRIBUTE((used)) abstab10[1024] ASMNAME("abstab10"); //Variables to speed up dynamic Huffman decoding: #define LOGQHUFSIZ0 9 @@ -188,13 +188,6 @@ static int32_t gotcmov = -2, abstab10[1024] ASMNAME("abstab10"); static int32_t qhufval0[1<