From: Rich Felker Date: Sun, 14 Oct 2012 03:53:18 +0000 (-0400) Subject: workaround broken hidden-visibility handling in pcc X-Git-Tag: v0.9.7~40 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=36be5284c2a79406778ac489928c6deb05857329;p=oweals%2Fmusl.git workaround broken hidden-visibility handling in pcc with this change, pcc-built musl libc.so seems to work correctly. the problem is that pcc generates GOT lookups for external-linkage symbols even if they are hidden, rather than using GOT-relative addressing. the entire reason we're using hidden visibility on the __libc object is to make it accessible prior to relocations -- not to mention inexpensive to access. unfortunately, the workaround makes it even more expensive on pcc. when the pcc issue is fixed, an appropriate version test should be added so new pcc can use the much more efficient variant. --- diff --git a/src/internal/libc.h b/src/internal/libc.h index f88d846d..703d9853 100644 --- a/src/internal/libc.h +++ b/src/internal/libc.h @@ -21,7 +21,7 @@ struct __libc { extern size_t __hwcap; -#if !defined(__PIC__) || 100*__GNUC__+__GNUC_MINOR__ >= 303 || defined(__PCC__) || defined(__TINYC__) +#if !defined(__PIC__) || (100*__GNUC__+__GNUC_MINOR__ >= 303 && !defined(__PCC__)) #ifdef __PIC__ #if __GNUC__ < 4