From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7842 invoked by alias); 10 May 2010 14:14:58 -0000 Received: (qmail 7806 invoked by uid 48); 10 May 2010 14:14:47 -0000 Date: Mon, 10 May 2010 14:14:00 -0000 Message-ID: <20100510141447.7805.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/44059] Static initializers executed more than once when using unique global symbols In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "ivan dot stankovic at avl dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-05/txt/msg00981.txt.bz2 ------- Comment #5 from ivan dot stankovic at avl dot com 2010-05-10 14:14 ------- Indeed, using RTLD_GLOBAL works around the problem. However, I don't think one should just resort to using this flag with dlopen everywhere. The problem was originally found with Python modules written in C, and while one can change the dlopen flags used for Python imports, I'm not sure that that won't break something else. As Jakub has pointed out, the guard needs to be unique as well. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44059