diff --git a/winsup/cygwin/crt0.c b/winsup/cygwin/crt0.c index 271f5b911..fee4b2e24 100644 --- a/winsup/cygwin/crt0.c +++ b/winsup/cygwin/crt0.c @@ -20,9 +20,13 @@ void mainCRTStartup () { #ifdef __i386__ +#if __GNUC_PREREQ(6,0) #pragma GCC diagnostic ignored "-Wframe-address" +#endif (void)__builtin_return_address(1); +#if __GNUC_PREREQ(6,0) #pragma GCC diagnostic pop +#endif asm volatile ("andl $-16,%%esp" ::: "%esp"); #endif diff --git a/winsup/cygwin/init.cc b/winsup/cygwin/init.cc index 2d4299e5b..aeeeac772 100644 --- a/winsup/cygwin/init.cc +++ b/winsup/cygwin/init.cc @@ -22,10 +22,14 @@ static bool dll_finished_loading; static void WINAPI threadfunc_fe (VOID *arg) { -#ifndef __x86_64__ +#ifdef __i386__ +#if __GNUC_PREREQ(6,0) #pragma GCC diagnostic ignored "-Wframe-address" +#endif (void)__builtin_return_address(1); +#if __GNUC_PREREQ(6,0) #pragma GCC diagnostic pop +#endif asm volatile ("andl $-16,%%esp" ::: "%esp"); #endif _cygtls::call ((DWORD (*) (void *, void *)) TlsGetValue (_my_oldfunc), arg);