From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28254 invoked by alias); 5 Aug 2009 18:55:36 -0000 Received: (qmail 28205 invoked by uid 22791); 5 Aug 2009 18:55:36 -0000 X-SWARE-Spam-Status: No, hits=-0.7 required=5.0 tests=AWL,BAYES_40,J_CHICKENPOX_42 X-Spam-Check-By: sourceware.org Received: from fmmailgate02.web.de (HELO fmmailgate02.web.de) (217.72.192.227) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 05 Aug 2009 18:55:29 +0000 Received: from smtp05.web.de (fmsmtp05.dlan.cinetic.de [172.20.4.166]) by fmmailgate02.web.de (Postfix) with ESMTP id B38C21109AC1E for ; Wed, 5 Aug 2009 20:55:26 +0200 (CEST) Received: from [62.153.151.131] (helo=[192.168.178.35]) by smtp05.web.de with asmtp (WEB.DE 4.110 #314) id 1MYle2-0001BU-00 for ecos-devel@sourceware.org; Wed, 05 Aug 2009 20:55:26 +0200 Message-ID: <4A79D58B.8070300@web.de> Date: Wed, 05 Aug 2009 18:55:00 -0000 From: Uwe Kindler User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: ecos-devel@sourceware.org Subject: Strange __cxa_pure_virtual problem Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Sender: uwe_kindler@web.de Mailing-List: contact ecos-devel-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-devel-owner@ecos.sourceware.org X-SW-Source: 2009-08/txt/msg00000.txt.bz2 Hi, I'm currently in the process of testing uSTL library port. I tried to build the library without filestream support and without package file I/O. The library build process succeeds. Bu if I start building the test cases then the compiler fails on building diag_sprintf1 test with the error message: make[1]: Leaving directory `/home/Nutzer/ustl_test_08_nofio_build/infra/current' /opt/ecos/gnutools/arm-eabi/bin/../lib/gcc/arm-eabi/4.3.2/../../../../arm-eabi/lib/nointerwork/libsupc++.a(pure.o): In function `__cxa_pure_virtual': make: Leaving directory `/home/Nutzer/ustl_test_08_nofio_build' (.text.__cxa_pure_virtual+0x14): undefined reference to `write' collect2: ld returned 1 exit status So the compiler/linker does not link the __cxa_pure_virtual function in infra/current/src/pure.cxx and instead takes the implementation from libsupc++. In the libsupc++ source file pure.cc the function __cxa_pure_virtual writes an error string to stderr via 'write' function. Because no file I/O package is present, there is no write function and the reference to 'write' is undefinded. This error only occures for debug builds (-g2 -O0). If I build with -g -O2 this error does not occur. This problem does not occur, if I link my main.cpp application against the library but it occures when I build test cases. As soon as I add the file I/O package, the tests build process succeeds because a 'write' function is present. The question is, how can/should I solve this problem? Is there a way to force the compiler/linker to use the infra/current/src/pure.cxx implementation or should I provide a dummy 'write' function in uSTL package if file I/O package is not present? Regards, Uwe