Description of problem: Impossible to build lvm2 with llvm/clang/lld 8.0.0 Version-Release number of selected component (if applicable): 2.02..183 Steps to Reproduce: Try to build using CC=clang (clang being compiled to use ld.lld by default) Actual results: Fails with: [CC] ioctl/libdevmapper.so.1.02 ld.lld: error: duplicate symbol 'dm_bitset_parse_list' in version script ld.lld: error: duplicate symbol 'dm_stats_create_region' in version script clang-8: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [../make.tmpl:469: ioctl/libdevmapper.so.1.02] Error 1 make[1]: Leaving directory '/usr/src/vanilla/core/lvm2/LVM2.2.02.183/libdm' make: *** [make.tmpl:356: libdm.device-mapper] Error 2
No aware of any issues so far. Using clang-8.0.0-3.fc31.x86_64 and compiling current git stable-2.02 branch 2.02.186(2)-git (2019-05-13) works for me just fine (aka 'make CC=clang' passed) So can we get more logs ? What do I need for better reproduction ?
I think you have used the default linker. Your fedora uses GNU binutils ld while in my report I've reported that the linker is lld (from LLVM) so CC=clang was not sufficient. My bad I've not mentioned that my clang is built to use lld by default rather than binutils. I don't have a machine to test right now but maybe you can try something like: make CC=clang CFLAGS="-fuse-ld=lld" or LDFLAGS="-fuse-ld=lld" maybe? Cheers
Ok - I guess patch like this fixes the issue for this moment. It's not completely nice - but gives you workable building tree. diff --git a/libdm/.exported_symbols.DM_1_02_107 b/libdm/.exported_symbols.DM_1_02_107 index 89d3464ac..258883c14 100644 --- a/libdm/.exported_symbols.DM_1_02_107 +++ b/libdm/.exported_symbols.DM_1_02_107 @@ -9,7 +9,6 @@ dm_histogram_get_bin_width dm_histogram_get_nr_bins dm_histogram_get_sum dm_histogram_to_string -dm_stats_create_region dm_stats_driver_supports_histogram dm_stats_get_histogram dm_stats_get_region_nr_histogram_bins diff --git a/libdm/.exported_symbols.DM_1_02_129 b/libdm/.exported_symbols.DM_1_02_129 index 88d3f1b6b..6ae173a83 100644 --- a/libdm/.exported_symbols.DM_1_02_129 +++ b/libdm/.exported_symbols.DM_1_02_129 @@ -1,4 +1,3 @@ -dm_bitset_parse_list dm_stats_create_group dm_stats_current_object_type dm_stats_delete_group --
See https://reviews.llvm.org/D64549 I think this is a bug (duplicate version assignments) in lvm2, though ld.bfd doesn't warn. In the generated lvm2/libdm/.export.sym DM_1_02_138 { global: ... dm_bitset_parse_list; ... }; DM_1_02_129 { global: ... dm_bitset_parse_list; ... }; // dm_bitset_parse_list should be removed from the list D64549 will be included in lld 9.0.0 . It will give a friendly warning.
Thanks it works fine with that patch. But just curious, why do you think it is not nice as proposed?
fixed? if so, what version?