[PATCH] gnu: dante: Enable preloading support.

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Nguyễn Gia Phong
Owner
unassigned
Submitted by
Nguyễn Gia Phong
Severity
normal

Debbugs page

Nguyễn Gia Phong wrote 1 years ago
(address . guix-patches@gnu.org)(name . Nguyễn Gia Phong)(address . mcsinyx@disroot.org)
ae9944df740d9aa49322f04eb1259b15b8ac1a3a.1701919708.git.mcsinyx@disroot.org
Dante uses dlopen which doesn't work with libc.so but libc.so.6.
This fixes socksify, which is patched to skip invoking uname needlessly.

* gnu/packages/networking.scm (dante): Enable preloading support.
* gnu/packages/patches/dante-non-darwin.patch: New file.

Change-Id: I03a5b6b6e11cf6a0453a4968ff00c6dd627249a8
---
gnu/packages/networking.scm | 9 +++------
gnu/packages/patches/dante-non-darwin.patch | 15 +++++++++++++++
2 files changed, 18 insertions(+), 6 deletions(-)
create mode 100644 gnu/packages/patches/dante-non-darwin.patch

Toggle diff (46 lines)
diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index 6b415076e89f..13ac08aa253d 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -3640,13 +3640,10 @@ (define-public dante
(uri (string-append "https://www.inet.no/dante/files/dante-"
version ".tar.gz"))
(sha256
- (base32 "0pbahkj43rx7rmv2x40mf5p3g3x9d6i2sz7pzglarf54w5ghd2j1"))))
+ (base32 "0pbahkj43rx7rmv2x40mf5p3g3x9d6i2sz7pzglarf54w5ghd2j1"))
+ (patches (search-patches "dante-non-darwin.patch"))))
(build-system gnu-build-system)
- (arguments
- ;; XXX: The dynamic socks library doesn't work with 'libc.so' (GNU ld
- ;; script). When preloading is enabled, 'sockd' failed with:
- ;; … Failed to open library "libc.so": …: invalid ELF header
- '(#:configure-flags '("--disable-preload")))
+ (arguments '(#:configure-flags '("--with-libc=libc.so.6")))
(home-page "https://www.inet.no/dante/")
(synopsis "SOCKS server and client")
(description "Dante is a SOCKS client and server implementation. It can
diff --git a/gnu/packages/patches/dante-non-darwin.patch b/gnu/packages/patches/dante-non-darwin.patch
new file mode 100644
index 000000000000..0ecb705c78b7
--- /dev/null
+++ b/gnu/packages/patches/dante-non-darwin.patch
@@ -0,0 +1,15 @@
+Disable runtime check for Darwin so we don't have to substitute uname.
+--- a/bin/socksify.in
++++ b/bin/socksify.in
+@@ -65,11 +65,6 @@
+ unset FULLPATH
+ fi
+
+-#use "FLAT_NAMESPACE" on Darwin in attempt to match LD_PRELOAD behavior
+-if test x`uname` = xDarwin; then
+- export DYLD_FORCE_FLAT_NAMESPACE=t
+-fi
+-
+ #dlib/Makefile.am libtool flags should produce a predictable library name
+ #(ending in SOLIB_POSTFIX).
+ LIBRARY="${SOCKS_LIBRARY:-${FULLPATH}libdsocks.@SOLIB_POSTFIX@}"

base-commit: 4e7cb241188cf9f213d5fbabbabce07d35ca0991
--
2.41.0
Ludovic Courtès wrote 1 years ago
(name . Nguyễn Gia Phong)(address . mcsinyx@disroot.org)(address . 67675-done@debbugs.gnu.org)
8734vu9oh3.fsf@gnu.org
Hi,

Nguyễn Gia Phong <mcsinyx@disroot.org> skribis:

Toggle quote (10 lines)
> Dante uses dlopen which doesn't work with libc.so but libc.so.6.
> This fixes socksify, which is patched to skip invoking uname needlessly.
>
> * gnu/packages/networking.scm (dante): Enable preloading support.
> * gnu/packages/patches/dante-non-darwin.patch: New file.
>
> References: https://github.com/NixOS/nixpkgs/pull/68418#discussion_r343625853
> Fixes: https://issues.guix.gnu.org/63250
> Change-Id: I03a5b6b6e11cf6a0453a4968ff00c6dd627249a8

I added the patch to ‘gnu/local.mk’ and committed.

Thanks!

Ludo’.
Closed
Nguyễn Gia Phong wrote 1 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 67675@debbugs.gnu.org)
CXV1BR968940.1J1N2WOG2UMME@disroot.org
On 2023-12-22 at 17:44+01:00, Ludovic Courtès wrote:
Toggle quote (9 lines)
> Nguyễn Gia Phong <mcsinyx@disroot.org> skribis:
> > Dante uses dlopen which doesn't work with libc.so but libc.so.6.
> > This fixes socksify, which is patched to skip invoking uname needlessly.
> >
> > * gnu/packages/networking.scm (dante): Enable preloading support.
> > * gnu/packages/patches/dante-non-darwin.patch: New file.
>
> I added the patch to ‘gnu/local.mk’ and committed.

Thanks, I didn't know about that.
Have a merry christmas or other holiday of your choice!
-----BEGIN PGP SIGNATURE-----

iQHIBAABCAAyFiEE6Q4RuASTNDthMuOUJxSLLAaiIksFAmWFxfMUHG1jc2lueXhA
ZGlzcm9vdC5vcmcACgkQJxSLLAaiIkt1PgwAvtUONAqdWdVQSA4XHMr717D3ktcd
4beHMYxh6UUdd2tMUjetNTzyMMiu0YkhiJ316EnGGTUujY1IWU+CrF+qR9oouYOf
M9vvBGZ7lpqiK46nbYFaBfjuCWAcPcllXD+A+lpvZSlVD+6qDLlUbP6sm8FMsFZ5
nX53RoTDUcagZSb6+uOWXyVNhOqXmsrAQc+J7shu2Wxp+3rnmwlFhYdLOpD+hiMd
AhlYzNZUO6g4BG5nPins4ucpeGDwHdJL4p9rJ6txiiGzYFTweEVRG9m4t+X1zoNF
wcTZO2O3flt4PZ4+1bJOP57y/S3SbIejuv3oLZ67p1sz7rJ+CX6OGUOwiQl9VLZ7
ZZtKvUw2uUz18faeAP1Jq4LNdIjNB92cSsWtaFXfWepXPk3EDdQXH5+wSRn/5WK6
KevwjYcQFYBcsaLd/uOAyyFmtWLuG5Yn0s+UDCSvnO60AIRFl1G4PWvKgvku3H8O
TsAGTu53NtC9iMxXbkpmeAyZsqWkoi8Dyht6
=eD92
-----END PGP SIGNATURE-----


?
Your comment

This issue is archived.

To comment on this conversation send an email to 67675@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 67675
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help