Sunday, September 03, 2023

Re: check-lib-depends and modules' *_WANTLIB

On Sun, Sep 03, 2023 at 10:44:51AM +0200, Omar Polo wrote:
> On 2023/09/03 10:32:00 +0200, Omar Polo <op@omarpolo.com> wrote:
> > I considered making the variable more like SUBST_VARS (i.e. just a
> > list of variable names) but then we loose the ability to express -F
> > which can be handy. Or maybe I'm overthinking it.
>
> just as I sent the email I noticed that my cargo.port.mk diff wasn't
> right. Turns out, -F is really needed :-)
>
> with the fixed carg.port.mk diff:
>
> % pwd
> /usr/ports/devel/difftastic
> % make port-lib-depends-check
> [...]
> WANTLIB += ${COMPILER_LIBCXX} ${MODCARGO_WANTLIB} m
> *** Error 1 in target 'port-lib-depends-check' (ignored)
>
>
> Index: cargo.port.mk
> ===================================================================
> RCS file: /home/cvs/ports/devel/cargo/cargo.port.mk,v
> retrieving revision 1.37
> diff -u -p -r1.37 cargo.port.mk
> --- cargo.port.mk 26 Jul 2023 07:56:18 -0000 1.37
> +++ cargo.port.mk 3 Sep 2023 08:41:42 -0000
> @@ -36,6 +36,9 @@ MODCARGO_WANTLIB += c++abi
> MODCARGO_WANTLIB +=
> .endif
>
> +CHECK_LIB_DEPENDS_ARGS += -S MODCARGO_WANTLIB="${MODCARGO_WANTLIB}"
> +CHECK_LIB_DEPENDS_ARGS += -F pthread -F c++abi
> +
> # Define MASTER_SITES_CRATESIO for crates.io
> MASTER_SITES_CRATESIO = https://crates.io/api/v1/crates/
>

cargo.port.mk isn't up to date on your side (1.38 was commited ~16h ago).


Regarding the diff, I am not sure to be fluent enough with check-lib-depends to
properly undertand all implications.

About MODCARGO_WANTLIB, it should be noted that the variable exists because the
content is different accross machine architecture.

The global picture is:
- sparc64 : MODCARGO_WANTLIB = c pthread
- others : MODCARGO_WANTLIB = c pthread c++abi

sparc64 is using unwinding code from libgcc.a (versus c++abi for others).

so if I properly understood check-lib-depends(1) man page:
- -S MODCARGO_WANTLIB="${MODCARGO_WANTLIB}" : is fine
- -F pthread : shouldn't be needed (as pthread will be always part of the actual WANTLIB for a rust binary)
- -F c++abi : is fine, as on sparc64 it could be missing

Thanks.
--
Sebastien Marie

No comments:

Post a Comment