Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Nov 2018 22:31:52 +0100
From:      Joerg Sonnenberger <joerg@bec.de>
To:        freebsd-hackers@freebsd.org
Subject:   Re: help with dl module and clang
Message-ID:  <20181108213152.GA22982@britannica.bec.de>
In-Reply-To: <E3B4CDF3-2DE9-4785-963C-9158105C263E@FreeBSD.org>
References:  <4B8101F4-9A89-4486-8DF3-93DC799EF6D4@cs.huji.ac.il> <E3B4CDF3-2DE9-4785-963C-9158105C263E@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Nov 03, 2018 at 04:47:37PM +0100, Dimitry Andric wrote:
> On 3 Nov 2018, at 15:51, Daniel Braniss <danny@cs.huji.ac.il> wrote:
> > 
> > I have a program that loads some modules via dlopen(),  these modules call some routines
> > which are in the main program, this works when using gcc, but with cc it does not.
> > 
> > when compiling the main program I use  -export-dynamic, and the modules link fine when compiled with
> > gcc, but when compiling with clang/cc i get dlerror: ...Undefined symbol …
> > BTW, when linking the main program with cc I get
> > 	/usr/bin/ld: warning: cannot find entry symbol xport-dynamic; defaulting to 0000000000402140
> 
> Instead of using -export-dynamic (which is a linker flag) as a flag to
> cc, try using -Wl,-export-dynamic instead.  Now, the linker interprets
> this as the -e flag, which is something totally different.

Or cc -rdynamic.

Joerg



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