Skip to content

Compiling OpenSSL on Linux without root does not work by default #108

@jaa2

Description

@jaa2

I wasn't able to compile the OpenSSL dependency on the latest Ubuntu LTS without making changes. Running make openssl or sudo make openssl, or even make openssl as the root user, all did not work. But I was able to compile without root once I made the following changes.

The build-static-openssl-linux.sh script does not use the CBMPC_OPENSSL_ROOT variable, but I can fix that with this change:

diff --git a/scripts/openssl/build-static-openssl-linux.sh b/scripts/openssl/build-static-openssl-linux.sh
index 31d6cbd..20935ec 100755
--- a/scripts/openssl/build-static-openssl-linux.sh
+++ b/scripts/openssl/build-static-openssl-linux.sh
@@ -29,7 +29,7 @@ sed -i -e 's/^static//' crypto/ec/curve25519.c
   no-gost no-http no-idea no-mdc2 no-md2 no-md4 no-module no-nextprotoneg no-ocb no-ocsp no-psk no-padlockeng no-poly1305 \
   no-quic no-rc2 no-rc4 no-rc5 no-rfc3779 no-scrypt no-sctp no-seed no-siphash no-sm2 no-sm3 no-sm4 no-sock no-srtp no-srp \
   no-ssl-trace no-ssl3 no-stdio no-tests no-tls no-ts no-unit-test no-uplink no-whirlpool no-zlib \
-  --prefix=/usr/local/opt/openssl@3.6.1 --libdir=lib64
+  --prefix=${CBMPC_OPENSSL_ROOT:-/usr/local/opt/openssl@3.6.1} --libdir=lib64
 
 make build_generated install_sw -j4
 

What is the purpose of these mkdir commands in the openssl-linux make target?

cb-mpc/Makefile

Lines 76 to 78 in 2cfa5da

${RUN_CMD} 'mkdir -p /usr/local/lib64'
${RUN_CMD} 'mkdir -p /usr/local/lib'
${RUN_CMD} 'mkdir -p /usr/local/include'

After removing the mkdir commands and applying this patch, it's able to build successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions