[Libosinfo] [PATCH] build: Fix "--no-undefined" linker's flag for OSX

Fabiano Fidêncio fidencio at redhat.com
Wed May 11 12:35:24 UTC 2016


On Wed, May 11, 2016 at 2:29 PM, Christophe Fergeau <cfergeau at redhat.com> wrote:
> Hey,
>
> On Wed, May 11, 2016 at 08:43:52AM +0200, Fabiano Fidêncio wrote:
>> Apple's linker doesn't have support to "--no-undefined" and we must use
>> something equivalent, like: "-undefined,error".
>>
>> The patch was test by Programmingkid and his positive feedback can be
>> seen here:
>> https://www.redhat.com/archives/libosinfo/2016-May/msg00164.html
>>
>> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1305016
>>
>> Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
>> ---
>>  configure.ac | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/configure.ac b/configure.ac
>> index ad38464..f7ecb8f 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -97,6 +97,10 @@ case "$host" in
>>      NO_UNDEFINED_LDFLAGS="-no-undefined"
>>      ;;
>>
>> +  darwin*)
>> +    NO_UNDEFINED_LDFLAGS="-Wl,-undefined,error"
>> +    ;;
>> +
>
> I was initially wondering if this is a difference of toolchain (clang vs
> gcc) or of OS, but I haven't been able to hit this issue when building
> libosinfo with clang on my linux machine. So ACK to this patch, even
> though it might need some more refinements in the future (eg what
> happens if someone built gcc on osx and is building libosinfo with it,
> do we get everything right?) We can deal with that when someone reports
> it ;)

Christophe,

That seems to be exactly the case of Porgrammingkid (he is using gcc
on OS X) and the issue was solved for him.

Thanks for the review and I'll push the patch.

>
> Christophe




More information about the Libosinfo mailing list