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

can't compile on windows, using clang #17929

Open
AndreyMlashkin opened this issue Mar 21, 2022 · 4 comments
Open

can't compile on windows, using clang #17929

AndreyMlashkin opened this issue Mar 21, 2022 · 4 comments
Labels
triaged: feature The issue/pr requests/adds a feature

Comments

@AndreyMlashkin
Copy link

It is related to this issue: conan-io/conan-center-index#9834

Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=clang
compiler.runtime=MD
compiler.version=12
cppstd=17
os=Windows
os_build=Windows
pictofitstudio:build_type=RelWithDebInfo
pictofitcore:build_type=RelWithDebInfo
[options]
pictofitstudio*:with_sentry=True
[build_requires]
[env]
CC=clang-cl
CONAN_CMAKE_GENERATOR=Ninja
CXX=clang-cl

Logs (Include/Attach if Applicable)

Click to expand log
openssl/1.1.1m: Calling build()
Found Visual Studio 16
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.11.11
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
openssl/1.1.1m: using target: VC-conan-Release-Windows-x86_64-clang-12 -> VC-WIN64A
openssl/1.1.1m: my %targets = (
    "VC-conan-Release-Windows-x86_64-clang-12" => {
        inherit_from => [ "VC-WIN64A" ],
        cflags => add("-m64 -O3 -MD"),
        cxxflags => add("-m64 -O3 -MD"),
        defines => add("NDEBUG"),
        includes => add("D:/.conan/fb39bb/1/include"),
        lflags => add("-m64"),



        cc => "clang-cl",
        cxx => "clang-cl",



    },
);

openssl/1.1.1m: ['"VC-conan-Release-Windows-x86_64-clang-12"', 'no-shared', '--prefix="D:\\.conan\\storage\\openssl\\1.1.1m\\_\\_\\package\\e5dfaa2a6d0ff8915bb91aa1f1e2569e87e2b3dc"', '--openssldir="D:\\.conan\\storage\\openssl\\1.1.1m\\_\\_\\package\\e5dfaa2a6d0ff8915bb91aa1f1e2569e87e2b3dc\\res"', 'no-unit-test', 'threads', 'PERL=D:\\.conan\\fb39bb\\1\\bin\\perl.exe', 'no-tests', '--release']
WARN: replace_in_file didn't find pattern '/MTd ' in 'Configurations\10-main.conf' file.
WARN: replace_in_file didn't find pattern '/MTd"' in 'Configurations\10-main.conf' file.

----Running------
> D:\.conan\fb39bb\1\bin\perl.exe ./Configure "VC-conan-Release-Windows-x86_64-clang-12" no-shared --prefix="D:\.conan\storage\openssl\1.1.1m\_\_\package\e5dfaa2a6d0ff8915bb91aa1f1e2569e87e2b3dc" --openssldir="D:\.conan\storage\openssl\1.1.1m\_\_\package\e5dfaa2a6d0ff8915bb91aa1f1e2569e87e2b3dc\res" no-unit-test threads PERL=D:\.conan\fb39bb\1\bin\perl.exe no-tests --release
-----------------
Configuring OpenSSL version 1.1.1m (0x101010dfL) for VC-conan-Release-Windows-x86_64-clang-12
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)         ***
***                                                                ***
**********************************************************************

----Running------
> nmake
-----------------

Microsoft (R) Program Maintenance Utility Version 14.29.30141.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        "D:\.conan\fb39bb\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl"  "-omakefile" "include\crypto\bn_conf.h.in" > include\crypto\bn_conf.h
        "D:\.conan\fb39bb\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl"  "-omakefile" "include\crypto\dso_conf.h.in" > include\crypto\dso_conf.h
        "D:\.conan\fb39bb\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl"  "-omakefile" "include\openssl\opensslconf.h.in" > include\openssl\opensslconf.h
        "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\nmake.exe" /                   depend && "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\nmake.exe" /                   _all

Microsoft (R) Program Maintenance Utility Version 14.29.30141.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Microsoft (R) Program Maintenance Utility Version 14.29.30141.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        "clang-cl"  /Zi /Fdossl_static.pdb / /Zl /Gs0 /GF /Gy -m64 -O3 -MD /W3 /wd4090 /nologo /O2 /I "." /I "include" -D"L_ENDIAN" -D"OPENSSL_PIC" -D"OPENSSL_CPUID_OBJ" -D"OPENSSL_IA32_SSE2" -D"OPENSSL_BN_ASM_MONT" -D"OPENSSL_BN_ASM_MONT5" -D"OPENSSL_BN_ASM_GF2m" -D"SHA1_ASM" -D"SHA256_ASM" -D"SHA512_ASM" -D"KECCAK1600_ASM" -D"RC4_ASM" -D"MD5_ASM" -D"AESNI_ASM" -D"VPAES_ASM" -D"GHASH_ASM" -D"ECP_NISTZ256_ASM" -D"X25519_ASM" -D"POLY1305_ASM" -D"OPENSSLDIR=\"D:\\.conan\\storage\\openssl\\1.1.1m\\_\\_\\package\\e5dfaa2a6d0ff8915bb91aa1f1e2569e87e2b3dc\\res\"" -D"ENGINESDIR=\"D:\\.conan\\storage\\openssl\\1.1.1m\\_\\_\\package\\e5dfaa2a6d0ff8915bb91aa1f1e2569e87e2b3dc\\lib\\engines-1_1\"" -D"OPENSSL_SYS_WIN32" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS" -D"NDEBUG" -D"NDEBUG" -I"D:/.conan/fb39bb/1/include"  -c /Foapps\app_rand.obj "apps\app_rand.c"
clang-cl: error: cannot specify '/Foapps\app_rand.obj' when compiling multiple source files
clang-cl: warning: /: 'linker' input unused [-Wunused-command-line-argument]
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\Llvm\x64\bin\clang-cl.EXE"' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\nmake.exe"' : return code '0x2'

@AndreyMlashkin AndreyMlashkin added the issue: bug report The issue was opened to report a bug label Mar 21, 2022
@t8m t8m added triaged: feature The issue/pr requests/adds a feature and removed issue: bug report The issue was opened to report a bug labels Apr 21, 2022
@t8m
Copy link
Member

t8m commented Apr 21, 2022

This is an unsupported configuration. Supporting it would be a new feature.

@ajkhoury
Copy link
Contributor

@AndreyMlashkin I ran into a similar problem which is why I decided to focus on this PR: #20153

@levitte
Copy link
Member

levitte commented Jan 28, 2023

This is an unsupported configuration. Supporting it would be a new feature.

Er.... they are making their own config targets with inheritance from VC-WIN64A. That's a supported feature!

Now, looking more closely at what's going on, this seems to be the indicative bit:

        "clang-cl"  /Zi /Fdossl_static.pdb / /Zl /Gs0 /GF /Gy -m64 -O3 -MD /W3 /wd4090 /nologo /O2 /I "." /I "include" -D"L_ENDIAN" -D"OPENSSL_PIC" -D"OPENSSL_CPUID_OBJ" -D"OPENSSL_IA32_SSE2" -D"OPENSSL_BN_ASM_MONT" -D"OPENSSL_BN_ASM_MONT5" -D"OPENSSL_BN_ASM_GF2m" -D"SHA1_ASM" -D"SHA256_ASM" -D"SHA512_ASM" -D"KECCAK1600_ASM" -D"RC4_ASM" -D"MD5_ASM" -D"AESNI_ASM" -D"VPAES_ASM" -D"GHASH_ASM" -D"ECP_NISTZ256_ASM" -D"X25519_ASM" -D"POLY1305_ASM" -D"OPENSSLDIR=\"D:\\.conan\\storage\\openssl\\1.1.1m\\_\\_\\package\\e5dfaa2a6d0ff8915bb91aa1f1e2569e87e2b3dc\\res\"" -D"ENGINESDIR=\"D:\\.conan\\storage\\openssl\\1.1.1m\\_\\_\\package\\e5dfaa2a6d0ff8915bb91aa1f1e2569e87e2b3dc\\lib\\engines-1_1\"" -D"OPENSSL_SYS_WIN32" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS" -D"NDEBUG" -D"NDEBUG" -I"D:/.conan/fb39bb/1/include"  -c /Foapps\app_rand.obj "apps\app_rand.c"
clang-cl: error: cannot specify '/Foapps\app_rand.obj' when compiling multiple source files
clang-cl: warning: /: 'linker' input unused [-Wunused-command-line-argument]

I believe that both errors are caused by the lonely / near the beginning of that command. That seems very odd, I wonder where that comes from:

"clang-cl" /Zi /Fdossl_static.pdb ===THIS===> / <=== /Zl /Gs0 /GF ...

@levitte
Copy link
Member

levitte commented Jan 28, 2023

Another thing to note is this:

openssl/1.1.1m: ['"VC-conan-Release-Windows-x86_64-clang-12"', 'no-shared', '--prefix="D:\\.conan\\storage\\openssl\\1.1.1m\\_\\_\\package\\e5dfaa2a6d0ff8915bb91aa1f1e2569e87e2b3dc"', '--openssldir="D:\\.conan\\storage\\openssl\\1.1.1m\\_\\_\\package\\e5dfaa2a6d0ff8915bb91aa1f1e2569e87e2b3dc\\res"', 'no-unit-test', 'threads', 'PERL=D:\\.conan\\fb39bb\\1\\bin\\perl.exe', 'no-tests', '--release']
WARN: replace_in_file didn't find pattern '/MTd ' in 'Configurations\10-main.conf' file.
WARN: replace_in_file didn't find pattern '/MTd"' in 'Configurations\10-main.conf' file.

If I may venture a guess, something isn't quite right somewhere in there. I suppose you're trying to do some odd modification of Configurations/10-main.conf and the result isn't quite right... could it be that this is where the lonely / appears?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged: feature The issue/pr requests/adds a feature
Projects
None yet
Development

No branches or pull requests

4 participants