[Bug 275443] graphics/mesa-dri: tries to use devel/elfutils API against base elftoolchain ABI

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 30 Nov 2023 03:20:28 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=275443

            Bug ID: 275443
           Summary: graphics/mesa-dri: tries to use devel/elfutils API
                    against base elftoolchain ABI
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Keywords: regression
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs@FreeBSD.org
          Reporter: jbeich@FreeBSD.org
                CC: cem@freebsd.org, x11@FreeBSD.org
            Blocks: 273803
                CC: cem@freebsd.org, x11@FreeBSD.org

Created attachment 246680
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=246680&action=edit
workaround (prefer elfutils)

Mixing ABIs between different projects with compatible API can lead to
instability or crashes. While -Dlibelf=disabled prevents Meson (pkg-config)
from using devel/elfutils other dependencies add -I/usr/local/include which end
up overriding C preprocessor search order.

  $ pkg install elfutils
  $ echo '#error API trap' >>/usr/local/include/libelf.h
  $ make clean all -C graphics/mesa-dri
  [...]
  FAILED: src/amd/common/libamd_common.a.p/ac_rtld.c.o
  In file included from ../src/amd/common/ac_rtld.c:32:
  In file included from /usr/local/include/gelf.h:32:
  /usr/local/include/libelf.h:523:2: error: API trap
  #error API trap
   ^
  In file included from ../src/amd/common/ac_rtld.c:33:
  /usr/local/include/libelf.h:523:2: error: API trap
  #error API trap
   ^
  2 errors generated.

See also PKG_CONFIG_SYSTEM_INCLUDE_PATH in pkgconf(1) manpage
https://wiki.freebsd.org/WarnerLosh/UsrLocal#Include_paths
https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html


Referenced Bugs:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273803
[Bug 273803] graphics/mesa-dri: mesa-dri is missing a required shared library:
libelf.so.1
-- 
You are receiving this mail because:
You are the assignee for the bug.