On 2023/09/30 10:00, Omar Polo wrote:
> On 2023/09/18 13:07:23 +0100, Stuart Henderson <stu@spacehopper.org> wrote:
> > On 2023/09/18 11:07, Omar Polo wrote:
> > > it uses c++ to build a sub-library (basis-universal) and to link, I
> > > guess that's why c++ ends up in the wantlibs but doesn't link to
> > > c++abi nor pthread... Here's why i'm not using COMPILER_LIBCXX in
> > > WANTLIBs. any clue?
> >
> > no idea about that. since it sets ONLY_FOR_ARCHS to a subset of
> > base-clang archs anyway that won't cause a problem with WANTLIB,
> > at least.
>
> I still can't wrap my head around this.
>
> At first I thought it was due to lto, newly introduced with this
> release, but it isn't the case.
>
> The (only) executable is linked like this: (formatted for readability)
>
> c++ -o src/taisei [...many objects files...] \
> -flto \
> -Wl,--as-needed \
> -Wl,--allow-shlib-undefined -O2 -pipe -g \
> -Wl,--start-group \
[..]
hmm, perhaps the other libs are getting stripped by --as-needed?
> % readelf -d $(make show=WRKBUILD)/src/taisei | grep NEEDED
(this is the list of libraries that need to be in WANTLIB)
> ...while ldd shows libpthread and c++abi too!
picked up via inter-library dependencies.
> looking at LD_DEBUG=1 ./taisei -h shows that libc++abi is loaded via:
that basically provides the same information as ldd.
> ONLY_FOR_ARCHS = amd64 aarch64 i386
..
> +WANTLIB += SDL2 c c++ crypto freetype m opusfile png shaderc_shared
> +WANTLIB += spirv-cross-c-shared webpdecoder z zstd
..
> +COMPILER = base-clang ports-gcc
that WANTLIB will fail on systems that don't have base-clang,
so it might make sense to remove ports-gcc from that list - or
to list ${COMPILER_LIBCXX} anyway and ignore the "Extra" warning
from check-lib-depends.
although, ONLY_FOR_ARCHS only lists base-clang archs anyway,
so in practical terms it won't be hit unless ONLY_FOR_ARCHS is
changed.
No comments:
Post a Comment