Bug 206542

Summary: games/libretro-cores: fix build with clang 3.8.0
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Dimitry Andric <dim>
Status: Closed FIXED    
Severity: Affects Some People CC: ports-secteam, yuri
Priority: --- Keywords: patch
Version: LatestFlags: yuri: maintainer-feedback+
koobs: merge-quarterly?
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 206074    
Attachments:
Description Flags
Use local asm labels to prevent problems with unrolling koobs: maintainer-approval+

Description Dimitry Andric freebsd_committer freebsd_triage 2016-01-23 22:13:05 UTC
Created attachment 166028 [details]
Use local asm labels to prevent problems with unrolling

During the exp-run in bug 206074, it was found that games/libretro-cores gives errors with a recent clang 3.8.0 snapshot [1]:


mednafen/sound/OwlResampler.cpp:453:39: error: invalid symbol redefinition
"movups  0(%%" X86_REGC "di), %%xmm0\n\t"
                                      ^
<inline asm>:7:2: note: instantiated into assembly here
        SSE_Loop:
        ^

It is exactly the same issue as in bug 206376 (for emulators/mednafen), since this port contains a local copy of mednafen: it uses a named label in an inline function.

Similar to the mednafen patch, this can be fixed by changing the label to a local label ("1:").

[1] http://package18.nyi.freebsd.org/data/headamd64PR206074-default/2016-01-15_15h26m58s/logs/errors/libretro-cores-0.20151110.log
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2016-01-23 22:57:25 UTC
Dimitry,

If you
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2016-01-23 22:58:00 UTC
Dimitry,

Please commit the patch.

Thanks,
Yuri
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-01-23 23:37:32 UTC
A commit references this bug:

Author: dim
Date: Sat Jan 23 23:37:21 UTC 2016
New revision: 407068
URL: https://svnweb.freebsd.org/changeset/ports/407068

Log:
  In the copy of mednafen included in libretro-cores, replace a named
  label in inline assembly in an inline function with a local label.
  This prevents "invalid symbol redefinition" errors when the function is
  inlined multiple times, for example within an unrolled loop.

  Approved by:	yuri@rawbw.com (maintainer)
  PR:		206542

Changes:
  head/games/libretro-cores/files/patch-beetle-pcfx-libretro-mednafen-sound-OwlResampler.cpp
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2016-01-24 00:18:12 UTC
Reporter is Committer, assign accordingly.

Re-open for MFH. Over to @ports-secteam
Comment 5 commit-hook freebsd_committer freebsd_triage 2016-01-24 15:07:43 UTC
A commit references this bug:

Author: feld
Date: Sun Jan 24 15:07:21 UTC 2016
New revision: 407142
URL: https://svnweb.freebsd.org/changeset/ports/407142

Log:
  MFH: r407068

  In the copy of mednafen included in libretro-cores, replace a named
  label in inline assembly in an inline function with a local label.
  This prevents "invalid symbol redefinition" errors when the function is
  inlined multiple times, for example within an unrolled loop.

  Approved by:	yuri@rawbw.com (maintainer)
  PR:		206542

  Approved by:	ports-secteam (with hat)

Changes:
_U  branches/2016Q1/
  branches/2016Q1/games/libretro-cores/files/patch-beetle-pcfx-libretro-mednafen-sound-OwlResampler.cpp