Bug 206542 - games/libretro-cores: fix build with clang 3.8.0
Summary: games/libretro-cores: fix build with clang 3.8.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Dimitry Andric
URL:
Keywords: patch
Depends on:
Blocks: 206074
  Show dependency treegraph
 
Reported: 2016-01-23 22:13 UTC by Dimitry Andric
Modified: 2016-03-20 14:17 UTC (History)
2 users (show)

See Also:
yuri: maintainer-feedback+
koobs: merge-quarterly?


Attachments
Use local asm labels to prevent problems with unrolling (2.02 KB, patch)
2016-01-23 22:13 UTC, Dimitry Andric
koobs: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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