[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Static binaries with openssl on MacOS

From: T. Kurt Bond
Subject: Re: Static binaries with openssl on MacOS
Date: Wed, 29 Sep 2021 17:08:47 -0400

Have you tried setting CSC_OPTIONS to include the specific include and library directories for the homebrew installed openssl, the ones under /usr/local/Cellar/openssl*/VERSION/{include,lib}?  That helped me with getting the sqlite3 egg to build using the homebrew installed sqlite3 (because the sqlite3 Apple supplies is obsolete).  It's not exactly the same situation, but maybe it will help.

On Wed, Sep 29, 2021 at 4:58 PM Nicholas Van Horn <> wrote:
Hi all!

I have a project that uses the OpenSSL egg. The code base historically ran fine. It runs both in interpreted fashion as well as compiled. It runs on both linux and MacOS, and has for several years. However, after updating to Chicken 5+ I am no longer able to build static binaries on MacOS (which I use for distributing the program). On linux I have no issues. The problem clearly arises from Mac's abandonment of OpenSSL for its own tooling. But this has been the case for some time, and I've already overcome this before. The issue appears to be a linker problem during compile time, likely due to how static binaries are handled in v5+. Here's my current setup:

MacOS 11.6 (Big Sur)
Chicken 5.2.0
OpenSSL installed via homebrew

My code runs just fine in interpreted mode (csi -s myprogram.scm). My goal is to compile to static binary. I use the following on linux to successfully achieve this:

csc -static myprogram.scm -L -lssl -L -lcrypto -o myprogram

On my mac I receive the following error:

ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Things I've tried (from the recommendation that homebrew outputs after installing openssl):

export LDFLAGS="-L/usr/local/opt/openssl@3/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@3/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl@3/lib/pkgconfig"

I have also followed the advice of a previous mailing list response from 2019 that specified how to get openssl working on MacOS:

brew install openssl
export PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig"
chicken-install openssl

This has been what I've used to get the openssl egg working on a Mac. However, this doesn't seem to address the static compilation problem I'm encountering.

Any help would be GREATLY appreciated.


T. Kurt Bond,,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]