Skip to content

-undefined dynamic_lookup confuses configure #440

Closed
@nbrachet

Description

@nbrachet

Synopsis

Bazel insists on defining -undefined dynamic_lookup on darwin_x86_64 which makes the TRY_LINK rule always succeed.

I'm not sure what the best course of action is. Should this be considered a bug in autoconf? Or a bug in bazel? But it seems pretty specific to using configure_make.

How to reproduce

libcurl 7.73.0 exhibits this problem when building on macosx using GCC (not the native Clang).

        http_archive(
            name = "curl",
            urls = ["https://curl.haxx.se/download/curl-7.73.0.tar.gz",],
            strip_prefix = "curl-7.73.0",
            build_file_content = """
load("@rules_foreign_cc//tools/build_defs:configure.bzl", "configure_make")

filegroup(
    name = "all",
    srcs = glob(["**"]),
)

configure_make(
    name = "curl",
    visibility = ["//visibility:public"],
    configure_env_vars = select({
        "@bazel_tools//src/conditions:darwin": {
            # see https://github.com/bazelbuild/rules_foreign_cc/issues/185
            # for why this magic is required for the OSX build
            "AR": "",
        },
        "//conditions:default": {},
    }),
    configure_options = select({
            "@bazel_tools//src/conditions:darwin": [
                "--without-libpsl",
                "--without-idn2",
                "--without-ssl",
                # "--with-darwinssl",
            ],
            "//conditions:default": [
                "--with-ssl",
            ],
        }) + [
        "--enable-http",
        "--enable-proxy",
        "--disable-ftp",
        "--disable-file",
        "--disable-ldap",
        "--disable-ldaps",
        "--disable-rtsp",
        "--disable-dict",
        "--disable-telnet",
        "--disable-tftp",
        "--disable-pop3",
        "--disable-imap",
        "--disable-smb",
        "--disable-smtp",
        "--disable-gopher",
        "--disable-mqtt",
        "--disable-manual",
        "--disable-doh",
        "--without-zlib",
        "--without-gnutls",
        "--without-mbedtls",
        "--without-wolfssl",
        "--without-mesalink",
        "--without-nss",
        "--without-bearssl",
        "--without-libmetalink",
        "--without-librtmp",
        "--without-ngtcp2",
        "--without-nghttp2",
        "--without-nghttp3",
        "--without-quiche",
        "--disable-shared",
    ],
    lib_source = ":all",
    out_include_dir = "include",
    static_libraries = ["libcurl.a"],
    linkopts = select({
        "@bazel_tools//src/conditions:darwin": [
            "-framework", "Security",
        ],
        "//conditions:default": [
            "-lssl",
            "-lcrypto",
        ],
    }),
)
"""
        )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions