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

Build fails with --enable-static_link #45

Closed
shuber2 opened this issue Jan 28, 2021 · 1 comment
Closed

Build fails with --enable-static_link #45

shuber2 opened this issue Jan 28, 2021 · 1 comment

Comments

@shuber2
Copy link

shuber2 commented Jan 28, 2021

Build with --enable-static_link fails due to undefined references:

$ ./configure --enable-static_link
[...]
$ make
[...]
    [CC] dmsetup.static
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__register_frame_info_bases.part.0':
(.text+0x1678): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__register_frame_info_table_bases':
(.text+0x1778): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__deregister_frame_info_bases':
(.text+0x182e): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x187a): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x18fd): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `_Unwind_Find_FDE':
(.text+0x1a2c): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x1b58): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x1b99): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__register_frame_info_bases.part.0':
(.text+0x16ab): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__register_frame_info_table_bases':
(.text+0x17ab): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: ../../libdm/ioctl/libdevmapper.a(libdm-stats.o): in function `_build_histogram_arg':
libdm-stats.c:(.text+0x3a0): undefined reference to `log10'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: libdm-stats.c:(.text+0x3a5): undefined reference to `lround'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: ../../libdm/ioctl/libdevmapper.a(libdm-stats.o): in function `_stats_group_tag_len.isra.0':
libdm-stats.c:(.text+0x201c): undefined reference to `log10'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: libdm-stats.c:(.text+0x206a): undefined reference to `log10'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: ../../libdm/ioctl/libdevmapper.a(libdm-string.o): in function `dm_size_to_string':
libdm-string.c:(.text+0x1174): undefined reference to `nearbyint'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: ../../libdm/ioctl/libdevmapper.a(pool.o): in function `dm_pool_create':
pool.c:(.text+0xf5): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: pool.c:(.text+0x110): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: ../../libdm/ioctl/libdevmapper.a(pool.o): in function `dm_pool_destroy':
pool.c:(.text+0x189): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: pool.c:(.text+0x19d): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: ../../libdm/ioctl/libdevmapper.a(pool.o): in function `dm_pools_check_leaks':
pool.c:(.text+0x5f2): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: pool.c:(.text+0x68a): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: pool.c:(.text+0x6d2): undefined reference to `pthread_mutex_unlock'
collect2: error: ld returned 1 exit status

There is a related bug tracked at Gentoo: https://bugs.gentoo.org/762017

After a quick look it seems that the lvm.static target, for instance, misses -lrt and -lcap, but I have not investigated further.

@zkabelac
Copy link
Contributor

Upsteam 2.03. main HEAD has been updated to handle things better.

Although it should be generally noted - lvm2 does not test or actively develop for static building - lot of distros do not provide corresponding static libraries - and with systemd-udevd it's actually even questinably how that could even work (in this case you probably need to build lvm2 without udev)

Anyway some problems have been fixed - so if you find new problem - open new issue please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants