Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 631368 - sys-kernel/genkernel: dmraid fails to link to new lvm: pool.c:(.text+0xe4): undefined reference to `pthread_mutex_lock'
Summary: sys-kernel/genkernel: dmraid fails to link to new lvm: pool.c:(.text+0xe4): u...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
: 584784 (view as bug list)
Depends on:
Blocks: 641774
  Show dependency tree
 
Reported: 2017-09-19 05:12 UTC by Anton Kochkov
Modified: 2018-01-10 05:04 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
genkernel full log (genkernel.log,168.06 KB, text/x-log)
2017-09-19 05:12 UTC, Anton Kochkov
Details
emerge --info output (emerge_info.log,4.45 KB, text/x-log)
2017-09-19 05:13 UTC, Anton Kochkov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Kochkov 2017-09-19 05:12:10 UTC
Created attachment 495294 [details]
genkernel full log

gcc -o dmraid.o -c -I -I. -I../include -I../lib -include ../include/config.h -I/var/tmp/genkernel/10299.23831.20912.930363/lvm/include -O2 -fPIC -Wall -Wundef -Wcast-align -Wwrite-strings -Winline -O2 dmraid.c
gcc -o commands.o -c -I -I. -I../include -I../lib -include ../include/config.h -I/var/tmp/genkernel/10299.23831.20912.930363/lvm/include -O2 -fPIC -Wall -Wundef -Wcast-align -Wwrite-strings -Winline -O2 commands.c
gcc -o toollib.o -c -I -I. -I../include -I../lib -include ../include/config.h -I/var/tmp/genkernel/10299.23831.20912.930363/lvm/include -O2 -fPIC -Wall -Wundef -Wcast-align -Wwrite-strings -Winline -O2 toollib.c
gcc -o dmraid dmraid.o commands.o toollib.o -L/var/tmp/genkernel/10299.23831.20912.930363/lvm/lib -static -L../lib -ldmraid -ldevmapper
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info.part.4':
(.text+0x1652): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info_bases':
(.text+0x16d7): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info_table_bases':
(.text+0x17ab): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__deregister_frame_info_bases':
(.text+0x184e): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__deregister_frame_info_bases':
(.text+0x18d6): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `_Unwind_Find_FDE':
(.text+0x19b6): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `_Unwind_Find_FDE':
(.text+0x1a06): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `_Unwind_Find_FDE':
(.text+0x1af0): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info.part.4':
(.text+0x1671): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info_bases':
(.text+0x16f6): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info_table_bases':
(.text+0x17ca): undefined reference to `pthread_mutex_unlock'
/var/tmp/genkernel/10299.23831.20912.930363/lvm/lib/libdevmapper.a(libdm-string.o): In function `dm_size_to_string':
libdm-string.c:(.text+0x1868): undefined reference to `nearbyintl'
libdm-string.c:(.text+0x1885): undefined reference to `floorl'
/var/tmp/genkernel/10299.23831.20912.930363/lvm/lib/libdevmapper.a(pool.o): In function `dm_pool_create':
pool.c:(.text+0xe4): undefined reference to `pthread_mutex_lock'
pool.c:(.text+0x103): undefined reference to `pthread_mutex_unlock'
/var/tmp/genkernel/10299.23831.20912.930363/lvm/lib/libdevmapper.a(pool.o): In function `dm_pool_destroy':
pool.c:(.text+0x19a): undefined reference to `pthread_mutex_lock'
pool.c:(.text+0x1b2): undefined reference to `pthread_mutex_unlock'
/var/tmp/genkernel/10299.23831.20912.930363/lvm/lib/libdevmapper.a(pool.o): In function `dm_pools_check_leaks':
pool.c:(.text+0xdce): undefined reference to `pthread_mutex_lock'
pool.c:(.text+0xdea): undefined reference to `pthread_mutex_unlock'
pool.c:(.text+0xe99): undefined reference to `pthread_mutex_unlock'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:71: dmraid] Error 1
make[1]: Leaving directory '/var/tmp/genkernel/10299.23831.20912.930363/dmraid/1.0.0.rc16-3/dmraid/tools'
make: *** [make.tmpl:120: tools] Error 2
* Gentoo Linux Genkernel; Version 3.5.2.1[0m
* Running with options: all
* Using genkernel.conf from /etc/genkernel.conf
* Sourcing arch-specific config.sh from /usr/share/genkernel/arch/x86_64/config.sh ..
* Sourcing arch-specific modules_load from /usr/share/genkernel/arch/x86_64/modules_load ..
Comment 1 Anton Kochkov 2017-09-19 05:13:33 UTC
Created attachment 495296 [details]
emerge --info output
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2017-09-20 18:29:08 UTC
This is dmraid failing to link to the newer LVM.
Comment 3 Martin Wegner 2017-11-01 07:35:55 UTC
Problem persists with sys-kernel/genkernel-3.5.2.3 for me.
Comment 4 Anton Kochkov 2017-11-17 10:56:49 UTC
Any update on this one?
Comment 5 Adam Stylinski 2017-11-21 21:28:39 UTC
I too am running into this.  Interestingly the version of LVM that genkernel is trying to use, at least at the time of my last sync, is masked - so my actual userland divorced from the ramdisk builds everything just fine.

Obviously it's missing links to pthread and and libm - though I'm not entirely sure if the "correct thing to do" is in this case to force these to link together.  If I'm not mistaken, at one point LVM had stuff patched by statically linked in the genkernel ramdisk for probably a good reason.
Comment 6 Ian Stakenvicius (RETIRED) gentoo-dev 2017-12-20 21:52:54 UTC
When the system dmraid's compiled static against lvm2[-udev] it sets LIBS="-ldevmapper -lm -lrt -lpthread" based on the pkg-config --static output; it makes sense to me that this is what we would need to set when we build dmraid within genkernel as well, right now it's hard-coded to just LIBS="-ldevmapper"
Comment 7 Larry the Git Cow gentoo-dev 2017-12-20 22:54:16 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=10b971c5299a4e4303eab5b594a96636cd234c98

commit 10b971c5299a4e4303eab5b594a96636cd234c98
Author:     Robin H. Johnson <robbat2@gentoo.org>
AuthorDate: 2017-12-20 22:53:16 +0000
Commit:     Robin H. Johnson <robbat2@gentoo.org>
CommitDate: 2017-12-20 22:53:16 +0000

    gen_compile: fix dmraid lvm linking
    
    This will hopefully fix dmraid linking against newer LVM.
    
    Bug: https://bugs.gentoo.org/631368
    Suggested-by: Ian Stakenvicius <axs@gentoo.org>
    Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>

 gen_compile.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)}
Comment 8 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2017-12-20 22:54:57 UTC
@axs: thanks for that catch. Hopefully commit 10b971c captures that correctly.

Can somebody with a dmraid system please test, and then we can close this bug out.
Comment 9 Adam Stylinski 2017-12-23 16:28:01 UTC
My bad, I should have subscribed to this bug.  I am not in town right now but when I get back I can test a new genkernel initrd with this dmraid to see if it builds (and subsequently boots).  I should be back before the new year.
Comment 10 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2017-12-25 07:02:19 UTC
*** Bug 584784 has been marked as a duplicate of this bug. ***
Comment 11 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2017-12-25 07:10:44 UTC
Released in 3.5.2.5 for testing.
Comment 12 Anton Kochkov 2018-01-10 05:04:07 UTC
This one solved, but a new one appeared: https://bugs.gentoo.org/644094