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

Issue building 1.1.1 on OSX with iOS and tvOS architectures #7607

Closed
pjosep opened this issue Nov 9, 2018 · 7 comments
Closed

Issue building 1.1.1 on OSX with iOS and tvOS architectures #7607

pjosep opened this issue Nov 9, 2018 · 7 comments
Labels
branch: master Merge to master branch branch: 1.1.1 Merge to OpenSSL_1_1_1-stable branch help wanted triaged: bug The issue/pr is/fixes a bug

Comments

@pjosep
Copy link

pjosep commented Nov 9, 2018

I am experiencing a couple of different problems trying to build version 1.1.1 for iOS and tvOS architectures on an OSX machine.

Initially, I was getting the following error when building:

➜  ~/work/Phenix2/Formulas/work/29204_Ph/armv7/openssl-1.1.1 git:(review/philip_joseph/5908) ✗ export CROSS_TOP=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
export CROSS_SDK=iPhoneOS12.1.sdk
export BUILD_TOOLS=/Applications/Xcode.app/Contents/Developer
export 'CC=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch armv7 -miphoneos-version-min=9.0 -fembed-bitcode'
export 'CXX=/Applications/Xcode.app/Contents/Developer/usr/bin/g++ -arch armv7 -miphoneos-version-min=9.0 -std=c++11 -stdlib=libc++ -fembed-bitcode'
export AR=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar
export RANLIB=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib
➜  ~/work/Phenix2/Formulas/work/29204_Ph/armv7/openssl-1.1.1 git:(review/philip_joseph/5908) ✗ 
➜  ~/work/Phenix2/Formulas/work/29204_Ph/armv7/openssl-1.1.1 git:(review/philip_joseph/5908) ✗ ./Configure iphoneos-cross  no-async no-shared
Configuring OpenSSL version 1.1.1 (0x1010100fL) for iphoneos-cross
Using os-specific seed configuration
Creating configdata.pm
Creating Makefile

**********************************************************************
***                                                                ***
***   If you want to report a building issue, please include the   ***
***   output from this command:                                    ***
***                                                                ***
***     perl configdata.pm --dump                                  ***
***                                                                ***
**********************************************************************
➜  ~/work/Phenix2/Formulas/work/29204_Ph/armv7/openssl-1.1.1 git:(review/philip_joseph/5908) ✗ make
perl "-I." -Mconfigdata "util/dofile.pl" \
	    "-oMakefile" crypto/include/internal/bn_conf.h.in > crypto/include/internal/bn_conf.h
perl "-I." -Mconfigdata "util/dofile.pl" \
	    "-oMakefile" crypto/include/internal/dso_conf.h.in > crypto/include/internal/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
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch armv7 -miphoneos-version-min=9.0 -fembed-bitcode  -I. -Iinclude -fPIC -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk -fno-common -O3 -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-1.1\"" -D_REENTRANT -DNDEBUG   -c -o apps/apps.o apps/apps.c
/usr/local/bin/makedepend -f- -Y --  -I. -Iinclude -fPIC -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk -fno-common -O3 -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-1.1\"" -D_REENTRANT -DNDEBUG  -- apps/apps.c 2>/dev/null \
	    > apps/apps.d
make[1]: *** [apps/apps.o] Error 1
make: *** [all] Error 2

To get past that, I initially tried to change the MAKEDEPEND variable in the Makefile as suggested in a couple of different posts (http://article.gmane.org/gmane.comp.encryption.openssl.user/47492), but that didn't prove successful. I was however successful fixing this this on iOS using the no-makedepend flag. I am not 100% the no-makedepend won't cause issues once I try to link against the library and use it yet.

Either way, I end up with the following error when trying to build tvOS:

➜  ~/work/Phenix/Formulas/work/13164_Ph/arm64/openssl-1.1.1 git:(review/philip_joseph/5908) 
➜  ~/work/Phenix/Formulas/work/13164_Ph/arm64/openssl-1.1.1 git:(review/philip_joseph/5908) CROSS_TOP=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer
CROSS_SDK=AppleTVOS12.1.sdk
BUILD_TOOLS=/Applications/Xcode.app/Contents/Developer
CC='/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch arm64 -mtvos-version-min=10.2 -fembed-bitcode'
CXX='/Applications/Xcode.app/Contents/Developer/usr/bin/g++ -arch arm64 -mtvos-version-min=10.2 -std=c++11 -stdlib=libc++ -fembed-bitcode'
AR=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar
RANLIB=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib

➜  ~/work/Phenix/Formulas/work/13164_Ph/arm64/openssl-1.1.1 git:(review/philip_joseph/5908) ./Configure tvos64-cross-arm64  no-async no-shared no-makedepend
Configuring OpenSSL version 1.1.1 (0x1010100fL) for tvos64-cross-arm64
Using os-specific seed configuration
Creating configdata.pm
Creating Makefile

**********************************************************************
***                                                                ***
***   If you want to report a building issue, please include the   ***
***   output from this command:                                    ***
***                                                                ***
***     perl configdata.pm --dump                                  ***
***                                                                ***
**********************************************************************
➜  ~/work/Phenix/Formulas/work/13164_Ph/arm64/openssl-1.1.1 git:(review/philip_joseph/5908) make
perl "-I." -Mconfigdata "util/dofile.pl" \
	    "-oMakefile" crypto/include/internal/bn_conf.h.in > crypto/include/internal/bn_conf.h
perl "-I." -Mconfigdata "util/dofile.pl" \
	    "-oMakefile" crypto/include/internal/dso_conf.h.in > crypto/include/internal/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
perl util/mkbuildinf.pl "/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch arm64 -mtvos-version-min=10.2 -fembed-bitcode -fPIC -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -fno-common -mtvos-version-min=9.0 -arch arm64 -O3 -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -D_REENTRANT -DHAVE_FORK=0 -DNDEBUG" "tvos64-cross-arm64" > crypto/buildinf.h
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch arm64 -mtvos-version-min=10.2 -fembed-bitcode  -I. -Icrypto/include -Iinclude -Icrypto -fPIC -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -fno-common -mtvos-version-min=9.0 -arch arm64 -O3 -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-1.1\"" -D_REENTRANT -DHAVE_FORK=0 -DNDEBUG   -c -o crypto/cversion.o crypto/cversion.c
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar r libcrypto.a crypto/cversion.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib libcrypto.a || echo Never mind.
perl apps/progs.pl apps/openssl > apps/progs.h
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch arm64 -mtvos-version-min=10.2 -fembed-bitcode  -I. -Iinclude -Iapps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -fno-common -mtvos-version-min=9.0 -arch arm64 -O3 -D_REENTRANT -DHAVE_FORK=0 -DNDEBUG   -c -o apps/asn1pars.o apps/asn1pars.c
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch arm64 -mtvos-version-min=10.2 -fembed-bitcode  -I. -Iinclude -Iapps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -fno-common -mtvos-version-min=9.0 -arch arm64 -O3 -D_REENTRANT -DHAVE_FORK=0 -DNDEBUG   -c -o apps/ca.o apps/ca.c
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch arm64 -mtvos-version-min=10.2 -fembed-bitcode  -I. -Iinclude -Iapps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -fno-common -mtvos-version-min=9.0 -arch arm64 -O3 -D_REENTRANT -DHAVE_FORK=0 -DNDEBUG   -c -o apps/ciphers.o apps/ciphers.c
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch arm64 -mtvos-version-min=10.2 -fembed-bitcode  -I. -Iinclude -Iapps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -fno-common -mtvos-version-min=9.0 -arch arm64 -O3 -D_REENTRANT -DHAVE_FORK=0 -DNDEBUG   -c -o apps/cms.o apps/cms.c
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch arm64 -mtvos-version-min=10.2 -fembed-bitcode  -I. -Iinclude -Iapps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -fno-common -mtvos-version-min=9.0 -arch arm64 -O3 -D_REENTRANT -DHAVE_FORK=0 -DNDEBUG   -c -o apps/crl.o apps/crl.c
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch arm64 -mtvos-version-min=10.2 -fembed-bitcode  -I. -Iinclude -Iapps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -fno-common -mtvos-version-min=9.0 -arch arm64 -O3 -D_REENTRANT -DHAVE_FORK=0 -DNDEBUG   -c -o apps/crl2p7.o apps/crl2p7.c
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch arm64 -mtvos-version-min=10.2 -fembed-bitcode  -I. -Iinclude -Iapps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -fno-common -mtvos-version-min=9.0 -arch arm64 -O3 -D_REENTRANT -DHAVE_FORK=0 -DNDEBUG   -c -o apps/dgst.o apps/dgst.c
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch arm64 -mtvos-version-min=10.2 -fembed-bitcode  -I. -Iinclude -Iapps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -fno-common -mtvos-version-min=9.0 -arch arm64 -O3 -D_REENTRANT -DHAVE_FORK=0 -DNDEBUG   -c -o apps/dhparam.o apps/dhparam.c
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch arm64 -mtvos-version-min=10.2 -fembed-bitcode  -I. -Iinclude -Iapps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -fno-common -mtvos-version-min=9.0 -arch arm64 -O3 -D_REENTRANT -DHAVE_FORK=0 -DNDEBUG   -c -o apps/dsa.o apps/dsa.c
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch arm64 -mtvos-version-min=10.2 -fembed-bitcode  -I. -Iinclude -Iapps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -fno-common -mtvos-version-min=9.0 -arch arm64 -O3 -D_REENTRANT -DHAVE_FORK=0 -DNDEBUG   -c -o apps/dsaparam.o apps/dsaparam.c
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch arm64 -mtvos-version-min=10.2 -fembed-bitcode  -I. -Iinclude -Iapps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -fno-common -mtvos-version-min=9.0 -arch arm64 -O3 -D_REENTRANT -DHAVE_FORK=0 -DNDEBUG   -c -o apps/ec.o apps/ec.c
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch arm64 -mtvos-version-min=10.2 -fembed-bitcode  -I. -Iinclude -Iapps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -fno-common -mtvos-version-min=9.0 -arch arm64 -O3 -D_REENTRANT -DHAVE_FORK=0 -DNDEBUG   -c -o apps/ecparam.o apps/ecparam.c
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch arm64 -mtvos-version-min=10.2 -fembed-bitcode  -I. -Iinclude -Iapps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -fno-common -mtvos-version-min=9.0 -arch arm64 -O3 -D_REENTRANT -DHAVE_FORK=0 -DNDEBUG   -c -o apps/enc.o apps/enc.c
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch arm64 -mtvos-version-min=10.2 -fembed-bitcode  -I. -Iinclude -Iapps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -fno-common -mtvos-version-min=9.0 -arch arm64 -O3 -D_REENTRANT -DHAVE_FORK=0 -DNDEBUG   -c -o apps/engine.o apps/engine.c
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch arm64 -mtvos-version-min=10.2 -fembed-bitcode  -I. -Iinclude -Iapps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -fno-common -mtvos-version-min=9.0 -arch arm64 -O3 -D_REENTRANT -DHAVE_FORK=0 -DNDEBUG   -c -o apps/errstr.o apps/errstr.c
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch arm64 -mtvos-version-min=10.2 -fembed-bitcode  -I. -Iinclude -Iapps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -fno-common -mtvos-version-min=9.0 -arch arm64 -O3 -D_REENTRANT -DHAVE_FORK=0 -DNDEBUG   -c -o apps/gendsa.o apps/gendsa.c
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch arm64 -mtvos-version-min=10.2 -fembed-bitcode  -I. -Iinclude -Iapps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -fno-common -mtvos-version-min=9.0 -arch arm64 -O3 -D_REENTRANT -DHAVE_FORK=0 -DNDEBUG   -c -o apps/genpkey.o apps/genpkey.c
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch arm64 -mtvos-version-min=10.2 -fembed-bitcode  -I. -Iinclude -Iapps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -fno-common -mtvos-version-min=9.0 -arch arm64 -O3 -D_REENTRANT -DHAVE_FORK=0 -DNDEBUG   -c -o apps/genrsa.o apps/genrsa.c
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch arm64 -mtvos-version-min=10.2 -fembed-bitcode  -I. -Iinclude -Iapps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -fno-common -mtvos-version-min=9.0 -arch arm64 -O3 -D_REENTRANT -DHAVE_FORK=0 -DNDEBUG   -c -o apps/nseq.o apps/nseq.c
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch arm64 -mtvos-version-min=10.2 -fembed-bitcode  -I. -Iinclude -Iapps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -fno-common -mtvos-version-min=9.0 -arch arm64 -O3 -D_REENTRANT -DHAVE_FORK=0 -DNDEBUG   -c -o apps/ocsp.o apps/ocsp.c
apps/ocsp.c:947:23: error: 'fork' is unavailable: not available on tvOS
        switch(fpid = fork()) {
                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk/usr/include/unistd.h:446:8: note: 'fork' has been explicitly marked unavailable
      here
pid_t    fork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
         ^
1 error generated.
make[1]: *** [apps/ocsp.o] Error 1
make: *** [all] Error 2
➜  ~/work/Phenix/Formulas/work/13164_Ph/arm64/openssl-1.1.1 git:(review/philip_joseph/5908) 

Any ideas how I get past this?

@levitte
Copy link
Member

levitte commented Nov 10, 2018

  1. the makedepend issues largely looks like makedepend isn't getting the options that gcc gets.... and either way, it should be a gcc driven dependency mechanism happening there, not a makedepend run. The question is what Configure saw. If you give us the output of perl configdata.pm --dump from that run, we might be able to figure out a little more of what happened.

  2. The fork issue... well, that actually begins with tvos64-cross-arm64, that's not a configuration I've seen before, care to tell us a little more about that one?

@pjosep
Copy link
Author

pjosep commented Nov 12, 2018

Hi Levitte-
Thanks for the quick reply.

  1. Below is the output for the perl configdata dump.

  2. Good question, I just realized that internally we have a patch to add a tvos configuration to build for AppleTV. tvos doesn't have fork. Our patch worked fine with 1.1.0i. It seems that everywhere in the code that fork was called, it was wrapped with a NO_FORK, but in version 1.1.1, there is a new call to fork that is unprotected in apps/ocsp.c. I am not super familiar with the ocsp module, but it would appear it generates an executable, that I don't need when linking with my code. So I was able to successfully build with the no-ocsp flag. But it may make sense to wrap that fork call with the NO_FORK flag

➜  ~/work/Phenix2/Formulas/work/29204_Ph/armv7/openssl-1.1.1 git:(review/philip_joseph/5908) perl configdata.pm --dump

Command line (with current working directory = .):

    perl ./Configure iphoneos-cross no-async no-shared

Perl information:

    perl
    5.18.2 for darwin-thread-multi-2level

Enabled features:

    aria
    asm
    autoalginit
    autoerrinit
    autoload-config
    bf
    blake2
    camellia
    capieng
    cast
    chacha
    cmac
    cms
    comp
    ct
    deprecated
    des
    dgram
    dh
    dsa
    dso
    dtls
    ec
    ec2m
    ecdh
    ecdsa
    err
    filenames
    gost
    hw(-.+)?
    idea
    makedepend
    md4
    mdc2
    multiblock
    nextprotoneg
    ocb
    ocsp
    pic
    poly1305
    posix-io
    psk
    rc2
    rc4
    rdrand
    rfc3779
    rmd160
    scrypt
    seed
    siphash
    sm2
    sm3
    sm4
    sock
    srp
    srtp
    sse2
    ssl
    static-engine
    stdio
    tests
    threads
    tls
    ts
    ui-console
    whirlpool
    tls1
    tls1-method
    tls1_1
    tls1_1-method
    tls1_2
    tls1_2-method
    tls1_3
    dtls1
    dtls1-method
    dtls1_2
    dtls1_2-method

Disabled features:

    afalgeng                [not-linux] 
    asan                    [default]   OPENSSL_NO_ASAN
    async                   [option]    OPENSSL_NO_ASYNC
    crypto-mdebug           [default]   OPENSSL_NO_CRYPTO_MDEBUG
    crypto-mdebug-backtrace [default]   OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
    devcryptoeng            [default]   OPENSSL_NO_DEVCRYPTOENG
    dynamic-engine          [forced]    
    ec_nistp_64_gcc_128     [default]   OPENSSL_NO_EC_NISTP_64_GCC_128
    egd                     [default]   OPENSSL_NO_EGD
    engine                  [config]    OPENSSL_NO_ENGINE (skip crypto/engine, engines)
    external-tests          [default]   OPENSSL_NO_EXTERNAL_TESTS
    fuzz-libfuzzer          [default]   OPENSSL_NO_FUZZ_LIBFUZZER
    fuzz-afl                [default]   OPENSSL_NO_FUZZ_AFL
    heartbeats              [default]   OPENSSL_NO_HEARTBEATS
    md2                     [default]   OPENSSL_NO_MD2 (skip crypto/md2)
    msan                    [default]   OPENSSL_NO_MSAN
    rc5                     [default]   OPENSSL_NO_RC5 (skip crypto/rc5)
    sctp                    [default]   OPENSSL_NO_SCTP
    shared                  [option]    
    ssl-trace               [default]   OPENSSL_NO_SSL_TRACE
    ubsan                   [default]   OPENSSL_NO_UBSAN
    unit-test               [default]   OPENSSL_NO_UNIT_TEST
    weak-ssl-ciphers        [default]   OPENSSL_NO_WEAK_SSL_CIPHERS
    zlib                    [default]   
    zlib-dynamic            [default]   
    ssl3                    [default]   OPENSSL_NO_SSL3
    ssl3-method             [default]   OPENSSL_NO_SSL3_METHOD

Config target attributes:

    AR => "ar",
    ARFLAGS => "r",
    CC => "cc",
    CFLAGS => "-O3",
    HASHBANGPERL => "/usr/bin/env perl",
    RANLIB => "ranlib -c",
    RC => "windres",
    aes_asm_src => "aes_core.c aes_cbc.c",
    aes_obj => "aes_core.o aes_cbc.o",
    apps_aux_src => "",
    apps_init_src => "",
    apps_obj => "",
    bf_asm_src => "bf_enc.c",
    bf_obj => "bf_enc.o",
    bn_asm_src => "bn_asm.c",
    bn_obj => "bn_asm.o",
    bn_ops => "BN_LLONG RC4_CHAR",
    build_file => "Makefile",
    build_scheme => [ "unified", "unix" ],
    cast_asm_src => "c_enc.c",
    cast_obj => "c_enc.o",
    cflags => "-isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common",
    chacha_asm_src => "chacha_enc.c",
    chacha_obj => "chacha_enc.o",
    cmll_asm_src => "camellia.c cmll_misc.c cmll_cbc.c",
    cmll_obj => "camellia.o cmll_misc.o cmll_cbc.o",
    cppflags => "-D_REENTRANT",
    cpuid_asm_src => "mem_clr.c",
    cpuid_obj => "mem_clr.o",
    defines => [  ],
    des_asm_src => "des_enc.c fcrypt_b.c",
    des_obj => "des_enc.o fcrypt_b.o",
    disable => [ "engine" ],
    dso_extension => ".dylib",
    dso_scheme => "dlfcn",
    ec_asm_src => "",
    ec_obj => "",
    enable => [  ],
    exe_extension => "",
    includes => [  ],
    keccak1600_asm_src => "keccak1600.c",
    keccak1600_obj => "keccak1600.o",
    lflags => "-Wl,-search_paths_first",
    lib_cflags => "",
    lib_cppflags => "",
    lib_defines => [  ],
    md5_asm_src => "",
    md5_obj => "",
    modes_asm_src => "",
    modes_obj => "",
    module_cflags => "-fPIC",
    module_cxxflags => "",
    module_ldflags => "-bundle",
    padlock_asm_src => "",
    padlock_obj => "",
    perlasm_scheme => "osx32",
    poly1305_asm_src => "",
    poly1305_obj => "",
    rc4_asm_src => "rc4_enc.c rc4_skey.c",
    rc4_obj => "rc4_enc.o rc4_skey.o",
    rc5_asm_src => "rc5_enc.c",
    rc5_obj => "rc5_enc.o",
    rmd160_asm_src => "",
    rmd160_obj => "",
    shared_cflag => "-fPIC",
    shared_defines => [  ],
    shared_extension => ".\$(SHLIB_VERSION_NUMBER).dylib",
    shared_extension_simple => ".dylib",
    shared_ldflag => "-dynamiclib -current_version \$(SHLIB_VERSION_NUMBER) -compatibility_version \$(SHLIB_VERSION_NUMBER)",
    shared_rcflag => "",
    shared_sonameflag => "-install_name \$(INSTALLTOP)/\$(LIBDIR)/",
    shared_target => "darwin-shared",
    sys_id => "iOS",
    thread_defines => [  ],
    thread_scheme => "pthreads",
    unistd => "<unistd.h>",
    uplink_aux_src => "",
    uplink_obj => "",
    wp_asm_src => "wp_block.c",
    wp_obj => "wp_block.o",

Recorded environment:

    AR = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar
    ARFLAGS = 
    AS = 
    ASFLAGS = 
    BUILDFILE = 
    CC = /Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch armv7 -miphoneos-version-min=9.0 -fembed-bitcode
    CFLAGS = 
    CPP = 
    CPPDEFINES = 
    CPPFLAGS = 
    CPPINCLUDES = 
    CROSS_COMPILE = 
    CXX = /Applications/Xcode.app/Contents/Developer/usr/bin/g++ -arch armv7 -miphoneos-version-min=9.0 -std=c++11 -stdlib=libc++ -fembed-bitcode
    CXXFLAGS = 
    HASHBANGPERL = 
    LD = 
    LDFLAGS = 
    LDLIBS = 
    MT = 
    MTFLAGS = 
    OPENSSL_LOCAL_CONFIG_DIR = 
    PERL = 
    RANLIB = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib
    RC = 
    RCFLAGS = 
    RM = 
    WINDRES = 
    __CNF_CFLAGS = 
    __CNF_CPPDEFINES = 
    __CNF_CPPFLAGS = 
    __CNF_CPPINCLUDES = 
    __CNF_CXXFLAGS = 
    __CNF_LDFLAGS = 
    __CNF_LDLIBS = 

Makevars:

    AR              = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar
    ARFLAGS         = r
    CC              = /Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch armv7 -miphoneos-version-min=9.0 -fembed-bitcode
    CFLAGS          = -O3
    CPPDEFINES      = 
    CPPFLAGS        = 
    CPPINCLUDES     = 
    CXX             = /Applications/Xcode.app/Contents/Developer/usr/bin/g++ -arch armv7 -miphoneos-version-min=9.0 -std=c++11 -stdlib=libc++ -fembed-bitcode
    CXXFLAGS        = 
    HASHBANGPERL    = /usr/bin/env perl
    LDFLAGS         = 
    LDLIBS          = 
    PERL            = perl
    RANLIB          = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib
    RC              = windres

NOTE: These variables only represent the configuration view.  The build file
template may have processed these variables further, please have a look at the
build file for more exact data:
    Makefile

build file:

    Makefile

build file templates:

    Configurations/common0.tmpl
    Configurations/unix-Makefile.tmpl
    Configurations/common.tmpl

@levitte
Copy link
Member

levitte commented Nov 12, 2018

Ah, NO_FORK... I just took a look at that in speed.c, and am thinking that the same mechanism in ocsp.c should fix your issue there. Sounds reasonable?

As for the makedepend issue, I'll have to think a bit

levitte added a commit to levitte/openssl that referenced this issue Nov 12, 2018
This allows the user to override our defaults if needed, and in a
consistent manner.

Partial fix for openssl#7607
@levitte
Copy link
Member

levitte commented Nov 12, 2018

#7624 is an idea to make it possible to specify HAVE_FORK or NO_FORK, as in speed.c

levitte added a commit that referenced this issue Feb 11, 2019
This allows the user to override our defaults if needed, and in a
consistent manner.

Partial fix for #7607

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from #7624)

(cherry picked from commit ca81124)
levitte added a commit that referenced this issue Feb 11, 2019
This allows the user to override our defaults if needed, and in a
consistent manner.

Partial fix for #7607

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from #7624)
@noloader
Copy link
Contributor

I'm working with the OpenSSL 1.1.1d release tarball. It has the ca81124 patch applied.

The logic in ca81124 is not correct. I configure with -DNO_FORK. NO_FORK is defined, but it is getting undefined in apps/ocsp.c at line 47:

#if HAVE_FORK
# undef NO_FORK
#else
# define NO_FORK
#endif

That breaks AppleTVOS, WatchOS, AppleTVSimulator and WatchSimulator.

@noloader
Copy link
Contributor

noloader commented Mar 10, 2020

This patch worked for me on OpenSSL 1.1.1d and avoids warnings about macro redefintions.

$ cat contrib/ios/openssl.patch 
--- apps/speed.c
+++ apps/speed.c
@@ -99,6 +99,13 @@
 #endif
 #include <openssl/modes.h>
 
+/* fork() breaks AppleTVOS, WatchOS, AppleTVSimulator and WatchSimulator */
+/* Users should configure with -DNO_FORK */
+#if defined(NO_FORK)
+# undef HAVE_FORK
+# define HAVE_FORK 0
+#endif
+
 #ifndef HAVE_FORK
 # if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_VXWORKS)
 #  define HAVE_FORK 0
@@ -110,6 +117,7 @@
 #if HAVE_FORK
 # undef NO_FORK
 #else
+# undef NO_FORK
 # define NO_FORK
 #endif
 
--- apps/ocsp.c
+++ apps/ocsp.c
@@ -36,6 +36,13 @@
 # include <openssl/x509v3.h>
 # include <openssl/rand.h>
 
+/* fork() breaks AppleTVOS, WatchOS, AppleTVSimulator and WatchSimulator */
+/* Users should configure with -DNO_FORK */
+#if defined(NO_FORK)
+# undef HAVE_FORK
+# define HAVE_FORK 0
+#endif
+
 #ifndef HAVE_FORK
 # if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS)
 #  define HAVE_FORK 0
@@ -47,6 +54,7 @@
 #if HAVE_FORK
 # undef NO_FORK
 #else
+# undef NO_FORK
 # define NO_FORK
 #endif
 

@t8m
Copy link
Member

t8m commented Feb 22, 2024

The version 1.1.1 is not supported anymore. Closing. If this is still an issue with currently supported releases, please open a new issue.

@t8m t8m closed this as completed Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch: master Merge to master branch branch: 1.1.1 Merge to OpenSSL_1_1_1-stable branch help wanted triaged: bug The issue/pr is/fixes a bug
Projects
None yet
Development

No branches or pull requests

4 participants