Comments (9)
sorry, but i don't see why it needs to set LD_LIBRARY_PATH. the bear
executable does not link against the libear.so
file.
from bear.
The rpath is for libconfig.so, not libbear.so
from bear.
okay, but from the report you sent i could not figure out why it is an issue. but now i understand that libconfig.so
is installed under /usr/local/lib*
and it is not by default in the loader search path. and i think this case you should use LD_LIBRARY_PATH
or teach your dynamic loader another way to find the dependencies. what OS/distro do you use anyway?
from bear.
This is plain vanilla CentOS 6.5. By default, /usr/local/lib is not searched for dependencies:
/home/btorpey/Bear-master $ cmake .
-- Looking for scons
-- Looking for qmake
-- Looking for qmake -- found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/btorpey/Bear-master
/home/btorpey/Bear-master $ make clean; make
[ 10%] Building C object src/CMakeFiles/bear.dir/stringarray.c.o
[ 20%] Building C object src/CMakeFiles/bear.dir/protocol.c.o
[ 30%] Building C object src/CMakeFiles/bear.dir/main.c.o
[ 40%] Building C object src/CMakeFiles/bear.dir/output.c.o
[ 50%] Building C object src/CMakeFiles/bear.dir/filter.c.o
[ 60%] Building C object src/CMakeFiles/bear.dir/json.c.o
Linking C executable bear
[ 60%] Built target bear
[ 70%] Building C object src/CMakeFiles/ear.dir/stringarray.c.o
[ 80%] Building C object src/CMakeFiles/ear.dir/protocol.c.o
[ 90%] Building C object src/CMakeFiles/ear.dir/environ.c.o
[100%] Building C object src/CMakeFiles/ear.dir/execs.c.o
Linking C shared library libear.so
[100%] Built target ear
/home/btorpey/Bear-master $ su
[root@nydevd015 Bear-master]# make install
[ 60%] Built target bear
[100%] Built target ear
Install the project...
-- Install configuration: "Release"
-- Up-to-date: /usr/local/share/doc/bear/COPYING
-- Up-to-date: /usr/local/share/doc/bear/README.md
-- Up-to-date: /usr/local/share/doc/bear/ChangeLog.md
-- Installing: /usr/local/bin/bear
-- Removed runtime path from "/usr/local/bin/bear"
-- Installing: /usr/local/lib64/libear.so
-- Up-to-date: /usr/local/etc/bear.conf
-- Up-to-date: /usr/local/share/man/man1/bear.1
[root@nydevd015 Bear-master]# exit
exit
/home/btorpey/Bear-master $ ldd `which bear`
linux-vdso.so.1 => (0x00007fffce9b3000)
libconfig.so.9 => not found
libc.so.6 => /lib64/libc.so.6 (0x0000003b20400000)
/lib64/ld-linux-x86-64.so.2 (0x0000003b1fc00000)
/home/btorpey/Bear-master $
from bear.
understand. i would prefer not to make any changes (specially not rpath
) into Bear build process to fix this issue. if i were you i would put LD_LIBRARY_PATH
initialization into my shell profile, or if you are root on that machine you could edit /etc/ld.so.conf
to make it system wide.
from bear.
OK. Ideally any package (e.g., libconfig) that installs itself in a non-default location would manipulate ld.so.conf as part of installing itself. (I notice that on my machine, mysql, oprofile, and qt all do that).
Still, it might be worth pointing out in your docs -- I'm generally happy to rtfm when installing something like bear, but I also generally don't bother doing that with dependencies.
Thanks again!
from bear.
Also, while I understand this topic is somewhat controversial, there is at least one project that seems to feel that rpath is OK:
/home/btorpey $ readelf -d which clang
| grep RPATH
0x000000000000000f (RPATH) Library rpath: [$ORIGIN/../lib]
from bear.
Use of rpath
vs LD_LIBRARY_PATH
is debatable. IMO, under certain circumstances, using rpath
is better than using LD_LIBRARY_PATH
.
In my case, I'm installing Bear in a non standard location, and I don't have root access on the build machine, that I'm on. I can't manipulate ld.so.conf
. I prefer rpath
over LD_LIBRARY_PATH
. Here is the tweak that I used to retain the rpath
in the bear
binary. YMMV.
PKG_CONFIG_PATH=/your/custom/prefix/lib/pkgconfig cmake -DCMAKE_INSTALL_PREFIX=/your/custom/prefix -DCMAKE_SKIP_RPATH=YES -DCMAKE_EXE_LINKER_FLAGS="-Wl,-R/your/custom/prefix/lib" ../Bear
from bear.
Thanks you Kumar for sharing your thoughts. I'm happy to see that current makefile allows to use rpath
when that demanded, but also leave the option not to use it. Your tweak might go into the readme file. Thanks a lot!
from bear.
Related Issues (20)
- [Feature Request] Enable preload mode on macOS with SIP disabled HOT 2
- How does bear work? HOT 1
- Calling `bear -- emmake make` from makefile has different output than without the makefile HOT 3
- `bear intercept` prints empty events.json with dynamically linked arm-none-eabi-gcc HOT 3
- Compile option "--include <path>" generates incorrect database entry HOT 2
- compile asan, but the content of compile_commands.json is empty HOT 4
- makeopts ignored HOT 3
- can't install bear without sudo HOT 2
- has no member named ‘always_print_primitive_fields’ HOT 7
- How can I create the compile_commands.json for the Bear project? HOT 3
- Combining compile & link with Clang results in erroneous entry HOT 3
- Empty compilation database when compiling OpenBSD kernel HOT 2
- bear::func_test failed 7 tests (3.1.4) HOT 8
- [Build failed] ld cannot find stdc++fs: ld: undefined reference to std::filesystem HOT 4
- Question - how to capture built in compiler options HOT 1
- How to support emcc compiler? HOT 1
- bear 3.1.4 hangs when proxy is enabled in ubuntu 24.04 HOT 3
- I get the error: "ERROR: ld.so: object '/usr/$LIB/bear/libexec.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored." HOT 3
- Build2 compatibility HOT 5
- Cannot open /usr/local/bin/bear: No such file HOT 1
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 bear.