krzyzanowskim / OpenSSL

OpenSSL package for SwiftPM, CocoaPod, and Carthage, multiplatform
https://swift.best
Other
907 stars 334 forks source link

Unable to compile - Compilation errors #127

Closed Jeevhi closed 2 years ago

Jeevhi commented 2 years ago

I cloned the repo and issued make as instructed. However, it gives following error.

/Users/jim/openssl/OpenSSL/scripts/build.sh
Building for iPhoneSimulator i386
Configuring for iPhoneSimulator i386
Building /var/folders/h0/8g4byvb11s195bwb6_0m2bpr0000gp/T/tmp.7uMYI2q3/1.1.1l-iPhoneSimulator-i386.build.log
make: *** [build] Error 2

Content of the above log file

perl "-I." -Mconfigdata "util/dofile.pl" \
        "-oMakefile" include/crypto/bn_conf.h.in > include/crypto/bn_conf.h
perl "-I." -Mconfigdata "util/dofile.pl" \
        "-oMakefile" include/crypto/dso_conf.h.in > include/crypto/dso_conf.h
perl "-I." -Mconfigdata "util/dofile.pl" \
        "-oMakefile" include/openssl/opensslconf.h.in > include/openssl/opensslconf.h
/Applications/Xcode.app/Contents/Developer/usr/bin/make depend && /Applications/Xcode.app/Contents/Developer/usr/bin/make _all
xcrun -sdk iphonesimulator cc  -I. -Iinclude -fPIC -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk -fno-common -fembed-bitcode -mios-version-min=7.0 -mios-simulator-version-min=7.0 -arch i386 -O3 -DL_ENDIAN -DOPENSSL_PIC -DOPENSSLDIR="\"/var/folders/h0/8g4byvb11s195bwb6_0m2bpr0000gp/T/tmp.7uMYI2q3/1.1.1l-iPhoneSimulator-i386/ssl\"" -DENGINESDIR="\"/var/folders/h0/8g4byvb11s195bwb6_0m2bpr0000gp/T/tmp.7uMYI2q3/1.1.1l-iPhoneSimulator-i386/lib/engines-1.1\"" -D_REENTRANT -DNDEBUG   -c -o apps/app_rand.o apps/app_rand.c
/opt/X11/bin/makedepend -f- -Y --  -I. -Iinclude -fPIC -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk -fno-common -fembed-bitcode -mios-version-min=7.0 -mios-simulator-version-min=7.0 -arch i386 -O3 -DL_ENDIAN -DOPENSSL_PIC -DOPENSSLDIR="\"/var/folders/h0/8g4byvb11s195bwb6_0m2bpr0000gp/T/tmp.7uMYI2q3/1.1.1l-iPhoneSimulator-i386/ssl\"" -DENGINESDIR="\"/var/folders/h0/8g4byvb11s195bwb6_0m2bpr0000gp/T/tmp.7uMYI2q3/1.1.1l-iPhoneSimulator-i386/lib/engines-1.1\"" -D_REENTRANT -DNDEBUG  -- apps/app_rand.c 2>/dev/null \
        > apps/app_rand.d
make[2]: *** [apps/app_rand.o] Error 1

I tried to manually run above command to see the error

/opt/X11/bin/makedepend -f- -Y --  -I. -Iinclude -fPIC -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk -fno-common -fembed-bitcode -mios-version-min=7.0 -mios-simulator-version-min=7.0 -arch i386 -O3 -DL_ENDIAN -DOPENSSL_PIC -DOPENSSLDIR="\"/var/folders/h0/8g4byvb11s195bwb6_0m2bpr0000gp/T/tmp.7uMYI2q3/1.1.1l-iPhoneSimulator-i386/ssl\"" -DENGINESDIR="\"/var/folders/h0/8g4byvb11s195bwb6_0m2bpr0000gp/T/tmp.7uMYI2q3/1.1.1l-iPhoneSimulator-i386/lib/engines-1.1\"" -D_REENTRANT -DNDEBUG  -- apps/app_rand.c
# DO NOT DELETE
/opt/X11/bin/makedepend: error:  failed to read /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk

However, sdk is present as you can see from ls output below.

$$ ls -l /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
total 0
drwxrwxr-x  8 jim  staff  256 Jan  8  2021 iPhoneSimulator.sdk
lrwxr-xr-x  1 jim  staff   19 Feb  7  2021 iPhoneSimulator14.4.sdk -> iPhoneSimulator.sdk

Let me know if more info needed

krzyzanowskim commented 2 years ago

no idea. maybe it missing some dependency, try install brew install coreutils.

can't reproduce on my end, but again, I use brew so it may be different at your end.

Screenshot 2021-09-16 at 19 34 19

However, sdk is present as you can see from ls output below.

I have it too on this path.

Jeevhi commented 2 years ago

It does not say anything about dependence. Also, coreutils 8.32 is installed

krzyzanowskim commented 2 years ago

the openssl says this about dependencies: https://wiki.openssl.org/index.php/Compilation_and_Installation#Dependencies if it's not about dependencies, I have no idea. I wonder it it can be case-sensitive apfs partition, but really just guessing

Jeevhi commented 2 years ago

Also, it is trying to compile app_rand.c which is nowhere found, any idea?

krzyzanowskim commented 2 years ago

what do you mean by "nowhere"? https://github.com/openssl/openssl/blob/master/apps/lib/app_rand.c

krzyzanowskim commented 2 years ago

the difference I noticed is /opt/X11/bin/makedepend. I don't have /opt/X11 folder at all. It may be something that comes in a way.

makedepend was developed as part of MIT's Project Athena. It was used extensively in building X11 and ancillary packages, but has since become superseded by the dependency generation facilities of various compilers, and is now used primarily as a worst-case fallback

yea, there's something with your setup that is not necessarily quite expected here

manwithsteelnerves commented 2 years ago

We saw the same error. Wondering whats going wrong. Unfortunately, unable to compile.

krzyzanowskim commented 2 years ago

I don't know what to do about it. This repository goal is to provide binaries, to avoid manual compilation in the first place. I can't possibly support every setup. The setup I use is a clean install of the newest macOS + homebrew for packages. The /opt/X11/ is not preinstalled on macOS these days, and it looks like something that comes in a way here.

I'm afraid this support request is beyond my capacity :)