about summary refs log tree commit diff
path: root/pkgs/build-support/libredirect
Commit message (Collapse)AuthorAge
* libredirect: fix build on darwinMario Rodas2020-01-23
| | | | Fix build failure on darwin due to absence of `O_TMPFILE`.
* libredirect: fix `access` return typeDemin Dmitriy2019-11-12
| | | | | `access` should return `int` not `int*`. Actually compiler produced identical assembly with any of those types, so by luck it "just worked".
* libredirect: fix argument forwarding in open* functionsDemin Dmitriy2019-11-12
| | | | | Flag `O_TMPFILE` was added in Linux 3.11. It affects whether or not `mode` argument should be passed.
* libredirect: add posix_spawnp supportMaximilian Bosch2019-06-18
| | | | | | | | | | | | After bumping sublime3 in #61636 we realized that saving files as root doesn’t work anymore and somehow the paths weren’t patched by `libredirect`. After some debugging it came out that Sublime switched from `posix_spawn(3)` to `posix_spawnp(3)` to start new processes internally. Since `libredirect` only handled the former, `/usr/bin/pkexec` stopped being redirected. Wrapping `posix_spawnp` fixes the problem.
* libredirect: remove dlopen supportJan Tojnar2019-05-04
| | | | | | | | | While it might be useful in some cases, there are too many caveats to be worth it. When libredirect intercepts dlopen call and calls the original function, the dynamic loader will use libredirect.so's DT_RUNPATH entry instead of the one from the ELF file the dlopen call originated from. That means that when program tries to dlopen a library that it expects to find on its RPATH, the call will fail. This broke Sublime Text for just that reason.
* libredirect: add support for openat and dlopenJan Tojnar2019-04-20
| | | | | | | gobject-introspection uses glib’s g_module_open function, which in turn relies on dlopen. I also implemented openat, since I initially thought this function was used but turns out dlopen uses the openat signal directly. We might as well keep it, even thought I do not need it at the moment.
* libredirect: set install_name on Darwinzimbatm2018-11-14
| | | | fixes https://github.com/NixOS/nixpkgs/pull/50246#issuecomment-437975038
* libredirect: introduce optional setup-hookzimbatm2018-11-14
| | | | | | | This allows to simplify the usage of libredirect inside of nix build sandboxes. Add "libredirect.hook" to the build inputs to get everything linked in automaticall. All that's left is to set NIX_REDIRECTS and call the target program.
* libredirect: specify libNamezimbatm2018-11-13
| | | | | | reduces a bit of duplication and can also be used from the outside: export LD_PRELOAD=${libredirect}/lib/${libredirect.libName}
* libredirect: Add preload wrapper for stat()aszlig2018-11-12
| | | | | | | | | | | | | | Pull request #50246 was merged a bit too quickly and it was supposed to fix libredirect on Darwin. However it still failed on Darwin and this was missed by the person merging the pull request. The reason this was failing was that there is no __xstat* on Darwin. So I'm adding a wrapper for stat() as well as it works on Darwin and it still doesn't hurt on GNU/Linux. Signed-off-by: aszlig <aszlig@nix.build> Cc: @edolstra, @zimbatm
* libredirect: Add a small testaszlig2018-11-12
| | | | | | | | | | | | | | | | This is just a sanity check on whether the library correctly wraps the syscalls and it's using the "true" executable for posix_spawn() and execv(). The installCheckPhase is not executed if we are cross-compiling, so this shouldn't break cross-compilation. One thing I'm not actually sure is whether ${coreutils}/bin/true is universally available on all the platforms, nor whether all the functions we use in the test are available, but we can still fix that after we've found out about that. Signed-off-by: aszlig <aszlig@nix.build>
* libredirect: Use extensions.sharedLibraryaszlig2018-11-12
| | | | | | | | | This is to make sure we get the correct shared library suffix of the target platform. While for example on Darwin it would even work with the hardcoded .so prefix it's IMHO a bit nicer to have the actual native extension. Signed-off-by: aszlig <aszlig@nix.build>
* assume that it works on all unix platformszimbatm2018-11-12
|
* use for cross-compilationzimbatm2018-11-12
|
* libredirect: Add support for Darwinaszlig2018-11-11
| | | | | | | | | | | | | | | The library can be used also on Darwin using it like this: NIX_REDIRECTS='foo=bar' \ DYLD_INSERT_LIBRARIES=${libredirect}/lib/libredirect.so \ DYLD_FORCE_FLAT_NAMESPACE=1 \ some_program So let's actually not hardcade gcc and add Darwin to meta.platforms. No other changes seem to be required. Signed-off-by: aszlig <aszlig@nix.build>
* libredirect: add descriptionOrivej Desh2017-12-14
| | | | Fixes #32675
* libredirect: allow null pathsmichael bishop2017-05-24
|
* treewide: Add lots of platforms to packages with no metaTuomas Tynkkynen2016-08-02
| | | | Build-tested on x86_64 Linux and on Darwin.
* xl2tpd: add nixos module for serviceobadz2016-06-20
| | | | (required adding execv to libredirect)
* citrix-receiver: init at 13.2.1, fixes #8458obadz2015-11-11
|
* libredirect: add __xlib64 and posix_spawnDemin Dmitriy2015-10-24
|
* libredirect: add access syscallLongrin Wischnewski2015-01-20
|
* hipchat: Fix access to /usr/share/X11/xkbEelco Dolstra2014-05-27
HipChat (or rather its copy of Qt) expects to find keyboard data in /usr/share/X11/xkb. So use a LD_PRELOAD library to intercept and rewrite the Glibc calls that access those paths. We've been doing the same thing with packages like Spotify, but now this functionality has been abstracted into a reusable library, libredirect.so. It uses an environment variable $NIX_REDIRECTS containing a colon-separated list of path prefixes to be rewritten, e.g. "/foo=bar:/xyzzy=/fnord".