Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 May 1997 12:07:45 -0700
From:      John Polstra <jdp@polstra.com>
To:        dufault@hda.com
Cc:        hackers@freebsd.org
Subject:   Re: g++ shared library segfaults (SOLUTION)
Message-ID:  <199705111907.MAA15415@austin.polstra.com>
In-Reply-To: <199705111143.HAA29259@hda.hda.com>
References:  <199705111143.HAA29259@hda.hda.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In article <199705111143.HAA29259@hda.hda.com>,
Peter Dufault  <dufault@hda.com> wrote:
> Now back to the question at hand: David Nugent correctly guessed
> that I wasn't linking the shared libraries properly and the
> static constructors weren't executing.  Yes - don't overlook
> the prepending of ${DESTDIR}/usr/lib/c++rt0.o to SOBJS on older
> systems or the or the use of "gcc -shared" in -current.

The "right" way to do it on older systems is to set "CPLUSPLUSLIB=true"
in the Makefile (assuming that <bsd.lib.mk> is being used).  If
you're not using <bsd.lib.mk> then yes, it's necessary to manually
link in c++rt0.o for C++ shared libraries.

As you mentioned, on recent -current systems, "gcc -shared" does the
right thing, and CPLUSPLUSLIB is not needed.  I'm going to bring
that same functionality into the -2.2 branch soon.

John
--
   John Polstra                                       jdp@polstra.com
   John D. Polstra & Co., Inc.                Seattle, Washington USA
   "Self-knowledge is always bad news."                 -- John Barth



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705111907.MAA15415>