Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix openssl linking for builds with --disable-shared #1256

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/build/build-bach.ss
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,15 @@
["-e" include-gambit-sharp]))
(output-bin
(path-expand "gerbil" gerbil-bindir))
(gerbil-shared?
(member "--enable-shared" (string-split (configure-command-string) #\')))
(configure-flags (string-split (configure-command-string) #\'))
(gerbil-shared? (member "--enable-shared" configure-flags))
(enable-openssl? (member "--enable-openssl" configure-flags))
Copy link
Collaborator

@vyzo vyzo Jul 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please dont!

We do not enable-openssl for gambit at all and should not use this; furthermore, openssl is a hard requirement for gerbil and not something to allow turning off.

In fact we might want to filter this option out in configure, but it might be useful for people who want to use ssl with gambit ports

(rpath-options
(if gerbil-shared?
[(string-append (cond-expand (darwin "-Wl,-rpath,") (else "-Wl,-rpath="))
gambit-libdir)]
[])))
[]))
(extra-ld-options (if enable-openssl? ["-lssl" "-lcrypto"] [])))
(displayln "... link " output-bin)
(invoke (gerbil-gsc)
["-link" "-o" bach-link-c
Expand All @@ -153,7 +155,8 @@
bach-main-o
bach-link-o
"-L" gerbil-libdir "-lgambit"
default-ld-options ...])
default-ld-options ...
extra-ld-options ...])
;; clean up
(delete-file bach-main-scm)
(delete-file bach-link-c)
Expand Down
8 changes: 2 additions & 6 deletions src/std/build-spec.ss
Original file line number Diff line number Diff line change
Expand Up @@ -208,18 +208,14 @@
'())
;; :std/net
"net/address"
,(cond-expand
(darwin
`(gxc: "net/ssl/libssl"
(gxc: "net/ssl/libssl"
"-cc-options" ,(cppflags "libssl" "")
"-ld-options" ,(apply append-options
(ldflags "libssl" "-lssl")
(ldflags "libcrypto" "-lcrypto")
(if (enable-shared?)
[(string-append "-L" (gerbil-libdir)) "-lgambit"]
[]))))
(else `(gxc: "net/ssl/libssl"
"-ld-options" ,(ldflags "libssl" "-lssl"))))
[])))
"net/ssl/error"
"net/ssl/interface"
"net/ssl/socket"
Expand Down
Loading