Get the actual name of a library from its file

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Get the actual name of a library from its file

David Blaikie via cfe-dev
Hello everyone,


I'm looking for a function in Clang/LLVM which can get me the actual
name of a library from its file. For example, if I have a file called
"libtest.so.1.0.1", I'd like to get "test". You can think of it as the
name of the library required for passing to a linker.


Regards,

Dimitar Dobrev


_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Get the actual name of a library from its file

David Blaikie via cfe-dev
> On Nov 23, 2020, at 3:39 AM, Dimitar Dobrev via cfe-dev <[hidden email]> wrote:
>
> I'm looking for a function in Clang/LLVM which can get me the actual
> name of a library from its file. For example, if I have a file called
> "libtest.so.1.0.1", I'd like to get "test". You can think of it as the
> name of the library required for passing to a linker.


libtest.so.1.0.1 should not be used directly. Instead create a symbol link to it (named libtest.so) and then pass -ltest to linker.

--
Zhiwei Chen
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Get the actual name of a library from its file

David Blaikie via cfe-dev
In this case the library is input by my users, not me. I must be able to
handle any name.


Am 30.11.2020 um 05:34 schrieb 陈志伟:

>> On Nov 23, 2020, at 3:39 AM, Dimitar Dobrev via cfe-dev <[hidden email]> wrote:
>>
>> I'm looking for a function in Clang/LLVM which can get me the actual
>> name of a library from its file. For example, if I have a file called
>> "libtest.so.1.0.1", I'd like to get "test". You can think of it as the
>> name of the library required for passing to a linker.
>
> libtest.so.1.0.1 should not be used directly. Instead create a symbol link to it (named libtest.so) and then pass -ltest to linker.
>
> --
> Zhiwei Chen

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev