Comments (5)
The most practical option seems to be using a combination of ldd
to get the paths of all dependencies and objdump
to traverse the dependency tree of the binary, skipping the excluded libraries.
Some other options that I've considered follow.
Write a program which finds the libraries with objdump
and follows the dependencies instead of using ldd. /sbin/ldconf -p
and the RPATH
provide the list of folders in which to search.
The downside is that we have to keep this tool adjusted to the specifics of each platform were clodl is used. An advantage is that we can possibly build the closure of cross-compiled binaries with this approach.
Another option is to use lddtree from pax-utils, to distinguish between direct and transitive dependencies. Unfortunately, lddtree produces several megabytes of output which takes a while to produce and consume.
from clodl.
Using scanelf -qn
(from pax-utils) is an option. It's what lddtree
uses under the hood.
from clodl.
Yeah, tried that. It provides the same info as objdump -p | grep NEEDED
. Could use it in combination with ldd
instead of objdump
maybe.
from clodl.
Work in progress: master...fd/deptree-walk
from clodl.
Merged in e9f1339.
from clodl.
Related Issues (20)
- Apply binary fixups using patchelf HOT 1
- Option to filter out libjvm.so from output .jars HOT 2
- Move to CircleCI HOT 1
- Build closures of haskell libraries
- Implement binary_closure HOT 1
- Fix cp failures in tests HOT 2
- `binary_closure` failing to find `main` when linking HOT 11
- Closures of libraries named as *.so fail to build
- Closures of binaries without runfiles fail to build
- Closure of a cc_library fails to build
- Multiple invocations of `invokeMain` cause infinite loop
- bazel 0.22 support HOT 3
- closures does not work in system without `unzip` HOT 7
- closure depends on the system linker HOT 6
- clodl fails on executables built with ghc-8.10.2 HOT 3
- zip files of closures are not reproducible HOT 1
- Add tests of haskell binaries with a haskell_library and haskell_cabal_library
- Feature Request - Get return value (other than rc) from invokeMain
- Feature Request - Allow use to provide their own `build.gradle` and Java shim.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clodl.