this post was submitted on 20 Aug 2026
350 points (99.7% liked)
Linux
67120 readers
820 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 7 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Do you know how to build portable executables?
It even works in .so files and libtool.
I would generally just set the RPATH to
$ORIGINin the ELF fileMay I have the explanation?
The executable will search for .so files not inside predefined paths like /usr/lib but inside it's current directory. You may theoretically put
.as an argument toconfigure, but it converts that into an absolute path, snd libtool and linker fail when encountering relative paths inside shared library dependencies.Thank you
How would this differ from
--prefix=$(pwd)?--prefix=$(pwd)is resolved at compile time. If you move your compiled .so files to a different directory, they stop working.I see what you mean, very clever solution if a program is using the configure prefix by compiling it into the binary.
That can't be very common though is it? Usually the configure prefix is just used by
make installto install the binaries into the prefix. If the compiled program needs to know where it is installed it can readargv[0].Have you seen this used somewhere?
I am using this myself in Android app, where you can write files only inside
/data/data/your.app.id/So naturally, if you want to publish a different app,
your.app.idwill be different, so you need to recompile all your Linux tools that you bundle inside your app.If you are not running your Linux tools on Android, you'd probably be better off using Docker or a chroot.