| 10 Jun 2022 |
kn | dlopen() search order on linux is basically 1. DT_RPATH (deprecated), 2. LD_LIBRARY_PATH, 3. DT_RUNPATH, 4. default libs | 04:41:56 |
kn | * dlopen() search order on linux is basically 1. DT_RPATH (deprecated), 2. LD_LIBRARY_PATH, 3. DT_RUNPATH, 4. default paths (useless with nix) | 04:42:19 |
kn | DT_RUNPATH is read from the calling object, i.e. if a gui app uses libQtCore.so to eventually dlopen() a module, the library path of libQtCore.so alone is used | 04:44:44 |
kn | which is generally fine in non-nix systems, but on nixos where you define your gui app's dependency on the smart-card module in the gui app and not the generic Qt library, things are different | 04:45:54 |
kn | that means you can patchelf --set-rpath /path/to/module my-gui-program but it won't help anything and LD_LIBRARY_PATH is required to overrule the library path for everything | 04:47:08 |
kn | on at least openbsd, dlopen() will continue to search the main program's runtime path if the calling object (here the Qt library) doesn't have it in its search path | 04:49:20 |
kn | which in turn allows exactly this kind of minimal patchelf ... fixup above to work | 04:50:07 |
kn | i think openbsd's behaviour makes sense, and it is especially useful on nixos where default library paths (/usr/lib, etc.) never yield a working fallback | 04:51:08 |
Mic92 | In reply to @kn:envs.net TIL dlopen(3) treats DT_RUNPATH differently on linux and bsd, which is why the program needs LD_LIBRARY_PATH=/path/to/module on linux but only /path/to/module added to DT_RUNPATH on e.g. openbsd Some environment variable for libraries that is not inherited by child processes would be also useful. Than we could just set a path for an executables but won't break other binaries that are called from it. | 05:47:03 |
Mic92 | One could have a special patched libc that has a different dlopen behavior and than patchelf it's link loader just for applications that needs it. | 05:50:55 |
kn | In reply to @joerg:thalheim.io Some environment variable for libraries that is not inherited by child processes would be also useful. Than we could just set a path for an executables but won't break other binaries that are called from it. I think LD_PRELOAD is not inherited, but it takes object names not paths, so this semantic change might not be applicable to every program expecting prefix based lookup | 05:51:03 |
Mic92 | In reply to @kn:envs.net I think LD_PRELOAD is not inherited, but it takes object names not paths, so this semantic change might not be applicable to every program expecting prefix based lookup Maybe there could be a special LD_PRELOAD that just preloads further libraries. | 05:52:44 |
Mic92 | like a list | 05:52:47 |
Mic92 | If an object is already loaded than dlopen should just use that, no? | 05:53:16 |
kn | In reply to @joerg:thalheim.io If an object is already loaded than dlopen should just use that, no? yes | 05:54:43 |
Mic92 | Also are you, that LD_PRELOAD is not inherited? | 05:54:54 |
kn | In reply to @joerg:thalheim.io Also are you, that LD_PRELOAD is not inherited? I'm not [sure], that's why I wrote "think" | 05:55:23 |
Mic92 | This tool depends on LD_PRELOAD being inherited: https://github.com/rizsotto/Bear | 05:56:06 |
kn | just reread ld.so(1) and the env var is inherited, but --preload is there as a one-shot mechanism | 05:56:58 |
kn | * just reread ld.so(8) and the env var is inherited, but --preload is there as a one-shot mechanism | 05:57:46 |
kn | In reply to @joerg:thalheim.io One could have a special patched libc that has a different dlopen behavior and than patchelf it's link loader just for applications that needs it. you can also use ldconfig(8) :) | 06:03:56 |
| 13 Jun 2022 |
woobilicious | Mic92: how do I configure networking to work in nixos-shell? did I just forget to enable it in my kernel. | 21:56:11 |
woobilicious | sure enough CONFIG_VIRTIO_NET was disabled...lol | 22:00:38 |
| 14 Jun 2022 |
| problems changed their profile picture. | 00:41:53 |
Mic92 | woobilicious: yeah. This is really just the builtin qemu networking. I don't think nixos-shell itself enables virtio for networking but maybe the qemu abstraction that it takes from nixpkgs, does that: https://github.com/Mic92/nixos-shell/blob/master/share/modules/nixos-shell-config.nix | 07:08:11 |
| 19 Jun 2022 |
woobilicious | Anyone else having issues with 9p file system? | 09:11:03 |
Mic92 | 9p sometimes takes a while to sync data back | 15:13:45 |
Mic92 | We should have mold in our stdenv :) https://twitter.com/rui314/status/1537279524341432320 | 15:14:40 |
K900 | I think we have an stdenv-with-mold somewhere | 15:16:21 |
K900 | I also think it's pretty busted | 15:16:26 |