shared-libraries

How to list dependencies of c/c++ static library?

时光毁灭记忆、已成空白 提交于 2019-12-05 20:20:18
问题 For a static library (.a file), how to list the module-level dependencies of it? I know for a shared library (.so), we can use objdump or readelf to do this: objdump -p test.so or readelf -d test.so I can get something like NEEDED libOne.so NEEDED libc.so.6 But for a static library, I can only get the dependencies in symbol-level, for example, by running objdump -T test.a I will get some thing like: 00000000 DF UND 00000000 QByteArray::mid(int, int) const 00000000 DF UND 00000000 QUrl:

How to call functions in one Jenkins Shared Library from another

拜拜、爱过 提交于 2019-12-05 17:45:38
I have two separate libraries (Library A and Library B), I have defined them on the jenkins configuration so they can be both called from the pipeline. From Library A I would like to call some functions/methods that are defined in Library B. My logic tells me that I need to import and probably create an instance of Library B inside Library A before I can have access to any of Library B methods. But I have not been successful. I am no expert in Java, however any guidance is greatly appreciated. In Jenkinsfile: @Library(['libA', 'libB']) _ and you can call between them: import org.myorg.PruebaA

Can I determine which compiler/linker flags where used to create a binary-only shared library?

扶醉桌前 提交于 2019-12-05 17:30:42
问题 I am wondering if there is a way to find out which g++ compiler/linker flags where used in creating a binary-only library. For example there might be a 3rd party shared library (only .h/.so files are there). So I think it would be a good idea to use the same g++ flags when compiling and linking my own application (that is using the binary-only 3rd party library). Specifically I am asking for compiler flags like -fno-inline -pthreads -mtune=arch -O2 and also it would be of interest which

Is it possible to get the signature of a function in a shared library programmatically?

一个人想着一个人 提交于 2019-12-05 17:21:51
问题 The title is clear, we can loaded a library by dl_open etc.. But how can I get the signature of functions in it? 回答1: This answer cannot be answered in general. Technically if you compiled your executable with exhaustive debugging information (code may still be an optimized, release version), then the executable will contain extra sections, providing some kind of reflectivity of the binary. On *nix systems (you referred to dl_open ) this is implemented through DWARF debugging data in extra

Cross compile shared libraries

余生长醉 提交于 2019-12-05 17:05:30
I'd like to know if it is possible (and if yes: how) to cross compile shared libraries with Go. Say I have this code: package main import "C" //export DoubleIt func DoubleIt(x int) int { return x * 2 } func main() {} in src/doubler/main.go . On Mac I can run go build -o libdoubler.dylib -buildmode=c-shared doubler to get a shared library called libdoubler.dylib . Similar on linux, just with the extension .so . Now I'd like to use Linux as the main platform to build my libraries (for Mac and Windows). What are my options? Setting GOOS to darwin and running the above on linux, I get can't load

unexpected reloc type 0x03

£可爱£侵袭症+ 提交于 2019-12-05 16:34:54
I'm trying to execute a program compiled with my own library, but when i execute the program I get the following error: ./a.out ./a.out: error while loading shared libraries: ../../lib-arm/libCustomLibrary.so: unexpected reloc type 0x03 That just happens with the Release execution, with the Debug execution all works fine. Where do you think that may be the problem? The CustomLibrary Library is linked with the following arguments: -lSubLibrary -fPIC -Wl,-Bstatic -lboost_system -lboost_filesystem -lboost_thread -lpthread -Wl,-Bdynamic -lrt I attatch the lld unix library command output for my

Add a native lib to an APK

大憨熊 提交于 2019-12-05 16:15:15
I'm developing an Android application that uses native code. I need to add an external native library to my APK's lib folder on every build. How can I do that? Thanks. Put the library in the native library path which defaults to "libs" in your project folder. If you built the native code for the 'armeabi' target then put it under libs/armeabi. If it was built with armeabi-v7a then put it under libs/armeabi-v7a. <project>/libs/armeabi/libstuff.so 来源: https://stackoverflow.com/questions/4365227/add-a-native-lib-to-an-apk

Loading Ada shared objects in Perl with DynaLoader.pm

 ̄綄美尐妖づ 提交于 2019-12-05 15:55:31
问题 Long time listener, first time caller. I'm aware this is a somewhat obscure question, and don't expect too much. :-) I have the following Ada files: greeter.ads package Greeter is procedure Hello; end Greeter; greeter.adb with Ada.Text_IO; use Ada.Text_IO; package body Greeter is procedure Hello is begin Put_Line ("Hello, world!"); end Hello; end Greeter; And compile them into a shared object like this: gnatmake -z -fPIC greeter.adb gcc -shared -o libgreeter.so greeter.o This compiles fine.

Debug C-library from Python (ctypes)

时间秒杀一切 提交于 2019-12-05 15:31:28
问题 I have a Python-program that uses ctypes and a C-shared library (dll-file). As an IDE, I am using Eclipse, where both projects will be developed (the C-shared library and the python program that uses it). My idea is: when I start the Python-program in Debug-mode, can I somehow debug the shared library, which is written in C, too? Meaning: Can I set breakpoints and when the Python-program reaches that breakpoint in the shared library, executing stops and I can change variable values etc.?

Loading shared libraries with dependencies on Android

≡放荡痞女 提交于 2019-12-05 15:05:07
I'm porting a big chunk of native code with several interdependent libraries. Loading the code fails since Android linker only looks dependencies in /system/lib/ and not in the application install directory at /data/data/com.packagename.nnn/lib . As a first workaround I loaded all .so's from Java with System.load() in correct dependency order . This solution isn't satisfactory for me mostly because the set of libraries changes from build to build due to plugin architecture. Also the UI shouldn't need to know that much about native libs. I've found that Android does not support RPATH or setting