Skip to content
  • Ilya Leoshkevich's avatar
    550c6d97
    meson: Disable libdw for static builds by default · 550c6d97
    Ilya Leoshkevich authored
    
    
    Static QEMU build fails on Debian Bullseye:
    
        /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libdw.a(debuginfod-client.o): in function `__libdwfl_debuginfod_init':
        (.text.startup+0x17): undefined reference to `dlopen'
    
    The reason is that pkg-config does not suggest -ldl for libdw, and
    adding --extra-ldflags="-ldl" resolves the issue. However, static
    linking with libdw is an unclear topic:
    
    * Linux perf does it.
    * Debian's libdw-dev description says:
    
          Only link to the static version for special cases and when you
          don't need anything from the ebl backends.
    
    * As the error message above indicates, -ldl is also needed for
      debuginfod support.
    
    The functionality provided by libdw is needed for analyzing performance
    of JITed code, which is mostly useful to developers and researchers.
    Therefore, in order to avoid unpleasant surprises for people who don't
    need this, simply disable libdw for static builds by default. It can
    still be enabled explicitly if needed.
    
    Reported-by: default avatarJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
    Signed-off-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
    Message-Id: <20230210005208.438142-2-iii@linux.ibm.com>
    Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
    550c6d97
    meson: Disable libdw for static builds by default
    Ilya Leoshkevich authored
    
    
    Static QEMU build fails on Debian Bullseye:
    
        /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libdw.a(debuginfod-client.o): in function `__libdwfl_debuginfod_init':
        (.text.startup+0x17): undefined reference to `dlopen'
    
    The reason is that pkg-config does not suggest -ldl for libdw, and
    adding --extra-ldflags="-ldl" resolves the issue. However, static
    linking with libdw is an unclear topic:
    
    * Linux perf does it.
    * Debian's libdw-dev description says:
    
          Only link to the static version for special cases and when you
          don't need anything from the ebl backends.
    
    * As the error message above indicates, -ldl is also needed for
      debuginfod support.
    
    The functionality provided by libdw is needed for analyzing performance
    of JITed code, which is mostly useful to developers and researchers.
    Therefore, in order to avoid unpleasant surprises for people who don't
    need this, simply disable libdw for static builds by default. It can
    still be enabled explicitly if needed.
    
    Reported-by: default avatarJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
    Signed-off-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
    Message-Id: <20230210005208.438142-2-iii@linux.ibm.com>
    Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
Loading