From 2cdcfd30c27f0d836cc477f2ae9f456287fd6b1b Mon Sep 17 00:00:00 2001 From: Caroline Tice Date: Mon, 5 Feb 2018 08:43:33 -0800 Subject: [GCC] Fix #endif problem in libgcc/emutls.c Currently in emutls.c 'emutls_key_created' is defined within part of an ifdef, but is accessed outside the ifdef, which can cause issues in builds where the ifdef is not taken. This CL moves the #endif to include the new function that accesses 'emutls_key_created' so that all references to it are within the defining if-def. Bug: b/72942688 Test: Fix tested in ChromeOS. Change-Id: Ic1d6760d116b63abaef18f95e38de42af30952e4 --- gcc-4.9/libgcc/emutls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc-4.9') diff --git a/gcc-4.9/libgcc/emutls.c b/gcc-4.9/libgcc/emutls.c index 77550e057..cba9c3b03 100644 --- a/gcc-4.9/libgcc/emutls.c +++ b/gcc-4.9/libgcc/emutls.c @@ -89,7 +89,6 @@ emutls_init (void) abort (); emutls_key_created = 1; } -#endif __attribute__((destructor)) static void @@ -98,6 +97,7 @@ unregister_emutls_key (void) if (emutls_key_created) __gthread_key_delete (emutls_key); } +#endif static void * emutls_alloc (struct __emutls_object *obj) -- cgit v1.2.3