-
Notifications
You must be signed in to change notification settings - Fork 119
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
fix -Wcast-function-type
build issues
#1972
Conversation
``` 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
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1972 +/- ##
==========================================
- Coverage 78.77% 78.75% -0.03%
==========================================
Files 590 590
Lines 101482 101482
Branches 14396 14394 -2
==========================================
- Hits 79945 79918 -27
- Misses 20902 20928 +26
- Partials 635 636 +1 ☔ View full report in Codecov by Sentry. |
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add license statement in PR description.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.
Done. |
Thanks! Merged it. |
https://github.com/aws/aws-lc/releases/tag/v1.39.0 Includes upstreamed patch: aws/aws-lc#1972 aws/aws-lc@a11d73c
Issues:
Resolves #1971
Description of changes:
-Werror,-Wcast-function-type-mismatch
incrypto/rand_extra/windows.c
.-Wno-cast-function-type
to clang versions supporting it.Should address https://gitlab.gnome.org/GNOME/gnome-terminal/-/issues/96 also for clang builds.
Ref: Add a broader set of compile flags. #155
Call-outs:
Testing:
I build-tested both changes.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.