On Wednesday, January 7th, 2026 at 12:21 PM, Martin Wilck <[email protected]> 
wrote:
>
> On Wed, 2026-01-07 at 12:09 +0000, Michal Rostecki wrote:
> 
> > dm_get_multipath() is a static function, not a symbol that can be
> > exported. Clang is strict about not allowing undefined symbols in
> > linker
> > scripts and therefore its presence prevents clang from building
> > libmultipath.
> > 
> > Fixes: https://github.com/opensvc/multipath-tools/issues/132
> > Fixes: bf3a4ad ("libmultipath: simplify dm_get_maps()")
> > Signed-off-by: Michal Rostecki [email protected]
> 
> 
> Thanks!
> 
> Reviewed-by: Martin Wilck [email protected]
> 
> 
> Yet I'm wondering which compiler version you use, or if you use any
> non-standard compilation options. Our CI compiles multipath-tools with
> MANY different versions of clang, but never encountered this problem.

I'm glad you asked - after reading your email I tried using different
linkers and it looks like it's a linker error and it's thrown only by
lld. lld enabled --no-undefined-version as a default option.[0] Choice
of a compiler (gcc, clang) shouldn't matter.

I'm using clang 21.1.7 on Gentoo on musl-llvm profile, which uses full
LLVM toolchain (clang + compiler-rt + libunwind + lld, also in 21.1.7
version) system-wide, so that's why I've seen the error without
providing any additional flags.

>From what I see, no other linker enables that by default and I've been
able to build the current master without errors with bfd and mold:

$ make LDFLAGS="-fuse-ld=bfd"
$ make LDFLAGS="-fuse-ld=mold"

One can reproduce the error on any system by specifying lld explicitly:

$ make LDFLAGS="-fuse-ld=lld"

Or by passing --no-undefined-version (and making the warning fatal),
which throws an error wyth any linker:

$ make LDFLAGS="-fuse-ld=mold -Wl,--no-undefined-version -Wl,--fatal-warnings". 

I will send v2 with a more accurate commit message.

[0] https://reviews.llvm.org/D135402

> Martin
> 
> > ---
> > libmultipath/libmultipath.version | 1 -
> > 1 file changed, 1 deletion(-)
> > 
> > diff --git a/libmultipath/libmultipath.version
> > b/libmultipath/libmultipath.version
> > index 89ae2a3c..5017a54d 100644
> > --- a/libmultipath/libmultipath.version
> > +++ b/libmultipath/libmultipath.version
> > @@ -85,7 +85,6 @@ global:
> > dm_geteventnr;
> > dm_get_major_minor;
> > dm_get_maps;
> > - dm_get_multipath;
> > dm_is_mpath;
> > dm_mapname;
> > dm_prereq;

Reply via email to