Skip to content

extra-libraries-static of dependencies is ignored when linking fully staticallyย #11224

@hasufell

Description

@hasufell

Context

Problem description

When linking executable A fully statically (--enable-executable-static) against a Haskell library B, which has defined extra-libraries-static (either explicitly or implicitly through pkg-config), then this information is not used when linking A.

Illustration:

+ executable A
   - extra-libraries-static       <- respected
   - extra-libraries              <- respected
   + library dependency B
      - extra-libraries-static    <- ignored
      - extra-libraries           <- respected

Reproducer

https://github.com/hasufell/cabal-extra-libraries

Error

This will produce errors as such:

/home/buildozer/aports/main/curl/src/curl-8.14.1/lib/curl_ntlm_core.c:378:0: error:
    (.text+0x1f6): undefined reference to `DES_ecb_encrypt'
/usr/lib/gcc/x86_64-alpine-linux-musl/14.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: /home/buildozer/aports/main/curl/src/curl-8.14.1/lib/curl_ntlm_core.c:382:(.text+0x21b): undefined reference to `DES_ecb_encrypt'
collect2: error: ld returned 1 exit status
ghc-9.6.7: `gcc' failed in phase `Linker'. (Exit code: 1)

Full build log: https://gist.github.com/hasufell/71755429d3c617701e5a2b276cea5524

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions