Hi,

I noticed that the FreeBSD version of the nss plugin misses the
'nss_module_register' symbol (which makes the plugin fail to register).

$ build/tools/nss/libnss_libvirt_impl.a

libvirt_nss.c.o:
0000000000000000 r .L.str
0000000000000020 r .L.str.1
0000000000000028 r .L.str.2
                 U __error
                 U __h_errno
                 U __stack_chk_fail
                 U __stack_chk_guard
0000000000000750 T _nss_libvirt_gethostbyname2_r
0000000000000040 T _nss_libvirt_gethostbyname3_r
0000000000000000 T _nss_libvirt_gethostbyname_r
                 U asprintf
                 U closedir
                 U findLeases
                 U free
0000000000000780 t leaseAddressSorter
                 U memcpy
                 U opendir
                 U qsort
                 U readdir
                 U realloc
                 U strcmp
                 U strlen
                 U time
libvirt_nss_leases.c.o:
0000000000000000 r .L.str
000000000000000c r .L.str.1
0000000000000017 r .L.str.2
0000000000000023 r .L.str.3
                 U __stack_chk_fail
                 U __stack_chk_guard
                 U close
0000000000000000 T findLeases
00000000000006e0 t findLeasesParserEndArray
0000000000000400 t findLeasesParserEndMap
0000000000000260 t findLeasesParserInteger
00000000000003c0 t findLeasesParserMapKey
00000000000006c0 t findLeasesParserStartArray
0000000000000380 t findLeasesParserStartMap
00000000000002b0 t findLeasesParserString
                 U free
                 U freeaddrinfo
                 U getaddrinfo
                 U memcpy
                 U open
                 U read
                 U realloc
                 U strcmp
                 U strndup
                 U yajl_alloc
                 U yajl_complete_parse
                 U yajl_free
                 U yajl_free_error
                 U yajl_get_error
                 U yajl_parse
$ nm build/tools/nss/96b7fa1@@nss_libvirt_impl@sta/libvirt_nss.c.o
0000000000000000 r .L.str
0000000000000020 r .L.str.1
0000000000000028 r .L.str.2
                 U __error
                 U __h_errno
                 U __stack_chk_fail
                 U __stack_chk_guard
0000000000000750 T _nss_libvirt_gethostbyname2_r
0000000000000040 T _nss_libvirt_gethostbyname3_r
0000000000000000 T _nss_libvirt_gethostbyname_r
                 U asprintf
                 U closedir
                 U findLeases
                 U free
0000000000000780 t leaseAddressSorter
                 U memcpy
                 U opendir
                 U qsort
                 U readdir
                 U realloc
                 U strcmp
                 U strlen
                 U time


$ nm build/tools/nss/nss_libvirt.so.1
0000000000004098 d _DYNAMIC
                 w _Jv_RegisterClasses
0000000000004018 d __CTOR_END__
0000000000004010 d __CTOR_LIST__
0000000000004028 d __DTOR_END__
0000000000004020 d __DTOR_LIST__
0000000000004030 d __JCR_LIST__
0000000000004030 d __JCR_LIST__
                 w __cxa_finalize
0000000000002df0 t __do_global_ctors_aux
0000000000001ee0 t __do_global_dtors_aux
0000000000005358 d __dso_handle
                 U __error
                 U __h_errno
                 U __stack_chk_fail
                 U __stack_chk_guard
0000000000002e2c t _fini
0000000000002e1c t _init
00000000000026b0 t _nss_libvirt_gethostbyname2_r
0000000000001fa0 t _nss_libvirt_gethostbyname3_r
0000000000001f60 t _nss_libvirt_gethostbyname_r
                 U asprintf
                 U close
                 U closedir
00000000000026f0 t findLeases
0000000000002dd0 t findLeasesParserEndArray
0000000000002af0 t findLeasesParserEndMap
0000000000002950 t findLeasesParserInteger
0000000000002ab0 t findLeasesParserMapKey
0000000000002db0 t findLeasesParserStartArray
0000000000002a70 t findLeasesParserStartMap
00000000000029a0 t findLeasesParserString
                 U free
                 U freeaddrinfo
                 U getaddrinfo
00000000000026e0 t leaseAddressSorter
                 U memcpy
                 U open
                 U opendir
                 U qsort
                 U read
                 U readdir
                 U realloc
0000000000001f30 t register_classes
                 U strcmp
                 U strlen
                 U strndup
                 U time
                 U yajl_alloc
                 U yajl_complete_parse
                 U yajl_free
                 U yajl_free_error
                 U yajl_get_error
                 U yajl_parse

WITH_BSD_NSS value is properly set:

$ grep WITH_BSD_NSS build/meson-config.h
#define WITH_BSD_NSS 1
$

Related build commands:

[526/1087] ccache cc -Itools/nss/96b7fa1@@nss_libvirt_impl@sta
-Itools/nss -I../tools/nss -Iinclude -I../include -Isrc -I../src
-Isrc/util -I../src/util -I. -I.. -I/usr/local/include/libxml2
-I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include
-I/usr/local/include -Xclang -fcolor-diagnostics -pipe
-D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu99 -O2 -g
-Werror -fno-common -W
<skip the rest of -W flags>
 -fexceptions -fasynchronous-unwind-tables -fstack-protector-strong 
-Wdouble-promotion -Wno-unused-function -fPIC -pthread -DLIBVIRT_NSS -MD -MQ 
'tools/nss/96b7fa1@@nss_libvirt_impl@sta/libvirt_nss.c.o' -MF 
'tools/nss/96b7fa1@@nss_libvirt_impl@sta/libvirt_nss.c.o.d' -o 
'tools/nss/96b7fa1@@nss_libvirt_impl@sta/libvirt_nss.c.o' -c 
../tools/nss/libvirt_nss.c

[540/1087] cc  -o tools/nss/nss_libvirt.so.1  -Wl,--as-needed 
-Wl,--allow-shlib-undefined -shared -fPIC -Wl,--start-group 
-Wl,-soname,nss_libvirt.so.1 -Wl,--whole-archive 
tools/nss/libnss_libvirt_impl.a -Wl,--no-whole-archive -lkvm -lutil 
-Wl,--version-script=/usr/home/novel/code/libvirt/tools/nss/libvirt_nss_bsd.syms
 -Wl,-export-dynamic -Wl,-z,relro -Wl,-z,now -Wl,--no-copy-dt-needed-entries 
-Wl,-z,defs /usr/local/lib/libxml2.so /usr/local/lib/libglib-2.0.so 
/usr/local/lib/libintl.so /usr/local/lib/libgobject-2.0.so 
/usr/local/lib/libgio-2.0.so /usr/local/lib/libyajl.so -Wl,--end-group
[541/1087] cc  -o tools/virt-admin 
'tools/f9d35d4@@virt-admin@exe/virt-admin.c.o' 
'tools/f9d35d4@@virt-admin@exe/virt-admin-completer.c.o' -Wl,--as-needed 
-Wl,--no-undefined -pie -Wl,--start-group -lkvm -lutil 
src/libvirt-admin.so.0.6007.0 tools/libvirt_shell.a src/libvirt.so.0.6007.0 
-Wl,-z,relro -Wl,-z,now -Wl,--no-copy-dt-needed-entries -Wl,-z,defs 
/usr/local/lib/libxml2.so /usr/local/lib/libglib-2.0.so 
/usr/local/lib/libintl.so /usr/local/lib/libgobject-2.0.so 
/usr/local/lib/libgio-2.0.so /usr/local/lib/libreadline.so -Wl,--end-group 
-Wl,-z,relro -Wl,-z,now -Wl,--no-copy-dt-needed-entries -Wl,-z,defs 
'-Wl,-rpath,$ORIGIN/../src:$ORIGIN/' 
-Wl,-rpath-link,/usr/home/novel/code/libvirt/build/src 
-Wl,-rpath-link,/usr/home/novel/code/libvirt/build/tools
[542/1087] cc  -o tools/nss/nss_libvirt_guest.so.1  -Wl,--as-needed 
-Wl,--no-undefined -shared -fPIC -Wl,--start-group 
-Wl,-soname,nss_libvirt_guest.so.1 -Wl,--whole-archive 
tools/nss/libnss_libvirt_guest_impl.a -Wl,--no-whole-archive -lkvm -lutil 
-Wl,--version-script=/usr/home/novel/code/libvirt/tools/nss/libvirt_nss_bsd.syms
 -Wl,-export-dynamic -Wl,-z,relro -Wl,-z,now -Wl,--no-copy-dt-needed-entries 
-Wl,-z,defs /usr/local/lib/libxml2.so /usr/local/lib/libglib-2.0.so 
/usr/local/lib/libintl.so /usr/local/lib/libgobject-2.0.so 
/usr/local/lib/libgio-2.0.so /usr/local/lib/libyajl.so -Wl,--end-group

Any pointers how to debug that?

Roman Bogorodskiy

Attachment: signature.asc
Description: PGP signature

Reply via email to