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
autotools + libressl builds fail with: unknown type name 'uint32_t' #12257
Comments
But: we don't need arc4random when we have a TLS library to get random from. A work-around would then be to just skip the check for that function when libressl is used. |
Totally agreed. This was a historical leftover that was forgotten about and noticed too late to be fixed in 3.7. It was subsequently fixed in libressl/portable@54b31ce, so LibreSSL 3.8 and later should no longer have this problem. |
Thanks for jumping in @botovq. I'm seeing this with LibreSSL 3.8.2. The linked patch fixes this for shared libs, but when linking statically (like in this particular case), |
For ref, here is the fix for the similar issue mentioned above, in libssh2, with LibreSSL and |
autotools unexpectedly detects `arc4random` because it is also looking into dependency libs. One dependency, LibreSSL, happens to publish an `arc4random` function (via its shared lib before v3.7, also via static lib as of v3.8.2). When trying to use this function in `lib/rand.c`, its protoype is missing. To fix that, curl included a prototype, but that used a C99 type without including `stdint.h`, causing: ``` ../../lib/rand.c:37:1: error: unknown type name 'uint32_t' 37 | uint32_t arc4random(void); | ^ 1 error generated. ``` This patch improves this by dropping the local prototype and instead limiting `arc4random` use for non-OpenSSL builds. OpenSSL builds provide their own random source anyway. The better fix would be to teach autotools to not link dependency libs while detecting `arc4random`. LibreSSL publishing a non-namespaced `arc4random` tracked here: libressl/portable#928 Regression from 755ddbe curl#10672 Fixes curl#12257 Closes #xxxxx
autotools unexpectedly detects `arc4random` because it is also looking into dependency libs. One dependency, LibreSSL, happens to publish an `arc4random` function (via its shared lib before v3.7, also via static lib as of v3.8.2). When trying to use this function in `lib/rand.c`, its protoype is missing. To fix that, curl included a prototype, but that used a C99 type without including `stdint.h`, causing: ``` ../../lib/rand.c:37:1: error: unknown type name 'uint32_t' 37 | uint32_t arc4random(void); | ^ 1 error generated. ``` This patch improves this by dropping the local prototype and instead limiting `arc4random` use for non-OpenSSL builds. OpenSSL builds provide their own random source anyway. The better fix would be to teach autotools to not link dependency libs while detecting `arc4random`. LibreSSL publishing a non-namespaced `arc4random` tracked here: libressl/portable#928 Regression from 755ddbe curl#10672 Reviewed-by: Daniel Stenberg Fixes curl#12257 Closes curl#12274
I did this
LibreSSL publishes its own
arc4random
, which then gets detected by autotoolswhen building curl.
Then fails when compiling
lib/rand.c
:Probably caused by: 755ddbe #10672
I'm guessing autotools shouldn't detect
HAVE_ARC4RANDOM
when it's providednot by the system, but by a library dependency (with its prototype also present
in that dependency's headers) (LibreSSL probably shouldn't publish such function
outside of its own namespace in the first place, but it does). If we want to use it
anyway, we should use a C89 type in our replacement prototype? Or, together with
HAVE_STDINT_H
and after includingstdint.h
.I expected the following
Successful build.
curl/libcurl version
8.5.0-DEV
operating system
any
The text was updated successfully, but these errors were encountered: