From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id AF0203846402; Mon, 18 Jan 2021 11:32:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF0203846402 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] cxx.cc: Fix dynamic initialization for static local variables X-Act-Checkin: newlib-cygwin X-Git-Author: Ben Wijen X-Git-Refname: refs/heads/master X-Git-Oldrev: cbeb1009a9faa966821190a4a83d4a120aefd753 X-Git-Newrev: 9e88e840c2062ee1492e303da5fc696eec849328 Message-Id: <20210118113226.AF0203846402@sourceware.org> Date: Mon, 18 Jan 2021 11:32:26 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2021 11:32:26 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=9e88e840c2062ee1492e303da5fc696eec849328 commit 9e88e840c2062ee1492e303da5fc696eec849328 Author: Ben Wijen Date: Fri Jan 15 14:45:29 2021 +0100 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.) Diff: --- winsup/cygwin/Makefile.in | 2 +- winsup/cygwin/cxx.cc | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in index a840f2b83..73d9b37fd 100644 --- a/winsup/cygwin/Makefile.in +++ b/winsup/cygwin/Makefile.in @@ -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@ diff --git a/winsup/cygwin/cxx.cc b/winsup/cygwin/cxx.cc index be3268549..b69524aca 100644 --- a/winsup/cygwin/cxx.cc +++ b/winsup/cygwin/cxx.cc @@ -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