From owner-freebsd-ports@FreeBSD.ORG Tue Sep 7 09:45:25 2010 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FD341065698 for ; Tue, 7 Sep 2010 09:45:25 +0000 (UTC) (envelope-from alp@rsu.ru) Received: from mail.r61.net (mail.r61.net [195.208.245.249]) by mx1.freebsd.org (Postfix) with ESMTP id 7C70B8FC13 for ; Tue, 7 Sep 2010 09:45:24 +0000 (UTC) Received: from pyhalov.cc.rsu.ru (pyhalov.cc.rsu.ru [195.208.252.128]) (authenticated bits=0) by mail.r61.net (8.14.4/8.14.1) with ESMTP id o8797wNb034381 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 7 Sep 2010 13:07:58 +0400 (MSD) (envelope-from alp@rsu.ru) Message-ID: <4C8600EE.4010000@rsu.ru> Date: Tue, 07 Sep 2010 13:07:58 +0400 From: Alexander Pyhalov User-Agent: Thunderbird 2.0.0.23 (X11/20091202) MIME-Version: 1.0 To: freebsd-ports@freebsd.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: libthr and libc X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2010 09:45:25 -0000 Hello. I found out interesting thing yesterday. I use 8.0-stable and observed the same behavior on 8.1-release. I tried to create ecpg (embedded SQL) program for PostgreSQL. The program linked but gave strange error (sqlca structure wasn't passed correctly to user program). I found out that the reason was in threads behavior - each time we called pthread_once (inside ecpglib) it didn't work. Program linked to libc.so and called some stubs from it. When I realised it, I linked program with libthr, and it started work correctly. Can someone explain why this stubs are in libc? Why didn't linker just throw a linking error? -- С уважением, Александр Пыхалов, системный администратор ЮГИНФО ЮФУ.