[Bug 281906] emulators/mupen64plus-core: fix build with clang and lld 19

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 06 Oct 2024 21:40:03 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281906

            Bug ID: 281906
           Summary: emulators/mupen64plus-core: fix build with clang and
                    lld 19
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: acm@FreeBSD.org
          Reporter: dim@FreeBSD.org
             Flags: maintainer-feedback?(acm@FreeBSD.org)
          Assignee: acm@FreeBSD.org

lld 19 has become more strict about 32-bit relocations that require PIC,
resulting in link errors when building emulators/mupen64plus-core:

      LD  libmupen64plus.so.2.0.0
  ld: error: relocation R_386_32 cannot be used against symbol
'__gxx_personality_v0'; recompile with -fPIC
  >>> defined in /usr/lib/libcxxrt.so
  >>> referenced by oglft_c.cpp
  >>>               _obj/osd/oglft_c.o:(.eh_frame+0xFA63)

  ld: error: relocation R_386_32 cannot be used against local symbol; recompile
with -fPIC
  >>> defined in _obj/osd/oglft_c.o
  >>> referenced by oglft_c.cpp
  >>>               _obj/osd/oglft_c.o:(.eh_frame+0xFA81)

  ld: error: relocation R_386_32 cannot be used against local symbol; recompile
with -fPIC
  >>> defined in _obj/osd/oglft_c.o
  >>> referenced by oglft_c.cpp
  >>>               _obj/osd/oglft_c.o:(.eh_frame+0xFAB1)

  ld: error: relocation R_386_32 cannot be used against local symbol; recompile
with -fPIC
  >>> defined in _obj/osd/oglft_c.o
  >>> referenced by oglft_c.cpp
  >>>               _obj/osd/oglft_c.o:(.eh_frame+0xFAE1)

  [...more of these...]

Make it compile with -fPIC even on i386, by adjusting the PIC make
variable. This also removes the need to use -Wl,-znotext as a workaround.

-- 
You are receiving this mail because:
You are the assignee for the bug.