Building openssl outside of the source tree" doesn't work well

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Building openssl outside of the source tree" doesn't work well

dengwenbin_0301
Dear all,

Following the instructions in chapter 1c "
Configure OpenSSL for building outside of the source tree." of INSTALL doc,  I create "obj" folder under the top directory and try to build in that folder. The result shows some header file for the file app_rand.c is not included. Is this a bug or did i miss anything?

../apps/app_rand.c:10:18: fatal error: apps.h: No such file or directory

wdeng:~/wenbindfiles/openssl/openssl [master]$ ls

ACKNOWLEDGEMENTS  boringssl        config        Configure      doc        FAQ      krb5       libcrypto.so    libssl.pc    ms           NOTES.PERL      NOTES.WIN   os-dep          README.ENGINE  tools
apps          build.info        config.com        CONTRIBUTING  engines   fuzz     libcrypto.a   libcrypto.so.3  libssl.so    NEWS           NOTES.UNIX      NUL       providers          README.FIPS    util
appveyor.yml      build.info.patch  configdata.pm   crypto      e_os.h    include  libcrypto.ld  libssl.a       libssl.so.3    NOTES.ANDROID  NOTES.VALGRIND  obj       pyca-cryptography  ssl         VMS
AUTHORS          CHANGES        Configurations  demos      external  INSTALL  libcrypto.pc  libssl.ld       LICENSE    NOTES.DJGPP    NOTES.VMS       openssl.pc  README          test

wdeng:~/wenbindfiles/openssl/openssl [master]$ git log -n 1
commit d3136af3c3905a730bd8fb44158aab36a2549d9b
Author: Richard Levitte <[hidden email]>
Date:   Sat May 18 16:24:21 2019 -0700

    Configure: let platform->dsoext() default with platform->shlibextsimple()
    
    We still use '.so' as a last resort...
    
    Fixes #8950
    
    Reviewed-by: Tim Hudson <[hidden email]>
wdeng@pek-dliu4-u1:~/wenbindfiles/openssl/openssl [master]$ cd obj/

wdeng@pek-dliu4-u1:~/wenbindfiles/openssl/openssl/obj [master]$ ../config
Operating system: x86_64-whatever-linux2
Configuring OpenSSL version 3.0.0-dev for target linux-x86_64
Using os-specific seed configuration
Creating configdata.pm
Creating Makefile

**********************************************************************
***                                                                ***
***   OpenSSL has been successfully configured                     ***
***                                                                ***
***   If you encounter a problem while building, please open an    ***
***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl configdata.pm --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   'Troubleshooting' section in the INSTALL file first)         ***
***                                                                ***
**********************************************************************
wdeng:~/wenbindfiles/openssl/openssl/obj [master]$ make
make depend && make _all
make[1]: Entering directory '/folk/wdeng/wenbindfiles/openssl/openssl/obj'
make[1]: Leaving directory '/folk/wdeng/wenbindfiles/openssl/openssl/obj'
make[1]: Entering directory '/folk/wdeng/wenbindfiles/openssl/openssl/obj'
gcc   -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -DNDEBUG  -MMD -MF apps/libapps-lib-app_rand.d.tmp -MT apps/libapps-lib-app_rand.o -c -o apps/libapps-lib-app_rand.o ../apps/app_rand.c
../apps/app_rand.c:10:18: fatal error: apps.h: No such file or directory
compilation terminated.
Makefile:826: recipe for target 'apps/libapps-lib-app_rand.o' failed
make[1]: *** [apps/libapps-lib-app_rand.o] Error 1
make[1]: Leaving directory '/folk/wdeng/wenbindfiles/openssl/openssl/obj'
Makefile:165: recipe for target 'all' failed
make: *** [all] Error 2

Thanks,
Wenbin


 

Reply | Threaded
Open this post in threaded view
|

Re: Building openssl outside of the source tree" doesn't work well

Richard Levitte - VMS Whacker-2
On Tue, 21 May 2019 03:26:41 +0200,
dengwenbin_0301 wrote:

>
> wdeng@pek-dliu4-u1:~/wenbindfiles/openssl/openssl [master]$ cd obj/
>
> wdeng@pek-dliu4-u1:~/wenbindfiles/openssl/openssl/obj [master]$ ../config
> Operating system: x86_64-whatever-linux2
> Configuring OpenSSL version 3.0.0-dev for target linux-x86_64
> Using os-specific seed configuration
> Creating configdata.pm
> Creating Makefile
>
> **********************************************************************
> ***                                                                ***
> ***   OpenSSL has been successfully configured                     ***
> ***                                                                ***
> ***   If you encounter a problem while building, please open an    ***
> ***   issue on GitHub <https://github.com/openssl/openssl/issues> ; ***
> ***   and include the output from the following command:           ***
> ***                                                                ***
> ***       perl configdata.pm --dump                                ***
> ***                                                                ***
> ***   (If you are new to OpenSSL, you might want to consult the    ***
> ***   'Troubleshooting' section in the INSTALL file first)         ***
> ***                                                                ***
> **********************************************************************
> wdeng:~/wenbindfiles/openssl/openssl/obj [master]$ make
> make depend && make _all
> make[1]: Entering directory '/folk/wdeng/wenbindfiles/openssl/openssl/obj'
> make[1]: Leaving directory '/folk/wdeng/wenbindfiles/openssl/openssl/obj'
> make[1]: Entering directory '/folk/wdeng/wenbindfiles/openssl/openssl/obj'
> gcc   -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -DOPENSSL_USE_NODELETE -DL_ENDIAN
> -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5
> -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM
> -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM
> -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-3\"" -DMODULESDIR="\"/usr
> /local/lib/ossl-modules\"" -DNDEBUG  -MMD -MF apps/libapps-lib-app_rand.d.tmp -MT apps/
> libapps-lib-app_rand.o -c -o apps/libapps-lib-app_rand.o ../apps/app_rand.c
> ../apps/app_rand.c:10:18: fatal error: apps.h: No such file or directory
> compilation terminated.
> Makefile:826: recipe for target 'apps/libapps-lib-app_rand.o' failed
> make[1]: *** [apps/libapps-lib-app_rand.o] Error 1
> make[1]: Leaving directory '/folk/wdeng/wenbindfiles/openssl/openssl/obj'
> Makefile:165: recipe for target 'all' failed
> make: *** [all] Error 2

I tried exactly that just now, exactly same 'obj' ubdirectory, and it
works with no problem.

Something I'm noticing from your command line is that all -I options
that I expect to see there are gone.  This is what I expect (note that
I go directly at the object file for demonstration purposes):

    : ; make apps/libapps-lib-app_rand.o
    gcc  -I. -Iinclude -Iapps/include -I.. -I../include
    -I../apps/include  -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3
    -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC
    -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT
    -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM
    -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM
    -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM
    -DX25519_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/usr/local/ssl\""
    -DENGINESDIR="\"/usr/local/lib/engines-3\""
    -DMODULESDIR="\"/usr/local/lib/ossl-modules\"" -DNDEBUG  -MMD -MF
    apps/libapps-lib-app_rand.d.tmp -MT apps/libapps-lib-app_rand.o -c
    -o apps/libapps-lib-app_rand.o ../apps/app_rand.c

So the question is what happened to '-I. -Iinclude -Iapps/include
-I.. -I../include -I../apps/include' in your build.

I cannot say right now, but it might help if you show the output from
'./configdata.pm --dump'

Cheers,
Richard

--
Richard Levitte         [hidden email]
OpenSSL Project         http://www.openssl.org/~levitte/