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

libressl 4.0.0 build fails when using Clang on Windows #1111

Closed
Tyranisaur opened this issue Oct 15, 2024 · 3 comments · Fixed by #1112
Closed

libressl 4.0.0 build fails when using Clang on Windows #1111

Tyranisaur opened this issue Oct 15, 2024 · 3 comments · Fixed by #1112

Comments

@Tyranisaur
Copy link

  REDACTED\build\clang-cl-ninja-debug\_deps\libressl-src\crypto\compat\posix_win.c(294,5): error : conflicting types for 'libressl_gettimeofday'
    294 | int gettimeofday(struct timeval * tp, struct timezone * tzp)
        |     ^
  REDACTED\build\clang-cl-ninja-debug\_deps\libressl-src\include\compat\sys\time.h(13,22): note: expanded from macro 'gettimeofday'
     13 | #define gettimeofday libressl_gettimeofday
        |                      ^
  REDACTED\build\clang-cl-ninja-debug\_deps\libressl-src\include\compat\sys\time.h(20,5): note: previous declaration is here
     20 | int gettimeofday(struct timeval *tp, void *tzp);
        |     ^
  REDACTED\build\clang-cl-ninja-debug\_deps\libressl-src\include\compat\sys\time.h(13,22): note: expanded from macro 'gettimeofday'
     13 | #define gettimeofday libressl_gettimeofday
        |                      ^
  1 error generated.

If I understand this correctly, this build issue surfaced as a result of #1078 because posix_win.c now includes sys/time.h, resulting in the compiler now seeing both the declaration and definition of the gettimeofday function, which have different argument types: void * vs struct timezone *. So now the compiler can finally complain about this.

However, the msvc compiler has no issues with this, and doesn't even have a warning that could be emitted for it.

@botovq
Copy link
Contributor

botovq commented Oct 15, 2024

There are too many ways to build things on Windows... :)

Yes, it will be a consequence of #1078. For -stable we probably need to stick with void *, although I wonder if we can't use struct timezone * both in declaration and definition.

Could you check if #1112 fixes this on your end? I don't have access to Windows, and obviously CI doesn't cover this case.

@Tyranisaur
Copy link
Author

Tyranisaur commented Oct 15, 2024

Could you check if #1112 fixes this on your end? I don't have access to Windows, and obviously CI doesn't cover this case.

This seems to work on my end with both msvc and clang.

@botovq botovq closed this as completed in 16c2e3c Oct 15, 2024
@botovq
Copy link
Contributor

botovq commented Oct 15, 2024

Awesome. Thanks for the report and testing.

busterb pushed a commit that referenced this issue Oct 16, 2024
nak3 pushed a commit to nak3/portable that referenced this issue Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants