Message ID | 8760pjr43x.fsf@openmailbox.org |
---|---|
State | New |
Headers | show |
Hi Lukas, On Sun, 25 Sep 2016 17:45:06 -0500 Lukas Gradl <lgradl@openmailbox.org> wrote: > Since the return value of "(symlink ...)" is > unspecified, then we don't need the "(and ...)" at all, right? Right. > My understanding is now that if this 'dring' binary were to get > executed, it would look for 'libargon2.so.0' in the Runpath. However, > there is only 'libargon2.so' in > '/gnu/store/8z4lfj32b7q308xigfj8w1nmgbgyvd6g-argon2-20160406/lib', which > it ignores. Yeah, .so files without version number in the name (xxx.so) are only used by gcc when linking. The actual running program doesn't do anything with them. I think ldconfig updates a database from soname to actual file name. I'm not sure what the rules for the symlinks in ldconfig are. > My next question was why it was looking for 'libargon2.so.0' at all if > it does not exist. I think it's because of the soname. The soname is the main ABI in this case, the files are just an implementation detail. The actual matching should be done via comparing sonames. It's just that it doesn't scan all files on the system in order to find it. >$ objdump -p /gnu/store/mfanlirixm9468z02vf4c8dqvjl5gm01-libring-2.2.0-1.41e032c/sbin/dring |grep argon2 > NEEDED libargon2.so.0 >$ objdump -p /gnu/store/5fh9w9x3ihvy9n7pw0q58xafj6x21w99-argon2-20160406/lib/libargon2.so >Dynamic Section: > SONAME libargon2.so.0 So far so good. It should just be in file libargon2.so.0 in order to be used. So I think the symlink that you are doing from the existing file libargo2.so to the required file libargon2.so.0 is fine. > To fix this situation it would probably suffice to make sure that the > soname and the filename of the Argon2 library match. I agree. > To that end, one > could either change the soname or the filename to match the other one. > I think that changing either of these is risky because other dependent > libraries might depend on one of those. Especially changing the soname would be bad. It's part of the ABI. Don't touch it - especially when it actually lists a major API version - as it does. What we could do is rename libargon2.so to libargo2.so.0. But then gcc won't find it - so I wouldn't recommend it. >So I would keep the symlink > 'libargon2.so.0' -> 'libargon2.so' but remove the 'libargon2.so.0.0.0' > since it appears unneeded. Building libring works with these changes. Yes. I think that is a good approach. Could you send an updated patchset? Thanks!
From 5fb85fef7b1475baca6c29beb26799ca8f3d814a Mon Sep 17 00:00:00 2001 From: Lukas Gradl <lgradl@openmailbox.org> Date: Tue, 9 Aug 2016 16:49:19 -0500 Subject: [PATCH 04/10] gnu: argon2: Install pkg-config file. * gnu/packages/password-utils.scm (argon2)[source]: Create pkg-config file. [arguments]: Install it. --- gnu/packages/password-utils.scm | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm index 7288da6..f62d041 100644 --- a/gnu/packages/password-utils.scm +++ b/gnu/packages/password-utils.scm @@ -311,6 +311,21 @@ through the pass command.") "https://codeload.github.com/P-H-C/phc-winner-" name "/tar.gz/" version)) (file-name (string-append name "-" version ".tar.gz")) + (snippet + '(let ((p (open-file "argon2.pc" "w"))) + (begin + (display + (string-append "prefix=/usr/local\n" + "exec_prefix=${prefix}\n" + "includedir=${prefix}/include\n" + "libdir=${prefix}/lib\n\n" + "Name: Argon2\n" + "Description: " + "The Argon2 password hashing algorithm\n" + "Version: 1.0.0\n" + "Cflags: -I${includedir}/\n" + "Libs: -L${libdir} -largon2\n") p) + (close-output-port p)))) (sha256 (base32 "0g6wa94sh639xl1qc8z21q43r1mp8y77r1zf8nwx5pfsxd8fmyzv")))) @@ -321,14 +336,23 @@ through the pass command.") #:phases (modify-phases %standard-phases (delete 'configure) + (add-after 'unpack 'fix-pkg-config + (lambda _ + (substitute* "argon2.pc" + (("/usr/local") + (assoc-ref %outputs "out"))))) (replace 'install (lambda _ (let ((out (assoc-ref %outputs "out"))) (install-file "argon2" (string-append out "/bin")) (install-file "libargon2.a" (string-append out "/lib")) (install-file "libargon2.so" (string-append out "/lib")) + (install-file "argon2.pc" + (string-append out "/lib/pkgconfig")) (copy-recursively "include" - (string-append out "/include")))))))) + (string-append out "/include")) + (symlink (string-append out "/lib/libargon2.so") + (string-append out "/lib/libargon2.so.0")))))))) (home-page "https://www.argon2.com/") (synopsis "Password hashing library") (description "Argon2 provides a key derivation function that was declared -- 2.9.0