GNU bug report logs - #67675
[PATCH] gnu: dante: Enable preloading support.

Previous Next

Package: guix-patches;

Reported by: Nguyễn Gia Phong <mcsinyx <at> disroot.org>

Date: Thu, 7 Dec 2023 03:32:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 67675 in the body.
You can then email your comments to 67675 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#67675; Package guix-patches. (Thu, 07 Dec 2023 03:32:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nguyễn Gia Phong <mcsinyx <at> disroot.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 07 Dec 2023 03:32:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Nguyễn Gia Phong <mcsinyx <at> disroot.org>
To: guix-patches <at> gnu.org
Cc: Nguyễn Gia Phong <mcsinyx <at> disroot.org>
Subject: [PATCH] gnu: dante: Enable preloading support.
Date: Thu,  7 Dec 2023 12:28:29 +0900
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
---
 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

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





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Fri, 22 Dec 2023 16:45:02 GMT) Full text and rfc822 format available.

Notification sent to Nguyễn Gia Phong <mcsinyx <at> disroot.org>:
bug acknowledged by developer. (Fri, 22 Dec 2023 16:45:02 GMT) Full text and rfc822 format available.

Message #10 received at 67675-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Nguyễn Gia Phong <mcsinyx <at> disroot.org>
Cc: 67675-done <at> debbugs.gnu.org
Subject: Re: [bug#67675] [PATCH] gnu: dante: Enable preloading support.
Date: Fri, 22 Dec 2023 17:44:08 +0100
Hi,

Nguyễn Gia Phong <mcsinyx <at> 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.
>
> 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’.




Information forwarded to guix-patches <at> gnu.org:
bug#67675; Package guix-patches. (Fri, 22 Dec 2023 17:24:01 GMT) Full text and rfc822 format available.

Message #13 received at 67675 <at> debbugs.gnu.org (full text, mbox):

From: Nguyễn Gia Phong <mcsinyx <at> disroot.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 67675 <at> debbugs.gnu.org
Subject: Re: [bug#67675] [PATCH] gnu: dante: Enable preloading support.
Date: Sat, 23 Dec 2023 02:22:55 +0900
[Message part 1 (text/plain, inline)]
On 2023-12-22 at 17:44+01:00, Ludovic Courtès wrote:
> Nguyễn Gia Phong <mcsinyx <at> 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!
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 20 Jan 2024 12:24:21 GMT) Full text and rfc822 format available.

This bug report was last modified 44 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.