zlacker

[parent] [thread] 5 comments
1. patrck+(OP)[view] [source] 2022-05-11 10:18:17
Yeah, this is received unix lore: anything needed to recover a system needs to be statically linked and in /bin or /sbin.
replies(3): >>adrian+B2 >>sylwar+A3 >>severi+54
2. adrian+B2[view] [source] 2022-05-11 10:38:39
>>patrck+(OP)
That was indeed the tradition, but on Linux the GNU libc wants to be only dynamically linked, which creates a lot of problems for those who want static executables.

Because of that, in many Linux distributions there are few, if any, static executables. Due to this, it may happen that a botched glibc upgrade makes the system unusable, because no executable can be started to repair it (nowadays many distributions have a static busybox for such situations). I have seen this a couple of times, and the first time I could not understand what happened, because I was used to older systems, where the commands that I tried to execute (e.g. ls or mv) had been statically linked. Such a thing could never happen in a traditional UNIX or Linux system, before glibc disallowed static linking.

The GNU libc should have been split into a libc with most of the functions, which may be linked statically without problems, and into a small library with the name resolving functions, which could be linked dynamically only by the programs which need those functions.

Even better, the name resolving functions should have been organized in such a way to be able to use their default configuration with static linking and choose dynamic linking only when you really intend to override the default configuration when using less common services, e.g. NIS.

replies(1): >>hnlmor+w31
3. sylwar+A3[view] [source] 2022-05-11 10:47:03
>>patrck+(OP)
then: statically linked bins into /bin, all the others in /usr/bin and 2 symlinks /sbin -> /bin, /usr/sbin -> /usr/bin. It requires duplicate binaries: one version statically linked and the other not: I still want "env" to exist as statically linked, but tons of scripts start with this horrible '#/usr/bin/env MYPREFEREDSCRIPTENGINE'
4. severi+54[view] [source] 2022-05-11 10:52:58
>>patrck+(OP)
I once heard about a "ln" variant called "sln", statically linked, as opposed to the normal ln one, so you could fix a system where the dynamic loader is broken and thus ln is unusable. I can't find it on Ubuntu, though.
◧◩
5. hnlmor+w31[view] [source] [discussion] 2022-05-11 16:10:13
>>adrian+B2
This happened to me on arch recently. I updated pacman but it didn’t warn me it needed an updated glibc. Now pacman refuses to run.

It should be easy enough to repair but it was just an old laptop I wanted to test something on so I ended up throwing the laptop back in the draw instead.

replies(1): >>nephan+Hq2
◧◩◪
6. nephan+Hq2[view] [source] [discussion] 2022-05-11 23:19:19
>>hnlmor+w31
The good thing about arch packages being just tar archives is when pacman fails, you can often fix it by `tar xf` ing the right packages at the root. It's ugly but it works most of the time
[go to top]