Mark all functions and symbols that LTO must not break

This commit is contained in:
Lauri Kasanen 2015-02-26 18:49:10 +02:00
parent f8396be4ce
commit 7a4d23b8af
5 changed files with 29 additions and 20 deletions

View File

@ -1864,14 +1864,14 @@ InitFonts()
} }
} }
_X_EXPORT _X_EXPORT XFONT_LTO
int int
GetDefaultPointSize() GetDefaultPointSize()
{ {
return 120; return 120;
} }
_X_EXPORT _X_EXPORT XFONT_LTO
FontResolutionPtr FontResolutionPtr
GetClientResolutions(int *num) GetClientResolutions(int *num)
{ {
@ -1911,7 +1911,7 @@ GetClientResolutions(int *num)
* should be called (only once!) by each type of fpe when initialized * should be called (only once!) by each type of fpe when initialized
*/ */
_X_EXPORT _X_EXPORT XFONT_LTO
int int
RegisterFPEFunctions(NameCheckFunc name_func, RegisterFPEFunctions(NameCheckFunc name_func,
InitFpeFunc init_func, InitFpeFunc init_func,
@ -1981,28 +1981,28 @@ find_old_font(XID id)
SecurityUnknownAccess); SecurityUnknownAccess);
} }
_X_EXPORT _X_EXPORT XFONT_LTO
Font Font
GetNewFontClientID() GetNewFontClientID()
{ {
return FakeClientID(0); return FakeClientID(0);
} }
_X_EXPORT _X_EXPORT XFONT_LTO
int int
StoreFontClientFont(FontPtr pfont, Font id) StoreFontClientFont(FontPtr pfont, Font id)
{ {
return AddResource(id, RT_NONE, (pointer) pfont); return AddResource(id, RT_NONE, (pointer) pfont);
} }
_X_EXPORT _X_EXPORT XFONT_LTO
void void
DeleteFontClientID(Font id) DeleteFontClientID(Font id)
{ {
FreeResource(id, RT_NONE); FreeResource(id, RT_NONE);
} }
_X_EXPORT _X_EXPORT XFONT_LTO
int int
client_auth_generation(ClientPtr client) client_auth_generation(ClientPtr client)
{ {
@ -2013,7 +2013,7 @@ static int fs_handlers_installed = 0;
static unsigned int last_server_gen; static unsigned int last_server_gen;
_X_EXPORT _X_EXPORT XFONT_LTO
int int
init_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler) init_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler)
{ {
@ -2034,7 +2034,7 @@ init_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler)
return Successful; return Successful;
} }
_X_EXPORT _X_EXPORT XFONT_LTO
void void
remove_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler, remove_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler,
Bool all) Bool all)

View File

@ -80,7 +80,7 @@ PtrCtrl defaultPointerControl = {
}; };
_X_EXPORT ClientPtr clients[MAXCLIENTS]; _X_EXPORT ClientPtr clients[MAXCLIENTS];
_X_EXPORT ClientPtr serverClient; _X_EXPORT XFONT_LTO_VAR ClientPtr serverClient;
_X_EXPORT int currentMaxClients; /* current size of clients array */ _X_EXPORT int currentMaxClients; /* current size of clients array */
_X_EXPORT long maxBigRequestSize = MAX_BIG_REQUEST_SIZE; _X_EXPORT long maxBigRequestSize = MAX_BIG_REQUEST_SIZE;
@ -89,7 +89,7 @@ _X_EXPORT WindowPtr WindowTable[MAXSCREENS];
_X_EXPORT unsigned long globalSerialNumber = 0; _X_EXPORT unsigned long globalSerialNumber = 0;
_X_EXPORT unsigned long serverGeneration = 0; _X_EXPORT XFONT_LTO_VAR unsigned long serverGeneration = 0;
/* these next four are initialized in main.c */ /* these next four are initialized in main.c */
_X_EXPORT CARD32 ScreenSaverTime; _X_EXPORT CARD32 ScreenSaverTime;

View File

@ -401,7 +401,7 @@ Bool ClientSleep(
#ifndef ___CLIENTSIGNAL_DEFINED___ #ifndef ___CLIENTSIGNAL_DEFINED___
#define ___CLIENTSIGNAL_DEFINED___ #define ___CLIENTSIGNAL_DEFINED___
Bool ClientSignal( Bool XFONT_LTO ClientSignal(
ClientPtr /*client*/); ClientPtr /*client*/);
#endif /* ___CLIENTSIGNAL_DEFINED___ */ #endif /* ___CLIENTSIGNAL_DEFINED___ */
@ -413,15 +413,15 @@ Bool ClientIsAsleep(
/* atom.c */ /* atom.c */
Atom MakeAtom( XFONT_LTO Atom MakeAtom(
char * /*string*/, char * /*string*/,
unsigned /*len*/, unsigned /*len*/,
Bool /*makeit*/); Bool /*makeit*/);
Bool ValidAtom( XFONT_LTO Bool ValidAtom(
Atom /*atom*/); Atom /*atom*/);
char *NameForAtom( XFONT_LTO char *NameForAtom(
Atom /*atom*/); Atom /*atom*/);
void AtomError(void); void AtomError(void);

View File

@ -122,7 +122,7 @@ void InitFonts(void);
void FreeFonts(void); void FreeFonts(void);
FontPtr find_old_font(XID /*id*/); FontPtr XFONT_LTO find_old_font(XID /*id*/);
void GetGlyphs(FontPtr /*font*/, void GetGlyphs(FontPtr /*font*/,
unsigned long /*count*/, unsigned long /*count*/,

View File

@ -67,6 +67,15 @@ SOFTWARE.
#define MAX_BIG_REQUEST_SIZE 4194303 #define MAX_BIG_REQUEST_SIZE 4194303
#endif #endif
// Need to mark a set of functions so LTO doesn't mangle them
#if defined(__GNUC__) && __GNUC__ >= 4
#define XFONT_LTO __attribute__((noinline)) __attribute__((used))
#define XFONT_LTO_VAR __attribute__((used))
#else
#define XFONT_LTO
#define XFONT_LTO_VAR
#endif
typedef pointer FID; typedef pointer FID;
typedef struct _FontPathRec *FontPathPtr; typedef struct _FontPathRec *FontPathPtr;
typedef struct _NewClientRec *NewClientPtr; typedef struct _NewClientRec *NewClientPtr;
@ -151,7 +160,7 @@ void MakeClientGrabPervious(ClientPtr /*client*/);
void AvailableClientInput(ClientPtr /* client */); void AvailableClientInput(ClientPtr /* client */);
CARD32 GetTimeInMillis(void); CARD32 XFONT_LTO GetTimeInMillis(void);
void AdjustWaitForDelay( void AdjustWaitForDelay(
pointer /*waitTime*/, pointer /*waitTime*/,
@ -192,7 +201,7 @@ void UseMsg(void);
void ProcessCommandLine(int /*argc*/, char* /*argv*/[]); void ProcessCommandLine(int /*argc*/, char* /*argv*/[]);
int set_font_authorizations( XFONT_LTO int set_font_authorizations(
char ** /* authorizations */, char ** /* authorizations */,
int * /*authlen */, int * /*authlen */,
pointer /* client */); pointer /* client */);
@ -394,7 +403,7 @@ typedef enum {
void AuditF(const char *f, ...) _printf_attribute(1,2); void AuditF(const char *f, ...) _printf_attribute(1,2);
void VAuditF(const char *f, va_list args); void VAuditF(const char *f, va_list args);
void FatalError(const char *f, ...) _printf_attribute(1,2) void FatalError(const char *f, ...) _printf_attribute(1,2) XFONT_LTO
#if defined(__GNUC__) && \ #if defined(__GNUC__) && \
((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ > 4))) ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ > 4)))
__attribute((noreturn)) __attribute((noreturn))
@ -402,6 +411,6 @@ __attribute((noreturn))
; ;
void VErrorF(const char *f, va_list args); void VErrorF(const char *f, va_list args);
void ErrorF(const char *f, ...) _printf_attribute(1,2); void ErrorF(const char *f, ...) _printf_attribute(1,2) XFONT_LTO;
#endif /* OS_H */ #endif /* OS_H */