tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: LDFLAGS and -rdynamic ?



On Wed, Aug 10, 2016 at 11:15:05AM -0400, scole_mail wrote:
> I was trying to update the ski package http://gnats.netbsd.org/51103
> which depends on gtk and others things.  It contains a Makefile.am
> file that has stuff like
> 
> if HPUX
> # on HPUX libtool does not work w/ -all-static
> ski_LDFLAGS=-static
> else
> ski_LDFLAGS=-all-static
> endif
> 
> if LINUX
> # Debian wants everything to be dynamically linked
> ski_LDFLAGS = 
> endif

Yes, it normally is a really bad idea to force static linkage. Don't do
that please. This is even more important for GUI stuff that often wants
to use things like iconv(3).

> I've created a patch to add -rdynamic flag for a new NetBSD case:
> 
> --- src/Makefile.am.orig        2008-02-04 23:11:38.000000000 -0500
> +++ src/Makefile.am     2016-04-20 09:50:38.000000000 -0400
> @@ -130,7 +130,12 @@
>  ski_LDFLAGS = 
>  endif
>  
> -ski_LDADD= libski.la -ldl
> +# XXX others beside netbsd require?, rdynamic for gtk/libglade
> +if NETBSD
> +ski_LDFLAGS=-static -rdynamic
> +endif
> +
> +ski_LDADD= libski.la

EXPORT_SYMBOLS_LDFLAGS is the "portable" spelling of -rdynamic.

> Without the patch, I get undefined reference errors during linking like
> 
> lcInit.c:(.text+0x49): undefined reference to `_XlcGenericLoader'
> xcb_disp.c:(.text+0x1cd): undefined reference to `xcb_get_file_descriptor'
> fcfreetype.c:(.text+0x2013): undefined reference to `FT_Get_PS_Font_Info'
> fcfreetype.c:(.text+0x2300): undefined reference to`FT_Get_BDF_Property'
> 
> Is there a better or preferred way to handle this LDFLAGS variable?

Link explicitly to xcb and freetype? No idea about _XlcGenericLoader at
the moment though.

Joerg


Home | Main Index | Thread Index | Old Index