From owner-freebsd-hackers Thu Jul 27 07:44:36 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.11/8.6.6) id HAA23391 for hackers-outgoing; Thu, 27 Jul 1995 07:44:36 -0700 Received: from rocky.sri.MT.net (sri.MT.net [204.94.231.129]) by freefall.cdrom.com (8.6.11/8.6.6) with ESMTP id HAA23384 for ; Thu, 27 Jul 1995 07:44:33 -0700 Received: (from nate@localhost) by rocky.sri.MT.net (8.6.12/8.6.12) id IAA01203; Thu, 27 Jul 1995 08:46:32 -0600 Date: Thu, 27 Jul 1995 08:46:32 -0600 Message-Id: <199507271446.IAA01203@rocky.sri.MT.net> To: "Amancio Hasty Jr." Cc: hackers@FreeBSD.org Subject: Re: ld.so: ivs: libcompat.so.2.0: Undefined error: 0 In-Reply-To: <199507270644.XAA00489@rah.star-gate.com> References: <199507270644.XAA00489@rah.star-gate.com> Reply-To: nate@sneezy.sri.com (Nate Williams) From: nate@sneezy.sri.com (Nate Williams) Sender: hackers-owner@FreeBSD.org Precedence: bulk > So whats the story with libcompat? It needs to be compiled static and not shared. :) > I tried to compile it as a shareable object: > make > building shared compat library (version 2.0) > regex.so: Definition of symbol `_regerror' (multiply defined) > regerror.so: Definition of symbol `_regerror' (multiply defined) > *** Error code 1 That is why it must be compiled shared. A *bug* in the loader prior to 2.0.5 allowed it to build shlibs with symbols that had multiple definitions. So, the symbol which was used depended on it's position in the build at creation time. In all honesty, this problem still exists with the static libraries as well, but since the loader isn't aware of multiply defined symbols because each .o file is unique it's not seen. The solution is to remove the dependency of libcompat in whatever program requires libcompat and send the changes back to the maintainer. Nate