-
Notifications
You must be signed in to change notification settings - Fork 125
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
Windows clang build fails with -Werror,-Wcast-function-type-mismatch
#1971
Comments
-Werror,-Wcast-function-type-mismatch
-Werror,-Wcast-function-type-mismatch
vszakats
added a commit
to vszakats/aws-lc
that referenced
this issue
Nov 6, 2024
``` crypto/rand_extra/windows.c:68:22: error: cast from 'FARPROC' (aka 'long long (*)()') to 'ProcessPrngFunction' (aka 'int (*)(unsigned char *, unsigned long long)') converts to incompatible function type [-Werror,-Wcast-function-type-mismatch] 68 | g_processprng_fn = (ProcessPrngFunction)GetProcAddress(hmod, "ProcessPrng"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` Fixes aws#1971
vszakats
added a commit
to curl/curl-for-win
that referenced
this issue
Nov 7, 2024
Experimental. Not working. The goal is to make it possible to test and compare it with BoringSSL. Also: - disable Perl (it's not present on Alpine by default). Needed for FIPS only. - add new Windows-specific AWS-LC build issue where it force-sets `_WIN32_WINNT` to Win7. - address the above by patching out `_WIN32_WINNT` force-set. - address the above by bumping Windows target to Win7. Yet to be seen if this is a true requirement or an arbitrary value that's newer than the default they intended to avoid in some mingw builds. - fix clang 19? deprecation warning triggered in mingw-w64 builds ``` /usr/lib/llvm-19/lib/clang/19/include/mm3dnow.h:16:2: error: "The <mm3dnow.h> header is deprecated, and 3dNow! intrinsics are unsupported. For other intrinsics, include <x86intrin.h>, instead." [-Werror,-W#warnings] 16 | #warning "The <mm3dnow.h> header is deprecated, and 3dNow! intrinsics are unsupported. For other intrinsics, include <x86intrin.h>, instead." | ^ 1 error generated. ``` https://github.com/curl/curl-for-win/actions/runs/11714432529/job/32629108727#step:3:4286 - patch AWS-LC to avoid `-Werror,-Wcast-function-type-mismatch` on Windows: ``` /path/to/awslc/crypto/rand_extra/windows.c:68:22: error: cast from 'FARPROC' (aka 'long long (*)()') to 'ProcessPrngFunction' (aka 'int (*)(unsigned char *, unsigned long long)') converts to incompatible function type [-Werror,-Wcast-function-type-mismatch] 68 | g_processprng_fn = (ProcessPrngFunction)GetProcAddress(hmod, "ProcessPrng"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. ``` https://github.com/curl/curl-for-win/actions/runs/11712448493/job/32623148501#step:3:3996 Upstream report and patch: aws/aws-lc#1971 aws/aws-lc#1972 Unfixed issues: - curl cmake is trying and failing to detect ECH support: ``` -- Looking for SSL_set1_ech_config_list - not found [...] "/usr/bin/ld.lld-19" --sysroot=/usr/x86_64-w64-mingw32 -m i386pep -Bdynamic -o cmTC_d97c0.exe /usr/x86_64-w64-mingw32/lib/crt2.o /usr/x86_64-w64-mingw32/lib/crtbegin.o -L/usr/lib/gcc/x86_64-w64-mingw32/13-posix -L/usr/x86_64-w64-mingw32/x86_64-w64-mingw32/lib -L/usr/x86_64-w64-mingw32/x86_64-w64-mingw32/mingw/lib -L/usr/x86_64-w64-mingw32/lib -lucrt -Xlink=-cetcompat --gc-sections --icf=all -s -Bstatic -Map curl.map -lpthread CMakeFiles/cmTC_d97c0.dir/CheckSymbolExists.c.obj --out-implib libcmTC_d97c0.dll.a --major-image-version 0 --minor-image-version 0 /home/runner/work/curl-for-win/curl-for-win/awslc/_x64-win-ucrt/usr/lib/libssl.a /home/runner/work/curl-for-win/curl-for-win/awslc/_x64-win-ucrt/usr/lib/libcrypto.a /home/runner/work/curl-for-win/curl-for-win/zlib/_x64-win-ucrt/usr/lib/libz.a -lws2_32 -lbcrypt -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32 /usr/x86_64-w64-mingw32/lib/crtend.o ld.lld-19: error: libcrypto.a(err.o): invalid symbol index in addrsig section clang-19: error: linker command failed with exit code 1 (use -v to see invocation) ``` https://github.com/curl/curl-for-win/actions/runs/11714665857/job/32629738265#step:3:6997
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem:
When building AWS-LC for Windows using clang and mingw-w64, the build fails with:
Full log: https://github.com/curl/curl-for-win/actions/runs/11712448493/job/32623148501#step:3:3996
Relevant details
AWS-LC commit: 1.37.0
System information: for linux, below info can be collected by running
uname -srvmp
Build log:
The text was updated successfully, but these errors were encountered: