mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-18 23:12:15 +08:00
cxx.cc: Fix dynamic initialization for static local variables
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.)
This commit is contained in:
parent
cbeb1009a9
commit
9e88e840c2
@ -69,7 +69,7 @@ COMMON_CFLAGS=-MMD ${$(*F)_CFLAGS} -Wimplicit-fallthrough=5 -Werror -fmerge-cons
|
|||||||
ifeq ($(target_cpu),x86_64)
|
ifeq ($(target_cpu),x86_64)
|
||||||
COMMON_CFLAGS+=-mcmodel=small
|
COMMON_CFLAGS+=-mcmodel=small
|
||||||
endif
|
endif
|
||||||
COMPILE.cc+=${COMMON_CFLAGS} # -std=gnu++14
|
COMPILE.cc+=${COMMON_CFLAGS} -fno-threadsafe-statics # -std=gnu++14
|
||||||
COMPILE.c+=${COMMON_CFLAGS}
|
COMPILE.c+=${COMMON_CFLAGS}
|
||||||
|
|
||||||
AR:=@AR@
|
AR:=@AR@
|
||||||
|
@ -83,16 +83,6 @@ __cxa_pure_virtual (void)
|
|||||||
api_fatal ("pure virtual method called");
|
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
|
/* These routines are made available as last-resort fallbacks
|
||||||
for the application. Should not be used in practice; the
|
for the application. Should not be used in practice; the
|
||||||
entries in this struct get overwritten by each DLL as it
|
entries in this struct get overwritten by each DLL as it
|
||||||
|
Loading…
x
Reference in New Issue
Block a user