On Thu, 9 Oct 2025 at 14:15, Chenxi Mao <[email protected]> wrote: > > QEMU build fails when LTO is enabled: > ../configure --target-list=riscv64-softmmu --enable-lto > make > > Several errors occur due to incorrect curl_easy_setopt usage: > > ../contrib/elf2dmp/download.c:30:16: error: call to > ‘_curl_easy_setopt_err_long’ declared with attribute warning: > curl_easy_setopt expects a long argument [-Werror=attribute-warning] > 30 | || curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1) != > CURLE_OK > | ^ > lto1: all warnings being treated as errors > ../block/curl.c: In function ‘curl_open’: > ../block/curl.c:806:9: error: call to ‘_curl_easy_setopt_err_long’ declared > with attribute warning: curl_easy_setopt expects a long argument > [-Werror=attribute-warning] > 806 | if (curl_easy_setopt(state->curl, CURLOPT_NOBODY, 1) || > | ^ > lto1: all warnings being treated as errors > > The third parameter of curl_easy_setopt should be of long type. > Change integer constants to long by adding 'L' suffix. > > After this change, build passes and runs without errors. > > Signed-off-by: Chenxi Mao <[email protected]>
Hi; there's already a patch on list for this: https://patchew.org/QEMU/[email protected]/ Looks like that missed the elf2dmp usage though: > diff --git a/contrib/elf2dmp/download.c b/contrib/elf2dmp/download.c > index 21306b3fd4..fa8da0f9a2 100644 > --- a/contrib/elf2dmp/download.c > +++ b/contrib/elf2dmp/download.c > @@ -27,8 +27,8 @@ bool download_url(const char *name, const char *url) > if (curl_easy_setopt(curl, CURLOPT_URL, url) != CURLE_OK > || curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, NULL) != > CURLE_OK > || curl_easy_setopt(curl, CURLOPT_WRITEDATA, file) != CURLE_OK > - || curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1) != CURLE_OK > - || curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0) != CURLE_OK > + || curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L) != CURLE_OK > + || curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L) != CURLE_OK > || curl_easy_perform(curl) != CURLE_OK) { > unlink(name); > fclose(file); thanks -- PMM
