I have a 64 bit FreeBSD build machine. I need to add https support in my python3 application code. For that it is advised to build/compile python with openssl support. I do not need any gcc dependency in my final executable.So instead i am using clang to build python. But before that while building openssl I am unable to do so. I even used set CC clang. But still openssl is taking up gcc as the c compiler.So on running ldd on the final dynamic executable it is showing up libc dependency.This link does not mention anything about FreeBSD and clang. (https://wiki.openssl.org/index.php/Compilation_and_Installation)Please suggest some alternative?[EDIT]These are the command I am executing on my \bin\sh shellset CC clang./config -fPIC In the output I notice the following line which indicates gcc being used:BN_ASM =x86_64-gcc.o
How to build openssl with clang(rather than gcc) on a FreeBSD machine?
freebsd;python;openssl;https;clang
You seem to be having a number of issues, summarised below. You almost certainly should be using a port for python as noted by @mjturner, which will use the native FreeBSD OpenSSL.in csh the syntax set CC clang sets two variables named CC and clang to the empty string, you want set CC=clang, but even that won't work (see next point)simply setting a variable in your csh shell won't affect anything else, you really want to use setenv CC clang (note this one doesn't use =). config is an sh script, so the variable must be exported to be seen.libc is not a dependency of gcc, almost everything you link dynamically will be linked against libc (on FreeBSD this is not GNU glibc). The alternative is to link statically which, if possible, removes the dynamic dependency by embedding the required code in the final binary.(When you use gcc there may be a libgcc dependency on some platforms and is used for exception handing. This is harder to avoid.)I would expect you will have trouble linking python statically.If you are instead building OpenSSL and python using clang for some purpose such as distribution of binaries (assuming you have carefully read the relevant licence agreements), or have a requirement for specific software versions, this should be possible by correctly setting CC. I note though that the OpenSSL port does not do this, it opts to patching the gcc commands out of the Configure script and uses the FREEBSDCC environment variable instead.Other advice:see the OpenSSL wiki for using clang: https://wiki.openssl.org/index.php/Compilation_and_Installation#Modifying_Build_Settings clang is in fact covered, but not FreeBSD specifically because all BSDs are considered effectively equivalent there.make sure to run make test after you build OpenSSLmake sure to compile everything with the same compiler, this means python and everything in lib-dynload