[CMake] Creating a static lib from other static libs, HOW?
Juan Sanchez
Juan.Sanchez at amd.com
Tue Sep 18 15:50:20 EDT 2007
To be posix compliant, the path name is not to be encoded into the
archive. While I was able to create an archive
ar crv foo.a A/a.o B/a.o
and the symbols from both object appeared, this doesn't seem to be very
safe. Especially since doing this:
ar crv foo.a A/a.o
ar crv foo.a B/a.o
will result in an archive with only the symbols from B/a.o.
There is a non-posix compliant extension to gnu ar, but it seems to be
fraught with peril.
>From the ar manpage:
P Use the full path name when matching names in the archive.
GNU ar
can not create an archive with a full path name (such
archives are
not POSIX complaint), but other archive creators can. This
option
will cause GNU ar to match file names using a complete path
name,
which can be convenient when extracting a single file
from an
archive created by another tool.
Juan Sanchez wrote:
> Hello Brandon,
>
> How do you create the final archive without the ar command?
>
> Juan
>
> Brandon Van Every wrote:
>> On 9/18/07, Juan Sanchez <Juan.Sanchez at amd.com> wrote:
>>> Even with Brandon's solution, I don't think ar let you add multiple .o
>>> files of the same name in the archive.
>> I'm going to guess you meant, "Even with Brandon's solution that
>> doesn't use AR, you can't add multiple .o files of the same name to a
>> library." I'm not sure about that. When I pass CMake objects to a
>> library, I provide qualified pathnames, so I don't know if the name of
>> the object file matters. You can't have multiple function
>> definitions, but that's about the code, not the object files. I've
>> not had to deal with this issue myself. You'd need to try my way and
>> see what happens.
>>
>>
>> Cheers,
>> Brandon Van Every
>> _______________________________________________
>> CMake mailing list
>> CMake at cmake.org
>> http://www.cmake.org/mailman/listinfo/cmake
>>
>>
>
>
More information about the CMake
mailing list