From owner-freebsd-ports Wed Apr 21 13:23:26 1999 Delivered-To: freebsd-ports@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 560B315828 for ; Wed, 21 Apr 1999 13:22:29 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.2/8.9.2) id NAA08981; Wed, 21 Apr 1999 13:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: by hub.freebsd.org (Postfix, from userid 32767) id 064121589C; Wed, 21 Apr 1999 13:15:49 -0700 (PDT) Message-Id: <19990421201549.064121589C@hub.freebsd.org> Date: Wed, 21 Apr 1999 13:15:49 -0700 (PDT) From: lennox@cs.columbia.edu To: freebsd-gnats-submit@freebsd.org X-Send-Pr-Version: www-1.0 Subject: ports/11265: Shared libraries don't work when built with egcs port Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 11265 >Category: ports >Synopsis: Shared libraries don't work when built with egcs port >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Apr 21 13:20:01 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Jonathan Lennox >Release: 3.1-STABLE >Organization: Columbia University >Environment: FreeBSD conrail.cs.columbia.edu 3.1-STABLE FreeBSD 3.1-STABLE #1: Wed Mar 3 23:45:27 EST 1999 lennox@conrail.cs.columbia.edu:/usr/cvsrc/RELENG_3/src/sys/compile/CONRAIL i386 >Description: I pulled down the egcs-1.1.2 port in late March. When I build a shared library with it, the resulting .so has undefined symbols in it that aren't pulled in from anyplace. This isn't a problem when I link, but when I try to run an executable linked with the .so, I get errors from /usr/libexec/ld-elf.so of the form /usr/libexec/ld-elf.so.1: ./libbaz.so: Undefined symbol "__deregister_frame_info" This only seems to happen if both the shared library and the executable use only C code; if anything uses C++ the missing symbols seem to get pulled in from somewhere. This symbol seems to be coming in from the two files /usr/local/lib/gcc-lib/i386-portbld-freebsd3.1/egcs-2.91.66/crtbeginS.o /usr/local/lib/gcc-lib/i386-portbld-freebsd3.1/egcs-2.91.66/crtendS.o >How-To-Repeat: bash-2.02$ cat bar.c extern void baz(void); int main() { baz(); exit(0); } bash-2.02$ cat baz.c #include void baz(void) { printf("baz: hello world!\n"); } bash-2.02$ egcc -Wall -c -fPIC baz.c bash-2.02$ egcc -shared -Wl,-h -Wl,libbaz.so -o libbaz.so baz.o bash-2.02$ egcc -Wall -c bar.c bash-2.02$ egcc -o bar -L. bar.o -lbaz bash-2.02$ LD_LIBRARY_PATH=. ./bar /usr/libexec/ld-elf.so.1: ./libbaz.so: Undefined symbol "__deregister_frame_info" bash-2.02$ egcc -v Reading specs from /usr/local/lib/gcc-lib/i386-portbld-freebsd3.1/egcs-2.91.66/specs gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release) (Note: this is a (very) simplified version of a part of the Mozilla build system, which is where I noticed the problem.) >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message