[llvm-bugs] [Bug 45369] New: Missing symbols when llvm is build with LTO

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Mar 31 01:50:49 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=45369

            Bug ID: 45369
           Summary: Missing symbols when llvm is build with LTO
           Product: libraries
           Version: 10.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: kloczko.tomasz at gmail.com
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, spatel+llvm at rotateright.com

I've build my own llvm packages using gcc 10 from Fedora rawhide.
That package is with LTO optimised.

When I've installed my own llvm I found that now I cannot build mesa because
some symbols are missing during linking mesa

[tkloczko at barrel mesa-20.0.2]$ /usr/bin/ninja -v -j1 -C x86_64-redhat-linux-gnu
ninja: Entering directory `x86_64-redhat-linux-gnu'
[1/41] /usr/bin/python3 ../bin/git_sha1_gen.py --output src/git_sha1.h
 [2/15] g++  -o src/amd/vulkan/libvulkan_radeon.so
'src/amd/vulkan/9198681@@vulkan_radeon at sha/meson-generated_.._radv_entrypoints.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/meson-generated_.._radv_extensions.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/meson-generated_.._vk_format_table.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/winsys_amdgpu_radv_amdgpu_bo.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/winsys_amdgpu_radv_amdgpu_cs.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/winsys_amdgpu_radv_amdgpu_surface.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/winsys_amdgpu_radv_amdgpu_winsys.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_android.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_cmd_buffer.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_debug.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_device.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_descriptor_set.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_formats.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_image.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_llvm_helper.cpp.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_blit.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_blit2d.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_buffer.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_bufimage.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_clear.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_copy.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_decompress.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_fast_clear.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_fmask_expand.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_resolve.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_resolve_cs.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_resolve_fs.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_nir_lower_ycbcr_textures.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_nir_to_llvm.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_pass.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_pipeline.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_pipeline_cache.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_shader.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_shader_args.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_shader_info.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_query.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_util.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_wsi.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/si_cmd_buffer.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_wsi_x11.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_wsi_wayland.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_wsi_display.c.o'
-Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,--start-group
-Wl,-soname,libvulkan_radeon.so -O2 -g -pipe -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
-flto=auto -flto-partition=none -Wl,-z,relro -Wl,--as-needed -Wl,-z,now
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none
-fuse-linker-plugin src/amd/common/libamd_common.a
src/amd/llvm/libamd_common_llvm.a src/amd/addrlib/libaddrlib.a
src/vulkan/wsi/libvulkan_wsi.a src/vulkan/util/libvulkan_util.a
src/util/libxmlconfig.a src/util/libmesa_util.a
src/util/format/libmesa_format.a src/amd/compiler/libaco.a
src/compiler/nir/libnir.a src/compiler/libcompiler.a -Wl,-Bsymbolic
-Wl,--gc-sections -lLLVM-10 -pthread /usr/lib64/libdrm_amdgpu.so
/usr/lib64/libelf.so -ldl -lm /usr/lib64/libxcb-dri3.so
/usr/lib64/libwayland-client.so /usr/lib64/libxcb-randr.so
/usr/lib64/libXrandr.so /usr/lib64/libz.so /usr/lib64/libexpat.so -lLLVM-10
/usr/lib64/libxcb.so /usr/lib64/libX11-xcb.so /usr/lib64/libX11.so
/usr/lib64/libxcb-dri2.so /usr/lib64/libxcb-present.so
/usr/lib64/libxcb-sync.so /usr/lib64/libxshmfence.so /usr/lib64/libdrm.so
/usr/lib64/libzstd.so -lLLVM-10 -Wl,--end-group
'-Wl,-rpath,$ORIGIN/../common:$ORIGIN/../llvm:$ORIGIN/../addrlib:$ORIGIN/../../vulkan/wsi:$ORIGIN/../../vulkan/util:$ORIGIN/../../util:$ORIGIN/../../util/format:$ORIGIN/../compiler:$ORIGIN/../../compiler/nir:$ORIGIN/../../compiler'
-Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/mesa-20.0.2/x86_64-redhat-linux-gnu/src/amd/common
-Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/mesa-20.0.2/x86_64-redhat-linux-gnu/src/amd/llvm
-Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/mesa-20.0.2/x86_64-redhat-linux-gnu/src/amd/addrlib
-Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/mesa-20.0.2/x86_64-redhat-linux-gnu/src/vulkan/wsi
-Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/mesa-20.0.2/x86_64-redhat-linux-gnu/src/vulkan/util
-Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/mesa-20.0.2/x86_64-redhat-linux-gnu/src/util
-Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/mesa-20.0.2/x86_64-redhat-linux-gnu/src/util/format
-Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/mesa-20.0.2/x86_64-redhat-linux-gnu/src/amd/compiler
-Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/mesa-20.0.2/x86_64-redhat-linux-gnu/src/compiler/nir
-Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/mesa-20.0.2/x86_64-redhat-linux-gnu/src/compiler
FAILED: src/amd/vulkan/libvulkan_radeon.so
g++  -o src/amd/vulkan/libvulkan_radeon.so
'src/amd/vulkan/9198681@@vulkan_radeon at sha/meson-generated_.._radv_entrypoints.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/meson-generated_.._radv_extensions.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/meson-generated_.._vk_format_table.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/winsys_amdgpu_radv_amdgpu_bo.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/winsys_amdgpu_radv_amdgpu_cs.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/winsys_amdgpu_radv_amdgpu_surface.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/winsys_amdgpu_radv_amdgpu_winsys.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_android.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_cmd_buffer.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_debug.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_device.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_descriptor_set.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_formats.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_image.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_llvm_helper.cpp.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_blit.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_blit2d.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_buffer.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_bufimage.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_clear.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_copy.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_decompress.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_fast_clear.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_fmask_expand.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_resolve.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_resolve_cs.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_meta_resolve_fs.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_nir_lower_ycbcr_textures.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_nir_to_llvm.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_pass.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_pipeline.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_pipeline_cache.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_shader.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_shader_args.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_shader_info.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_query.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_util.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_wsi.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/si_cmd_buffer.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_wsi_x11.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_wsi_wayland.c.o'
'src/amd/vulkan/9198681@@vulkan_radeon at sha/radv_wsi_display.c.o'
-Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,--start-group
-Wl,-soname,libvulkan_radeon.so -O2 -g -pipe -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
-flto=auto -flto-partition=none -Wl,-z,relro -Wl,--as-needed -Wl,-z,now
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none
-fuse-linker-plugin src/amd/common/libamd_common.a
src/amd/llvm/libamd_common_llvm.a src/amd/addrlib/libaddrlib.a
src/vulkan/wsi/libvulkan_wsi.a src/vulkan/util/libvulkan_util.a
src/util/libxmlconfig.a src/util/libmesa_util.a
src/util/format/libmesa_format.a src/amd/compiler/libaco.a
src/compiler/nir/libnir.a src/compiler/libcompiler.a -Wl,-Bsymbolic
-Wl,--gc-sections -lLLVM-10 -pthread /usr/lib64/libdrm_amdgpu.so
/usr/lib64/libelf.so -ldl -lm /usr/lib64/libxcb-dri3.so
/usr/lib64/libwayland-client.so /usr/lib64/libxcb-randr.so
/usr/lib64/libXrandr.so /usr/lib64/libz.so /usr/lib64/libexpat.so -lLLVM-10
/usr/lib64/libxcb.so /usr/lib64/libX11-xcb.so /usr/lib64/libX11.so
/usr/lib64/libxcb-dri2.so /usr/lib64/libxcb-present.so
/usr/lib64/libxcb-sync.so /usr/lib64/libxshmfence.so /usr/lib64/libdrm.so
/usr/lib64/libzstd.so -lLLVM-10 -Wl,--end-group
'-Wl,-rpath,$ORIGIN/../common:$ORIGIN/../llvm:$ORIGIN/../addrlib:$ORIGIN/../../vulkan/wsi:$ORIGIN/../../vulkan/util:$ORIGIN/../../util:$ORIGIN/../../util/format:$ORIGIN/../compiler:$ORIGIN/../../compiler/nir:$ORIGIN/../../compiler'
-Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/mesa-20.0.2/x86_64-redhat-linux-gnu/src/amd/common
-Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/mesa-20.0.2/x86_64-redhat-linux-gnu/src/amd/llvm
-Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/mesa-20.0.2/x86_64-redhat-linux-gnu/src/amd/addrlib
-Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/mesa-20.0.2/x86_64-redhat-linux-gnu/src/vulkan/wsi
-Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/mesa-20.0.2/x86_64-redhat-linux-gnu/src/vulkan/util
-Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/mesa-20.0.2/x86_64-redhat-linux-gnu/src/util
-Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/mesa-20.0.2/x86_64-redhat-linux-gnu/src/util/format
-Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/mesa-20.0.2/x86_64-redhat-linux-gnu/src/amd/compiler
-Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/mesa-20.0.2/x86_64-redhat-linux-gnu/src/compiler/nir
-Wl,-rpath-link,/home/tkloczko/rpmbuild/BUILD/mesa-20.0.2/x86_64-redhat-linux-gnu/src/compiler
../src/amd/addrlib/src/chip/gfx9/gfx9_gb_reg.h:49:12: warning: type ‘struct
<anon>’ violates the C++ One Definition Rule [-Wodr]
   49 |     struct {
      |            ^
../src/amd/addrlib/src/chip/gfx10/gfx10_gb_reg.h:51:5: note: a different type
is defined in another translation unit
   51 |     {
      |     ^
../src/amd/addrlib/src/chip/gfx9/gfx9_gb_reg.h:54:33: note: the first
difference of corresponding definitions is field ‘BANK_INTERLEAVE_SIZE’
   54 |         unsigned int            BANK_INTERLEAVE_SIZE : 3;
      |                                 ^
../src/amd/addrlib/src/chip/gfx10/gfx10_gb_reg.h:56:44: note: a field with
different name is defined in another translation unit
   56 |         unsigned int                       NUM_PKRS  : 3;
      |                                            ^
../src/amd/addrlib/src/chip/gfx9/gfx9_gb_reg.h:48:7: warning: type ‘union
GB_ADDR_CONFIG’ violates the C++ One Definition Rule [-Wodr]
   48 | union GB_ADDR_CONFIG {
      |       ^
../src/amd/addrlib/src/chip/gfx10/gfx10_gb_reg.h:48:7: note: a different type
is defined in another translation unit
   48 | union GB_ADDR_CONFIG
      |       ^
../src/amd/addrlib/src/chip/gfx9/gfx9_gb_reg.h:83:7: note: the first difference
of corresponding definitions is field ‘bitfields’
   83 |     } bitfields, bits;
      |       ^
../src/amd/addrlib/src/chip/gfx10/gfx10_gb_reg.h:65:7: note: a field of same
name but different type is defined in another translation unit
   65 |     } bitfields, bits;
      |       ^
../src/amd/addrlib/src/chip/gfx9/gfx9_gb_reg.h:49:12: note: type ‘struct
<anon>’ itself violates the C++ One Definition Rule
   49 |     struct {
      |            ^
../src/amd/addrlib/src/chip/gfx10/gfx10_gb_reg.h:51:5: note: the incompatible
type is defined here
   51 |     {
      |     ^
/usr/bin/ld: libvulkan_radeon.so.lto.o:(.data.rel.ro+0x180): undefined
reference to `typeinfo for llvm::raw_pwrite_stream'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200331/06f46600/attachment-0001.html>


More information about the llvm-bugs mailing list