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

[bug] can't build openssl from conan in windows #17738

Open
omayaro opened this issue Feb 7, 2025 · 2 comments
Open

[bug] can't build openssl from conan in windows #17738

omayaro opened this issue Feb 7, 2025 · 2 comments
Assignees

Comments

@omayaro
Copy link

omayaro commented Feb 7, 2025

Describe the bug

Environment details:
OS: windows
compiler: clang
conan version: conan2
openssl version: 3.0.14

description:
trying to build open ssl but getting failed with "clang: error: unknown argument: '-MDd'". this works on Mac OS. I'm trying to build this on windows now but it fails. not sure how to fix this issue.

can someone get me help?

detail error logs are

`
Configuring OpenSSL version 3.0.14 for target conan-Debug-Android-armv7-clang-14
Using os-specific seed configuration
Created configdata.pm
Running configdata.pm
Created Makefile.in
Created Makefile
Created include/openssl/configuration.h



*** 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.md file first) ***



openssl/3.0.14@spre/stable: RUN: make -j16
mkdir: cannot create directory '/dev/shm': Read-only file system

Creating /dev/shm directory failed.
POSIX semaphores and POSIX shared memory will not work

mkdir: cannot create directory '/dev/mqueue': Read-only file system

Creating /dev/mqueue directory failed.
POSIX message queues will not work

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/asn1.h.in > include/openssl/asn1.h
perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/asn1t.h.in > include/openssl/asn1t.h
perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/bio.h.in > include/openssl/bio.h
perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/cmp.h.in > include/openssl/cmp.h
perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/cms.h.in > include/openssl/cms.h
perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/conf.h.in > include/openssl/conf.h
perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/crmf.h.in > include/openssl/crmf.h
perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/crypto.h.in > include/openssl/crypto.h
perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/ct.h.in > include/openssl/ct.h
perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/err.h.in > include/openssl/err.h
perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/ess.h.in > include/openssl/ess.h
perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/fipskey.h.in > include/openssl/fipskey.h
perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/lhash.h.in > include/openssl/lhash.h
perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/ocsp.h.in > include/openssl/ocsp.h
perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/opensslv.h.in > include/openssl/opensslv.h
perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/pkcs12.h.in > include/openssl/pkcs12.h
perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/pkcs7.h.in > include/openssl/pkcs7.h
perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/safestack.h.in > include/openssl/safestack.h
perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/srp.h.in > include/openssl/srp.h
perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/ssl.h.in > include/openssl/ssl.h
perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/ui.h.in > include/openssl/ui.h
perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/x509.h.in > include/openssl/x509.h
perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/x509_vfy.h.in > include/openssl/x509_vfy.h
perl "-I." -Mconfigdata "util/dofile.pl" "-oMakefile" include/openssl/x509v3.h.in > include/openssl/x509v3.h
"make" depend && "make" build_sw
make[1]: Entering directory '/c/Users/omayaro/.conan2/p/b/opensd22f4f7161c38/b/src'
make[1]: Leaving directory '/c/Users/omayaro/.conan2/p/b/opensd22f4f7161c38/b/src'
make[1]: Entering directory '/c/Users/omayaro/.conan2/p/b/opensd22f4f7161c38/b/src'
/c/users/omayaro/appdata/local/android/sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/bin/armv7a-linux-androideabi21-clang.cmd -I. -Iinclude -Iapps/include -fPIC -pthread -fPIC -MDd --sysroot C:/Users/omayaro/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -fPIC -MDd --sysroot C:/Users/omayaro/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -fPIC -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSLDIR=""/res"" -DENGINESDIR=""//lib/engines-3"" -DMODULESDIR=""//lib/ossl-modules"" -DOPENSSL_BUILDING_OPENSSL -D__ANDROID_API
_=21 -MMD -MF apps/lib/libapps-lib-app_libctx.d.tmp -MT apps/lib/libapps-lib-app_libctx.o -c -o apps/lib/libapps-lib-app_libctx.o apps/lib/app_libctx.c
/c/users/omayaro/appdata/local/android/sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/bin/armv7a-linux-androideabi21-clang.cmd -I. -Iinclude -Iapps/include -fPIC -pthread -fPIC -MDd --sysroot C:/Users/omayaro/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -fPIC -MDd --sysroot C:/Users/omayaro/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -fPIC -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSLDIR=""/res"" -DENGINESDIR=""//lib/engines-3"" -DMODULESDIR=""//lib/ossl-modules"" -DOPENSSL_BUILDING_OPENSSL -D__ANDROID_API__=21 -MMD -MF apps/lib/libapps-lib-app_params.d.tmp -MT apps/lib/libapps-lib-app_params.o -c -o apps/lib/libapps-lib-app_params.o apps/lib/app_params.c
/c/users/omayaro/appdata/local/android/sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/bin/armv7a-linux-androideabi21-clang.cmd -I. -Iinclude -Iapps/include -fPIC -pthread -fPIC -MDd --sysroot C:/Users/omayaro/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -fPIC -MDd --sysroot C:/Users/omayaro/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -fPIC -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSLDIR=""/res"" -DENGINESDIR=""//lib/engines-3"" -DMODULESDIR=""//lib/ossl-modules"" -DOPENSSL_BUILDING_OPENSSL -D__ANDROID_API__=21 -MMD -MF apps/lib/libapps-lib-app_provider.d.tmp -MT apps/lib/libapps-lib-app_provider.o -c -o apps/lib/libapps-lib-app_provider.o apps/lib/app_provider.c
/c/users/omayaro/appdata/local/android/sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/bin/armv7a-linux-androideabi21-clang.cmd -I. -Iinclude -Iapps/include -fPIC -pthread -fPIC -MDd --sysroot C:/Users/omayaro/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -fPIC -MDd --sysroot C:/Users/omayaro/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -fPIC -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSLDIR=""/res"" -DENGINESDIR=""//lib/engines-3"" -DMODULESDIR=""//lib/ossl-modules"" -DOPENSSL_BUILDING_OPENSSL -D__ANDROID_API__=21 -MMD -MF apps/lib/libapps-lib-app_rand.d.tmp -MT apps/lib/libapps-lib-app_rand.o -c -o apps/lib/libapps-lib-app_rand.o apps/lib/app_rand.c
/c/users/omayaro/appdata/local/android/sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/bin/armv7a-linux-androideabi21-clang.cmd -I. -Iinclude -Iapps/include -fPIC -pthread -fPIC -MDd --sysroot C:/Users/omayaro/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -fPIC -MDd --sysroot C:/Users/omayaro/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -fPIC -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSLDIR=""/res"" -DENGINESDIR=""//lib/engines-3"" -DMODULESDIR=""//lib/ossl-modules"" -DOPENSSL_BUILDING_OPENSSL -D__ANDROID_API__=21 -MMD -MF apps/lib/libapps-lib-app_x509.d.tmp -MT apps/lib/libapps-lib-app_x509.o -c -o apps/lib/libapps-lib-app_x509.o apps/lib/app_x509.c
/c/users/omayaro/appdata/local/android/sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/bin/armv7a-linux-androideabi21-clang.cmd -I. -Iinclude -Iapps/include -fPIC -pthread -fPIC -MDd --sysroot C:/Users/omayaro/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -fPIC -MDd --sysroot C:/Users/omayaro/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -fPIC -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSLDIR=""/res"" -DENGINESDIR=""//lib/engines-3"" -DMODULESDIR=""//lib/ossl-modules"" -DOPENSSL_BUILDING_OPENSSL -D__ANDROID_API__=21 -MMD -MF apps/lib/libapps-lib-apps.d.tmp -MT apps/lib/libapps-lib-apps.o -c -o apps/lib/libapps-lib-apps.o apps/lib/apps.c
clang: error: unknown argument: '-MDd'
clang: error: unknown argument: '-MDd'
/c/users/omayaro/appdata/local/android/sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/bin/armv7a-linux-androideabi21-clang.cmd -I. -Iinclude -Iapps/include -fPIC -pthread -fPIC -MDd --sysroot C:/Users/omayaro/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -fPIC -MDd --sysroot C:/Users/omayaro/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -fPIC -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSLDIR=""/res"" -DENGINESDIR=""//lib/engines-3"" -DMODULESDIR=""//lib/ossl-modules"" -DOPENSSL_BUILDING_OPENSSL -D__ANDROID_API__=21 -MMD -MF apps/lib/libapps-lib-apps_ui.d.tmp -MT apps/lib/libapps-lib-apps_ui.o -c -o apps/lib/libapps-lib-apps_ui.o apps/lib/apps_ui.c
clang: error: unknown argument: '-MDd'
clang: error: unknown argument: '-MDd'
make[1]: *** [Makefile:3152: apps/lib/libapps-lib-app_libctx.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:3160: apps/lib/libapps-lib-app_params.o] Error 1
clang: error: unknown argument: '-MDd'
clang: error: unknown argument: '-MDd'
make[1]: *** [Makefile:3168: apps/lib/libapps-lib-app_provider.o] Error 1
clang: error: unknown argument: '-MDd'
clang: error: unknown argument: '-MDd'
make[1]: *** [Makefile:3176: apps/lib/libapps-lib-app_rand.o] Error 1
clang: error: unknown argument: '-MDd'
clang: error: unknown argument: '-MDd'
make[1]: *** [Makefile:3184: apps/lib/libapps-lib-app_x509.o] Error 1
clang: error: unknown argument: '-MDd'
clang: error: unknown argument: '-MDd'
make[1]: *** [Makefile:3192: apps/lib/libapps-lib-apps.o] Error 1
clang: error: unknown argument: '-MDd'
clang: error: unknown argument: '-MDd'
make[1]: *** [Makefile:3200: apps/lib/libapps-lib-apps_ui.o] Error 1
make[1]: Leaving directory '/c/Users/omayaro/.conan2/p/b/opensd22f4f7161c38/b/src'
make: *** [Makefile:2157: build_sw] Error 2

`

How to reproduce it

No response

@omayaro omayaro changed the title [bug] [bug] can't build openssl from conan in windows Feb 7, 2025
@memsharded memsharded self-assigned this Feb 9, 2025
@memsharded
Copy link
Member

Hi @omayaro

Thanks for your feedback.

Recipes and packages from ConanCenter are built and tested in Windows with msvc compiler, but not with clang. Consequently, support for Clang compiler in Windows might vary, so this might not be a Conan issue per se, but a recipe limitation. If you can, I'd recommend using msvc compiler in Windows for ConanCenter packages.

I'll try to have a look to the issue, can you please provide:

  • The full profile that you are using. clang is not the default compiler, so it might need definitions as [buildenv] and/or compiler_excutables conf
  • The command that you are using
  • Which exact Conan version (the output of conan version can be useful in general)
  • The profile looks an Android one, so this might need its own configuration, like the ndk_path conf

@omayaro
Copy link
Author

omayaro commented Feb 13, 2025

I'm not sure these are what you wanted but let me try to provide.

  • compiler_executables = {
    "c": self._define_tool_var("CC", "clang"),
    "cpp": self._define_tool_var("CXX", "clang++"),
    }

  • conan vesion: 2.7.1

  • ndk_path: C:\Users\omayaro\AppData\Local\Android\Sdk\ndk\25.2.9519653

I'm installing openssl by conan. I missed first part. maybe you want to see those. this log is first part of logs that I attached above.

`
-------- Installing package openssl/3.0.14@spre/stable (22 of 35) --------
openssl/3.0.14@spre/stable: Building from source
openssl/3.0.14@spre/stable: Package openssl/3.0.14@spre/stable:2813d559ecc49388d55c1514313dd88c710a575f
openssl/3.0.14@spre/stable: Copying sources to build folder
openssl/3.0.14@spre/stable: Building your package in C:\Users\omayaro.conan2\p\b\opensd4db201dca9b2\b
openssl/3.0.14@spre/stable: Calling generate()
openssl/3.0.14@spre/stable: Generators folder: C:\Users\omayaro.conan2\p\b\opensd4db201dca9b2\b\build-debug\conan
openssl/3.0.14@spre/stable: WARN: tools.build:compiler_executables conf has no effect when tools.android:ndk_path is defined too.
openssl/3.0.14@spre/stable: Generating aggregated env files
openssl/3.0.14@spre/stable: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']
openssl/3.0.14@spre/stable: Calling build()
openssl/3.0.14@spre/stable: apply_conandata_patches(): No patches defined in conandata
openssl/3.0.14@spre/stable: gen_info = {'CFLAGS': ['-fPIC', '-MDd', '--sysroot C:/Users/omayaro/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/sysroot', '-g'], 'CXXFLAGS': ['-fPIC', '-MDd', '--sysroot C:/Users/omayaro/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/sysroot', '-g'], 'DEFINES': [], 'LDFLAGS': ['--sysroot C:/Users/omayaro/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/sysroot']}
openssl/3.0.14@spre/stable: using target: conan-Debug-Android-armv7-clang-14 -> linux-generic32
openssl/3.0.14@spre/stable: my %targets = (
"conan-Debug-Android-armv7-clang-14" => {
inherit_from => [ "linux-generic32" ],
cflags => add("-fPIC -MDd --sysroot C:/Users/omayaro/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g"),
cxxflags => add("-fPIC -MDd --sysroot C:/Users/omayaro/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g"),

      includes => add(),
      lflags => add("--sysroot C:/Users/omayaro/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/sysroot"),



      cc => "C:/Users/omayaro/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe",
      cxx => "C:/Users/omayaro/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe",


      perlasm_scheme => "void",
  },

);

openssl/3.0.14@spre/stable: ['"conan-Debug-Android-armv7-clang-14"', 'no-shared', '--prefix=/', '--openssldir="res"', 'no-unit-test', 'threads', 'PERL=perl', 'no-tests', '--debug', '--libdir=lib', ' -D__ANDROID_API__=21', '-fPIC', 'no-md2']
openssl/3.0.14@spre/stable: RUN: perl ./Configure "conan-Debug-Android-armv7-clang-14" no-shared --prefix=/ --openssldir="res" no-unit-test threads PERL=perl no-tests --debug --libdir=lib -D__ANDROID_API__=21 -fPIC no-md2
mkdir: cannot create directory '/dev/shm': Read-only file system

Creating /dev/shm directory failed.
POSIX semaphores and POSIX shared memory will not work

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants