Bug 281906

Summary: emulators/mupen64plus-core: fix build with clang and lld 19
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Jose Alonso Cardenas Marquez <acm>
Status: Closed FIXED    
Severity: Affects Some People Flags: bugzilla: maintainer-feedback? (acm)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 280562    
Attachments:
Description Flags
emulators/mupen64plus-core: fix build with clang and lld 19 none

Description Dimitry Andric freebsd_committer freebsd_triage 2024-10-06 21:40:03 UTC
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.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2024-10-06 21:42:22 UTC
Created attachment 254061 [details]
emulators/mupen64plus-core: fix build with clang and lld 19
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-10-20 10:01:38 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5416735dea6160ac4efb3cd847936a3213ab1502

commit 5416735dea6160ac4efb3cd847936a3213ab1502
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-10-06 21:40:43 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-10-20 10:00:34 +0000

    emulators/mupen64plus-core: fix build with clang and lld 19

    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.

    PR:             281906
    Approved by:    maintainer timeout (2 weeks)
    MFH:            2024Q4

 emulators/mupen64plus-core/Makefile                  |  1 -
 .../files/patch-projects_unix_Makefile (new)         | 20 ++++++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-10-20 10:02:39 UTC
A commit in branch 2024Q4 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=fd6294088c037ae77d6bcd0efa50c585d97c8d08

commit fd6294088c037ae77d6bcd0efa50c585d97c8d08
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-10-06 21:40:43 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-10-20 10:01:20 +0000

    emulators/mupen64plus-core: fix build with clang and lld 19

    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.

    PR:             281906
    Approved by:    maintainer timeout (2 weeks)
    MFH:            2024Q4

    (cherry picked from commit 5416735dea6160ac4efb3cd847936a3213ab1502)

 emulators/mupen64plus-core/Makefile                  |  1 -
 .../files/patch-projects_unix_Makefile (new)         | 20 ++++++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)