Bug 231952 - emulators/rpcs3: clang crashes during build
Summary: emulators/rpcs3: clang crashes during build
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-toolchain (Nobody)
URL: http://beefy12.nyi.freebsd.org/data/h...
Keywords: regression
Depends on:
Blocks:
 
Reported: 2018-10-04 17:38 UTC by Jan Beich
Modified: 2019-08-17 00:49 UTC (History)
3 users (show)

See Also:


Attachments
rpcs3/Emu/Cell/Modules/cellAudio.cpp (compressed, preprocessed) (408.21 KB, application/x-xz)
2018-10-04 17:40 UTC, Jan Beich
no flags Details
command line args (for clang 7) (6.42 KB, text/plain)
2018-10-04 17:41 UTC, Jan Beich
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2018-10-04 17:38:51 UTC
$ poudriere jail -cj head-amd64 -a amd64 -v head -m svn+https
$ poudriere testport -j head-amd64 www/firefox
[...]
/usr/bin/c++  -DGLX_GLXEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES -DHAVE_ALSA -DHAVE_VULKAN -DLLVM_AVAILABLE -DNDEBUG -I/wrkdirs/usr/ports/emulators/rpcs3/work/rpcs3-0.0.5-968-gcc846eb67/rpcs3 -I/wrkdirs/usr/ports/emulators/rpcs3/work/rpcs3-0.0.5-968-gcc846eb67 -I/wrkdirs/usr/ports/emulators/rpcs3/work/rpcs3-0.0.5-968-gcc846eb67/3rdparty/yaml-cpp/include -I/wrkdirs/usr/ports/emulators/rpcs3/work/rpcs3-0.0.5-968-gcc846eb67/3rdparty/pugixml/src -I/wrkdirs/usr/ports/emulators/rpcs3/work/rpcs3-0.0.5-968-gcc846eb67/3rdparty/GSL/include -I/usr/local/include/AL -I/wrkdirs/usr/ports/emulators/rpcs3/work/rpcs3-0.0.5-968-gcc846eb67/3rdparty/stblib -I/wrkdirs/usr/ports/emulators/rpcs3/work/rpcs3-0.0.5-968-gcc846eb67/llvm/include -I3rdparty/llvm_build/include -I/wrkdirs/usr/ports/emulators/rpcs3/work/rpcs3-0.0.5-968-gcc846eb67/asmjitsrc/../asmjit/src -I/wrkdirs/usr/ports/emulators/rpcs3/work/rpcs3-0.0.5-968-gcc846eb67/3rdparty/cereal/include -I/wrkdirs/usr/ports/emulators/rpcs3/work/rpcs3-0.0.5-968-gcc846eb67/3rdparty/GL -I/wrkdirs/usr/ports/emulators/rpcs3/work/rpcs3-0.0.5-968-gcc846eb67/Vulkan/glslang/SPIRV/.. -I/wrkdirs/usr/ports/emulators/rpcs3/work/rpcs3-0.0.5-968-gcc846eb67/Vulkan/glslang/glslang/.. -I/wrkdirs/usr/ports/emulators/rpcs3/work/rpcs3-0.0.5-968-gcc846eb67/3rdparty/xxHash -isystem /usr/local/include -O2 -pipe -fstack-protector -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include -Wno-invalid-pch -fexceptions -Wno-unused-command-line-argument -Wl,--exclude-libs,ALL -O2 -pipe -fstack-protector -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include   -ftemplate-depth=1024 -msse -msse2 -mcx16 -std=gnu++17  -include "/wrkdirs/usr/ports/emulators/rpcs3/work/.build/rpcs3/Emu/cotire/rpcs3_emu_CXX_prefix.hxx" -MD -MT rpcs3/Emu/CMakeFiles/rpcs3_emu.dir/Cell/Modules/cellAudio.cpp.o -MF rpcs3/Emu/CMakeFiles/rpcs3_emu.dir/Cell/Modules/cellAudio.cpp.o.d -o rpcs3/Emu/CMakeFiles/rpcs3_emu.dir/Cell/Modules/cellAudio.cpp.o -c /wrkdirs/usr/ports/emulators/rpcs3/work/rpcs3-0.0.5-968-gcc846eb67/rpcs3/Emu/Cell/Modules/cellAudio.cpp
Assertion failed: (D->getCachedLinkage() == LV.getLinkage()), function getLVForDecl, file /poudriere/jails/head-amd64/usr/src/contrib/llvm/tools/clang/lib/AST/Decl.cpp, line 1422.
c++: error: unable to execute command: Abort trap
c++: error: clang frontend command failed due to signal (use -v to see invocation)
FreeBSD clang version 7.0.0 (tags/RELEASE_700/final 342383) (based on LLVM 7.0.0)
Target: x86_64-unknown-freebsd12.0
Thread model: posix
InstalledDir: /usr/bin
Comment 1 Jan Beich freebsd_committer freebsd_triage 2018-10-04 17:40:37 UTC
Created attachment 197786 [details]
rpcs3/Emu/Cell/Modules/cellAudio.cpp (compressed, preprocessed)
Comment 2 Jan Beich freebsd_committer freebsd_triage 2018-10-04 17:41:13 UTC
Created attachment 197787 [details]
command line args (for clang 7)
Comment 3 Jan Beich freebsd_committer freebsd_triage 2018-10-04 18:07:39 UTC
Clang crashes since https://github.com/RPCS3/rpcs3/commit/1b740995a4b6 Affects at least Clang 8.0.0 (20181001), 7.0.0, 6.0.1 while GCC 8.2.0, 7.3.0 are fine. Earlier versions don't support C++17 required by RPCS3.

Can you help analyze what's wrong with Clang on FreeBSD?
Comment 4 Jan Beich freebsd_committer freebsd_triage 2018-10-04 18:26:30 UTC
Clang 6.0.0 on FreeBSD 11.2 is not affected, see https://ptpb.pw/wO-Z
OTOH, devel/llvm60 does crash on FreeBSD 11.2.
Comment 5 Dimitry Andric freebsd_committer freebsd_triage 2018-10-10 19:18:57 UTC
Reduced and submitted as https://bugs.llvm.org/show_bug.cgi?id=39246
Comment 6 Roman CAT 2018-11-10 04:35:16 UTC
Can be fixed.

Utilites/typemap.h 197

// Type information for each used type
	template <typename T>
	inline const typeinfo<T> g_typeinfo{};

	template <typename T, typename B>
	struct typepoly
	{
		uint type = 0;

		typepoly();
	};

Change to "const typeinfo<T> g_typeinfo{};"
Comment 7 Jan Beich freebsd_committer freebsd_triage 2018-11-10 10:27:22 UTC
(In reply to Roman CAT from comment #6)
Thanks. It built fine on
12.0 (clang 6.0.1): https://ptpb.pw/s4K6
13.0 (clang 7.0.1): https://ptpb.pw/p5hn
Comment 8 commit-hook freebsd_committer freebsd_triage 2018-11-10 10:28:35 UTC
A commit references this bug:

Author: jbeich
Date: Sat Nov 10 10:27:35 UTC 2018
New revision: 484600
URL: https://svnweb.freebsd.org/changeset/ports/484600

Log:
  emulators/rpcs3: unbreak build with clang > 6.0.0

  Assertion failed: (D->getCachedLinkage() == LV.getLinkage()), function getLVForDecl, file /usr/src/contrib/llvm/tools/clang/lib/AST/Decl.cpp, line 1394.

  PR:		231952
  Reported by:	pkg-fallout
  Submitted by:	Roman CAT

Changes:
  head/emulators/rpcs3/files/patch-Utilities_typemap.h
Comment 9 commit-hook freebsd_committer freebsd_triage 2018-11-10 10:29:38 UTC
A commit references this bug:

Author: jbeich
Date: Sat Nov 10 10:28:33 UTC 2018
New revision: 484601
URL: https://svnweb.freebsd.org/changeset/ports/484601

Log:
  MFH: r484600

  emulators/rpcs3: unbreak build with clang > 6.0.0

  Assertion failed: (D->getCachedLinkage() == LV.getLinkage()), function getLVForDecl, file /usr/src/contrib/llvm/tools/clang/lib/AST/Decl.cpp, line 1394.

  PR:		231952
  Reported by:	pkg-fallout
  Submitted by:	Roman CAT
  Approved by:	ports-secteam blanket

Changes:
_U  branches/2018Q4/
  branches/2018Q4/emulators/rpcs3/files/patch-Utilities_typemap.h
Comment 10 Walter Schwarzenfeld freebsd_triage 2019-08-14 17:25:18 UTC
Is this fixed with ports r508936?
Comment 11 Jan Beich freebsd_committer freebsd_triage 2019-08-17 00:48:59 UTC
Obselete after upstream refactoring, so the workaround is gone after ports r509127.