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

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
[–] pelya@lemmy.world 6 points 13 hours ago (3 children)

Do you know how to build portable executables?

configure --prefix=/proc/self/pwd

It even works in .so files and libtool.

[–] ozymandias117@lemmy.world 2 points 9 hours ago

I would generally just set the RPATH to $ORIGIN in the ELF file

[–] Jankatarch@lemmy.world 2 points 12 hours ago (1 children)
[–] pelya@lemmy.world 5 points 11 hours ago (1 children)

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 to configure, but it converts that into an absolute path, snd libtool and linker fail when encountering relative paths inside shared library dependencies.

[–] Jankatarch@lemmy.world 1 points 7 hours ago
[–] eleijeep@piefed.social 1 points 12 hours ago (1 children)

How would this differ from --prefix=$(pwd) ?

[–] pelya@lemmy.world 4 points 12 hours ago (1 children)

--prefix=$(pwd) is resolved at compile time. If you move your compiled .so files to a different directory, they stop working.

[–] eleijeep@piefed.social 1 points 12 hours ago (1 children)

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 install to install the binaries into the prefix. If the compiled program needs to know where it is installed it can read argv[0].

Have you seen this used somewhere?

[–] pelya@lemmy.world 3 points 12 hours ago

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.id will 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.