Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unresolved external: lyd_free_meta_single (but no other) with shared lib #2278

Open
capiman opened this issue Aug 5, 2024 · 1 comment
Open
Labels
is:question Issue is actually a question.

Comments

@capiman
Copy link

capiman commented Aug 5, 2024

I am trying to compile rousette (in an yocto environment, cross-compiling). Meanwhile a lot progress, but 1 link error remains:

lyd_free_meta_single is reported as unresolved

| /builds/xxx/imagebuilder2-imx8mp/build/tmp-ampliphy-xxx/work/cortexa53-crypto-phytec-linux/rousette/1.0.0/recipe-sysroot-native/usr/bin/aarch64-phytec-linux/../../libexec/aarch64-phytec-linux/gcc/aarch64-phytec-linux/13.3.0/ld: /builds/xxx/imagebuilder2-imx8mp/build/tmp-ampliphy-xxx/work/cortexa53-crypto-phytec-linux/rousette/1.0.0/recipe-sysroot/usr/lib/libsysrepo-cpp.so: undefined reference to symbol 'lyd_free_meta_single'
| /builds/xxx/imagebuilder2-imx8mp/build/tmp-ampliphy-xxx/work/cortexa53-crypto-phytec-linux/rousette/1.0.0/recipe-sysroot-native/usr/bin/aarch64-phytec-linux/../../libexec/aarch64-phytec-linux/gcc/aarch64-phytec-linux/13.3.0/ld: /builds/xxx/imagebuilder2-imx8mp/build/tmp-ampliphy-xxx/work/cortexa53-crypto-phytec-linux/rousette/1.0.0/recipe-sysroot/usr/lib/libyang.so.3: error adding symbols: DSO missing from command line
| collect2: error: ld returned 1 exit status

Why only this and none of the other symbols?

Any idea what it could be?

I tried already latest master, as well as latest from develop, but error remains.

@jktjkt
Copy link
Contributor

jktjkt commented Aug 5, 2024

This isn't a bug in libyang. (And just FYI, we're regularly doing cross-builds of libyang, libyang-cpp and rousette for 32bit ARM in our internal CI, and I've never seen this.)

The error means that the linker cannot find that symbol in libsysrepo-cpp.so, and it's hinting to you that it's available in libyang.so.3. That sound correct; the symbol is indeed provided by libyang (the C library), then it's wrapped by a class method (libyang::MetaCollection::erase) in libyang-cpp (the C++ wrapper), and it looks like it's only used in rousette's src/sr/AllEvents.cpp (at two places in that file). There's no place in sysrepo-cpp where that symbol is used AFAICT. Now, the CMake rules for rousette produce a static library rousette-sysrepo which "publicly uses" (that's my wording of a CMake concept) both sysrepo-cpp and libyang-cpp, so I do not see any error in there.

  • Can you please explicitly confirm that there's no build state whatsoever from some previous build attempts present at the system?
    • No stray libraries anywhere in your path, etc?
    • No reused build directories?
  • Do you see that symbol as provided in your:
    • libyang.so.X
    • libyang-cpp.so
    • sysrepo.so.X
    • in sysrepo-cpp.so?
    • Is it provided or used?
  • What are your exact compiler and CMake versions?
  • What versions (as in specific git commit hashes) of libyang, libyang-cpp, sysrepo, sysrepo-cpp and rousette are you building?

@michalvasko michalvasko added the is:question Issue is actually a question. label Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is:question Issue is actually a question.
Projects
None yet
Development

No branches or pull requests

3 participants