[Top][All Lists]

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

Re: -no-undefined vs gcc 4.6.0

From: LRN
Subject: Re: -no-undefined vs gcc 4.6.0
Date: Sat, 19 Mar 2011 13:25:51 +0300
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b13pre) Gecko/20110315 Thunderbird/3.3a4pre

On 19.03.2011 0:17, Vincent Torri wrote:

On Sat, 19 Mar 2011, LRN wrote:

On 18.03.2011 23:51, Vincent Torri wrote:

On Fri, 18 Mar 2011, LRN wrote:

Since gcc 4.6.0 it is no longer possible to use LDFLAGS=-no-undefined
gcc now says something like this:
gcc.exe: error: unrecognized option '-no-undefined'
Before 4.6.0 it was possible to do that, and gcc said only this:
gcc.exe: unrecognized option '-no-undefined'
That is, unrecognized option was not considered a show-stopper, and everything worked just fine - the option, being part of LDFLAGS, eventually reached libtool, and libtool were taking the clue to disallow undefined symbols. Not anymore. Now i have to pass LDFLAGS=-Wl,-no-undefined. Which is ok from gcc' point of view, but libtool is unable to recognize this argument in such form and simply refuses to build shared libraries outright. Not sure if it's a bug or a feature, and how to work through that without making groundbreaking changes in software packages that use libtool.

I think that you have to pass -no-undefined to the ***_LDFLAGS variable of your library:

libproject_la_LDFLAGS = -no-undefined

or, globally:

AM_LDFLAGS = -no-undefined

it has always worked for me, without gcc warning.

It's not my library. I'm compiling mpc-0.8.2

ok. Anyway you have to pass -Wl,-no-undefined. It's an option for the linker [1], not for gcc [2]

Vincent Torri

I *know* that it's a linker option. And i know that i have to pass it with -Wl because of that. What i do not know is how to make libtool see it when it is passed like that.

Finally got it to work with `make libmpc_la_LDFLAGS="-version-info 2:0:0 -no-undefined"', because mpc does not use AM_LDFLAGS in the link command that is used to build libmpc (mpc devs are probably the ones to blame, but right now i just want to make it work). Although i've found no way to pass such an option with spaces to `make' from a variable expansion (i.e. `make $opts'), so i've had to hard-code it into make invocation instead.

I expect to find a lot of libtool-using projects that will require such hacks or workarounds, because `unrecognized option '-no-undefined'' is very common.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]