[Nix-dev] I think I've found an ar archive bug

Tony White tonywhite100 at googlemail.com
Sun Oct 18 23:39:31 CEST 2009


2009/10/17 Lluís Batlle <viriketo at gmail.com>:
> The generic builder script has this excerpt of code:
>    # By default, disable static builds.
>    if test -z "$dontDisableStatic"; then
>        if grep -q enable-static $configureScript; then
>            configureFlags="--disable-static $configureFlags"
>        fi
>    fi
>
> So, if you want the static library, set dontDisableStatic=true in your
> derivation.
>
> Why does audacity want the static version of the library? It should
> not care much on that.
>
> Regards,
> Lluís.
>
> 2009/10/17 Tony White <tonywhite100 at googlemail.com>:
>> Hi guys,
>> I've been trying to get audacity to build, with some interesting
>> results. However, I think I've found a problem and I need someone else
>> to confirm it.
>> The problem is with the libmad package (An optional dependency of
>> audacity) and possibly any other src archive that uses the ar archive
>> format to gather .o files into a single lib.
>> http://en.wikipedia.org/wiki/Ar_(Unix)
>> With libmad there should be a lib/libmad.a file created as a result of
>> the compilation but it is not. I used fedora 12 here to do a test and
>> the output result should be :
>>
>> include/mad.h
>> lib/libmad.a
>> lib/libmad.la
>> lib/libmad.so (A symlink to lib/libmad.so.0.2.1)
>> lib/libmad.so.0 (A symlink to lib/libmad.so.0.2.1)
>> lib/libmad.so.0.2.1
>>
>> Using NixOs with binutils added as a buildInput the ouput is :
>>
>> include/mad.h
>> lib/libmad.la
>> lib/libmad.so (A symlink to lib/libmad.so.0.2.1)
>> lib/libmad.so.0 (A symlink to lib/libmad.so.0.2.1)
>> lib/libmad.so.0.2.1
>>
>> And lib/libmad.a does not get created.
>>
>> The worst thing about all this is that where the .o files are created
>> for libmad isn't even clear. They get created in a folder called .libs
>> in the build dir, so you can't even see the folder in normal directory
>> output in a console or without showing hidden files in kde's dolphin
>> file manager.
>>
>> libmad is quite a quick compile and nice as a test case, so could
>> anyone please investigate why the ar archive doesn't get created
>> please? I've managed to workaround it but I think I'm seeing the same
>> thing with portaudio and if this is system wide, there could be
>> potential for problems. Who knows how many developers want to bundle
>> .o files as a .a ar archives?
>>
>> So my questions are : Is this a bug or just bad build scripts? If I
>> manually create the libmad.a and copy it to lib/, do I need to run
>> patchelf on it seperately?
>>
>> Thanks,
>> Tony
>> _______________________________________________
>> nix-dev mailing list
>> nix-dev at cs.uu.nl
>> https://mail.cs.uu.nl/mailman/listinfo/nix-dev
>>
>
Hi guys,
Thanks for the replies. So libmad.a is a static library?
Audacity wants libmad.a because it uses the .o files inside the ar
archive as compile time dependencies and if I build it as shared on
fedora libmad.a is created.

Thanks,
Tony



More information about the nix-dev mailing list