diff mbox series

[bug#56505,PATCHES] Mingw configuration for openssl

Message ID 07478ef69ed48a60979eb06923fd4ecafddcce42.camel@planete-kraus.eu
State Accepted
Headers show
Series [bug#56505,PATCHES] Mingw configuration for openssl | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Vivien Kraus Aug. 5, 2022, 7:58 a.m. UTC
Hi,

Le vendredi 05 août 2022 à 00:14 +0200, Ludovic Courtès a écrit :
> ‘guix build openssl --target=x86_64-w64-mingw32’ works and the funny
> part is that .dll files end up in bin/, but I think that’s intended
> on
> Windows?

That’s right. Windows does not have shared objects, and DLLs are not.
You cannot use the compiler to link to a DLL as far as I understand, so
you wouldn’t put them in lib. What you have in lib are the so-called
"import libraries" (.dll.a). These are static libraries that pretend to
provide the functionality, but in fact open the DLL at run-time to
fetch the library implementation from the DLL. So DLLs are kind of
resources.

Anyway, you see that in lib/ you have all the .dll.a files… Oops… I may
have forgotten to check this… This is not a huge problem, because all
outputs would be available when building a dependent package, but it’s
still not right I think.

Now, the .dll.a files are smaller than the static libraries, but not
that small. I don’t know why exactly.

Should I open a new issue with this patch, or is it somehow possible to
continue the discussion here?

Best regards,

Vivien

Comments

Ludovic Courtès Aug. 5, 2022, 9:34 a.m. UTC | #1
Hi,

Vivien Kraus <vivien@planete-kraus.eu> skribis:

> Le vendredi 05 août 2022 à 00:14 +0200, Ludovic Courtès a écrit :
>> ‘guix build openssl --target=x86_64-w64-mingw32’ works and the funny
>> part is that .dll files end up in bin/, but I think that’s intended
>> on
>> Windows?
>
> That’s right. Windows does not have shared objects, and DLLs are not.
> You cannot use the compiler to link to a DLL as far as I understand, so
> you wouldn’t put them in lib. What you have in lib are the so-called
> "import libraries" (.dll.a). These are static libraries that pretend to
> provide the functionality, but in fact open the DLL at run-time to
> fetch the library implementation from the DLL. So DLLs are kind of
> resources.
>
> Anyway, you see that in lib/ you have all the .dll.a files… Oops… I may
> have forgotten to check this… This is not a huge problem, because all
> outputs would be available when building a dependent package, but it’s
> still not right I think.

Oh, I see.

> From 1ee8daf446ca874ff4e5daa65d6f4034df51838e Mon Sep 17 00:00:00 2001
> From: Vivien Kraus <vivien@planete-kraus.eu>
> Date: Fri, 5 Aug 2022 09:52:21 +0200
> Subject: [PATCH] gnu: openssl: Keep .dll.a files in main output.
>
> * gnu/packages/tls.scm (openssl) [phase move-static-libraries]: Do not move
> .dll.a files to the static output when targetting mingw.

Applied, thanks!

Ludo’.
diff mbox series

Patch

From 1ee8daf446ca874ff4e5daa65d6f4034df51838e Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Fri, 5 Aug 2022 09:52:21 +0200
Subject: [PATCH] gnu: openssl: Keep .dll.a files in main output.

* gnu/packages/tls.scm (openssl) [phase move-static-libraries]: Do not move
.dll.a files to the static output when targetting mingw.
---
 gnu/packages/tls.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index 1e527ecce2..4ee75ace3d 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -507,7 +507,13 @@  (define-public openssl
                (for-each (lambda (file)
                            (install-file file slib)
                            (delete-file file))
-                         (find-files lib "\\.a$")))))
+                         (find-files
+                          lib
+                          #$(if (target-mingw?)
+                                '(lambda (filename _)
+                                   (and (string-suffix? ".a" filename)
+                                        (not (string-suffix? ".dll.a" filename))))
+                                "\\.a$"))))))
          (add-after 'install 'move-extra-documentation
            (lambda _
              ;; Move man pages and full HTML documentation to "doc".

base-commit: cc4c02e346a71ccef897e2d9f04fa2df2529a269
-- 
2.37.1