]> sourceware.org Git - newlib-cygwin.git/commitdiff
cxx.cc: Fix dynamic initialization for static local variables
authorBen Wijen <ben@wijen.net>
Fri, 15 Jan 2021 13:45:29 +0000 (14:45 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Mon, 18 Jan 2021 11:22:53 +0000 (12:22 +0100)
The old implementation for __cxa_guard_acquire did not return 1,
therefore dynamic initialization was never performed.

If concurrent-safe dynamic initialisation is ever needed, CXX ABI
must be followed when re-implementing __cxa_guard_acquire (et al.)

winsup/cygwin/Makefile.in
winsup/cygwin/cxx.cc

index a840f2b8318dd400a013ac28e78433ebff9999c3..73d9b37fdb08c5897cdba802be91d65f871d8e44 100644 (file)
@@ -69,7 +69,7 @@ COMMON_CFLAGS=-MMD ${$(*F)_CFLAGS} -Wimplicit-fallthrough=5 -Werror -fmerge-cons
 ifeq ($(target_cpu),x86_64)
 COMMON_CFLAGS+=-mcmodel=small
 endif
-COMPILE.cc+=${COMMON_CFLAGS} # -std=gnu++14
+COMPILE.cc+=${COMMON_CFLAGS} -fno-threadsafe-statics # -std=gnu++14
 COMPILE.c+=${COMMON_CFLAGS}
 
 AR:=@AR@
index be3268549d6ceeb0321d0075786f38c313dbab83..b69524acadc20036a8528d5611844b6ba7d6f36e 100644 (file)
@@ -83,16 +83,6 @@ __cxa_pure_virtual (void)
   api_fatal ("pure virtual method called");
 }
 
-extern "C" void
-__cxa_guard_acquire ()
-{
-}
-
-extern "C" void
-__cxa_guard_release ()
-{
-}
-
 /* These routines are made available as last-resort fallbacks
    for the application.  Should not be used in practice; the
    entries in this struct get overwritten by each DLL as it
This page took 0.034227 seconds and 5 git commands to generate.