View Issue Details

IDProjectCategoryView StatusLast Update
0006078libmicrohttpdbuild systempublic2020-02-08 22:03
Reporterbcs Assigned ToChristian Grothoff  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.69 
Target Version0.9.70Fixed in Version0.9.70 
Summary0006078: config fails due to -Werror=unused-but-set-parameter while looking for pthreads
Descriptiontl;dr; My problem goes away if I patch in a more recent version of m4/ax_pthread.m4:
https://github.com/autoconf-archive/autoconf-archive/blob/9e917efe603b0d756f258cad6eb2056559284ed0/m4/ax_pthread.m4

Can that be done at head?

-----

One of the config steps runs a test compile/link that fails with the following error:

conftest.c: In function 'routine':
conftest.c:36:51: error: parameter 'a' set but not used [-Werror=unused-but-set-parameter]
                         static void routine(void *a) { a = 0; }

This in turn make configure assert that pthreads is not available and halt the build.
Steps To ReproduceI encountered this while trying to get a build working for an existing bazel project and I'm still trying to sort out exactly what it's doing different. I *suspect* it's caused by passing -Werror=all or something like that, but I've not been able to sort out exactly what it's doing. However I suspect it would reproduce like this:

# BUILD.microhttpd
load("@rules_foreign_cc//tools/build_defs:configure.bzl", "configure_make")
configure_make(
    name = "microhttpd",
    lib_source = "libmicrohttpd-0.9.69",
    make_commands = ["make"],
    visibility = ["//visibility:public"],
)

# WORKSPACE
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "org_gnu_microhttpd",
    urls = ["https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.69.tar.gz"],
    sha256 = "fb9b6b148b787493e637d3083588711e65cbcb726fa02cee2cd543c5de27e37e",
    build_file = "@//:BUILD.microhttpd",
)

git_repository(
    name = "rules_foreign_cc",
    path = "/home/bcs/Documents/rules_foreign_cc",
    remote = "git://github.com/bazelbuild/rules_foreign_cc.git",
    commit = "ed3db61a55c13da311d875460938c42ee8bbc2a5",
)
load("@rules_foreign_cc//:workspace_definitions.bzl", "rules_foreign_cc_dependencies")
rules_foreign_cc_dependencies([])

# CMD
bazel build @org_gnu_microhttpd//:microhttpd
TagsNo tags attached.

Activities

Christian Grothoff

2020-02-07 14:30

manager   ~0015315

Fixed in 6da31a1c..44c32e4c. Thanks for reporting and investigating!

Issue History

Date Modified Username Field Change
2020-02-05 06:14 bcs New Issue
2020-02-07 14:16 Christian Grothoff Assigned To => Christian Grothoff
2020-02-07 14:16 Christian Grothoff Status new => assigned
2020-02-07 14:30 Christian Grothoff Status assigned => resolved
2020-02-07 14:30 Christian Grothoff Resolution open => fixed
2020-02-07 14:30 Christian Grothoff Fixed in Version => 0.9.70
2020-02-07 14:30 Christian Grothoff Note Added: 0015315
2020-02-07 14:30 Christian Grothoff Target Version => 0.9.70
2020-02-08 22:03 Christian Grothoff Status resolved => closed