Index: branches/2018Q1/emulators/rpcs3/Makefile =================================================================== --- branches/2018Q1/emulators/rpcs3/Makefile (revision 464328) +++ branches/2018Q1/emulators/rpcs3/Makefile (revision 464329) @@ -1,84 +1,84 @@ # $FreeBSD$ PORTNAME= rpcs3 DISTVERSIONPREFIX= v -DISTVERSION= 0.0.5-40 -DISTVERSIONSUFFIX= -g7bbadfd08 +DISTVERSION= 0.0.5-54 +DISTVERSIONSUFFIX= -gb8e920873 CATEGORIES= emulators MAINTAINER= jbeich@FreeBSD.org COMMENT= PS3 emulator/debugger LICENSE= BSD3CLAUSE BSL GPLv2 MIT ZLIB LICENSE_COMB= multi LICENSE_FILE_BSD3CLAUSE=${WRKSRC_cereal}/LICENSE LICENSE_FILE_BSL= ${WRKSRC_Optional}/LICENSE LICENSE_FILE_MIT= ${WRKSRC_GSL}/LICENSE LICENSE_FILE_ZLIB= ${WRKSRC_asmjit}/LICENSE.md LIB_DEPENDS= libpng.so:graphics/png \ libavcodec.so:multimedia/ffmpeg ONLY_FOR_ARCHS= amd64 ONLY_FOR_ARCHS_REASON= requires int128 and SSE2 USE_GITHUB= yes GH_ACCOUNT= RPCS3 GH_TUPLE= RPCS3:hidapi:hidapi-0.8.0-rc1-25-gca39ce8:hidapi/3rdparty/hidapi \ RPCS3:yaml-cpp:release-0.5.3-62-g017626a:yamlcpp/Utilities/yaml-cpp \ akrzemi1:Optional:f27e790:Optional/3rdparty/Optional \ kobalicek:asmjit:673dcef:asmjit/asmjit \ Microsoft:GSL:fc5fce4:GSL/3rdparty/GSL \ USCiLab:cereal:v1.2.0:cereal/3rdparty/cereal \ zeux:pugixml:v1.8.1-148-g257fbb4:pugixml/3rdparty/pugixml USES= cmake compiler:c++14-lang iconv:wchar_t localbase:ldflags \ openal:soft pkgconfig USE_GL= gl glew USE_QT5= qmake_build buildtools_build core dbus gui network widgets USE_XORG= x11 EXTRA_PATCHES+= ${EXTRA_PATCHES_${OPSYS}_${OSREL}} EXTRA_PATCHES_FreeBSD_10.3= ${PATCHDIR}/extra-patch-no-thread_local CMAKE_ARGS+= -DCMAKE_SKIP_RPATH=on -DUSE_SYSTEM_LIBPNG=on -DUSE_SYSTEM_FFMPEG=on CMAKE_OFF= USE_NATIVE_INSTRUCTIONS CXXFLAGS+= -D_GLIBCXX_USE_C99 # XXX ports/193528 CXXFLAGS+= -Wno-macro-redefined # __STDC_*_MACROS sys/cdefs.h vs. llvm-config LDFLAGS+= -Wl,--as-needed # GLU MESA_LLVM_VER?= 50 OPTIONS_DEFINE= ALSA EVDEV GDB LLVM PULSEAUDIO VULKAN OPTIONS_DEFAULT=ALSA LLVM VULKAN .if !exists(${.CURDIR:H:H}/graphics/vulkan-sdk) OPTIONS_EXCLUDE=VULKAN # XXX ports/222175 .endif ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib ALSA_RUN_DEPENDS= ${LOCALBASE}/lib/alsa-lib/libasound_module_pcm_oss.so:audio/alsa-plugins ALSA_CMAKE_BOOL= USE_ALSA EVDEV_DESC= libevdev-based joystick support EVDEV_CMAKE_BOOL= USE_LIBEVDEV EVDEV_LIB_DEPENDS= libevdev.so:devel/libevdev GDB_DESC= GDB remote stub (powerpc64 target) GDB_CMAKE_BOOL= WITH_GDB LLVM_DESC= LLVM-based PPU recompiler LLVM_BUILD_DEPENDS= llvm${MESA_LLVM_VER}>0:devel/llvm${MESA_LLVM_VER} LLVM_CMAKE_ON= -DLLVM_DIR:PATH=${LOCALBASE}/llvm${MESA_LLVM_VER}/lib/cmake/llvm LLVM_CMAKE_BOOL_OFF= WITHOUT_LLVM PULSEAUDIO_LIB_DEPENDS= libpulse-simple.so:audio/pulseaudio PULSEAUDIO_CMAKE_BOOL= USE_PULSE VULKAN_DESC= Vulkan renderer VULKAN_BUILD_DEPENDS= ${LOCALBASE}/lib/libglslang.a:devel/glslang VULKAN_LIB_DEPENDS= libvulkan.so:graphics/vulkan-sdk VULKAN_CMAKE_BOOL= USE_VULKAN VULKAN_PREBUILT post-patch: @${REINPLACE_CMD} -e '/GIT_BRANCH/s/unknown/master/' \ -e '/GIT_VERSION/s/unknown/${GH_TAGNAME:C/[^-]*-//}/' \ ${WRKSRC}/${PORTNAME}/git-version.cmake .include Index: branches/2018Q1/emulators/rpcs3/distinfo =================================================================== --- branches/2018Q1/emulators/rpcs3/distinfo (revision 464328) +++ branches/2018Q1/emulators/rpcs3/distinfo (revision 464329) @@ -1,17 +1,17 @@ -TIMESTAMP = 1520613059 -SHA256 (RPCS3-rpcs3-v0.0.5-40-g7bbadfd08_GH0.tar.gz) = 52baba63ba0dcf49eb942f2b68a986ad8557e0f1edabdf9a8ce9675dbb7773b1 -SIZE (RPCS3-rpcs3-v0.0.5-40-g7bbadfd08_GH0.tar.gz) = 4305270 +TIMESTAMP = 1520871412 +SHA256 (RPCS3-rpcs3-v0.0.5-54-gb8e920873_GH0.tar.gz) = 35425eac00c37bf2523eb40d8992a878b58d46c70c28b6e8cab1336a9b806037 +SIZE (RPCS3-rpcs3-v0.0.5-54-gb8e920873_GH0.tar.gz) = 4305546 SHA256 (RPCS3-hidapi-hidapi-0.8.0-rc1-25-gca39ce8_GH0.tar.gz) = e50e4f4e9035e891e16867e995f44aac87ce734a9dde169f02fc9719b2ce3642 SIZE (RPCS3-hidapi-hidapi-0.8.0-rc1-25-gca39ce8_GH0.tar.gz) = 105623 SHA256 (RPCS3-yaml-cpp-release-0.5.3-62-g017626a_GH0.tar.gz) = 1d4b32443f137c23b68d3cb183ba6fb48eb76be2b0b30016970adff5c770d841 SIZE (RPCS3-yaml-cpp-release-0.5.3-62-g017626a_GH0.tar.gz) = 65888 SHA256 (akrzemi1-Optional-f27e790_GH0.tar.gz) = d9f81fa3699b724812994897180365b7ee2fdef1549239d5086722bd4552baf1 SIZE (akrzemi1-Optional-f27e790_GH0.tar.gz) = 16055 SHA256 (kobalicek-asmjit-673dcef_GH0.tar.gz) = 228dd2f422740a1c9e713f1c86934e95d75fc1a8731a88ea006a2cebb033ca8c SIZE (kobalicek-asmjit-673dcef_GH0.tar.gz) = 448118 SHA256 (Microsoft-GSL-fc5fce4_GH0.tar.gz) = 2df1538ff240bf4dd3ef44ba8c832451376fff8e74f7734d32fc8c337557a64d SIZE (Microsoft-GSL-fc5fce4_GH0.tar.gz) = 38809 SHA256 (USCiLab-cereal-v1.2.0_GH0.tar.gz) = 1ccf3ed205a7a2f0d6a060415b123f1ae0d984cd4435db01af8de11a2eda49c1 SIZE (USCiLab-cereal-v1.2.0_GH0.tar.gz) = 299883 SHA256 (zeux-pugixml-v1.8.1-148-g257fbb4_GH0.tar.gz) = 0b37a212bd64ae2336b5f8401e44b0f5f8cb16460e80d1cd9bee1c6acdee0552 SIZE (zeux-pugixml-v1.8.1-148-g257fbb4_GH0.tar.gz) = 539220 Index: branches/2018Q1/emulators/rpcs3/files/extra-patch-no-thread_local =================================================================== --- branches/2018Q1/emulators/rpcs3/files/extra-patch-no-thread_local (revision 464328) +++ branches/2018Q1/emulators/rpcs3/files/extra-patch-no-thread_local (revision 464329) @@ -1,136 +1,156 @@ FreeBSD 10.3 lacks __cxa_thread_atexit, so revert https://github.com/RPCS3/rpcs3/commit/c1450ad61627 +--- rpcs3/Emu/VFS.cpp.orig 2018-03-12 20:29:35 UTC ++++ rpcs3/Emu/VFS.cpp +@@ -18,7 +18,7 @@ bool vfs::mount(const std::string& dev_name, const std + { + const auto table = fxm::get_always(); + +- safe_writer_lock lock(table->mutex); ++ writer_lock lock(table->mutex); + + return table->mounted.emplace(dev_name, path).second; + } +@@ -27,7 +27,7 @@ std::string vfs::get(const std::string& vpath, const s + { + const auto table = fxm::get_always(); + +- safe_reader_lock lock(table->mutex); ++ reader_lock lock(table->mutex); + + std::smatch match; + --- Utilities/Log.cpp.orig 2017-09-19 12:07:07 UTC +++ Utilities/Log.cpp @@ -255,7 +255,7 @@ void logs::message::broadcast(const char* fmt, const f } // Get text - thread_local std::string text; text.clear(); + std::string text; fmt::raw_append(text, fmt, sup, args); std::string prefix = g_tls_log_prefix(); @@ -275,7 +275,7 @@ void logs::message::broadcast(const char* fmt, const f } // Store message additionally - get_logger()->messages.emplace_back(stored_message{*this, stamp, std::move(prefix), text}); + get_logger()->messages.emplace_back(stored_message{*this, stamp, std::move(prefix), std::move(text)}); } } @@ -405,7 +405,7 @@ logs::file_listener::file_listener(const std::string& void logs::file_listener::log(u64 stamp, const logs::message& msg, const std::string& prefix, const std::string& _text) { - thread_local std::string text; + std::string text; text.reserve(prefix.size() + _text.size() + 200); // Used character: U+00B7 (Middle Dot) switch (msg.sev) --- Utilities/mutex.cpp.orig 2017-10-08 20:37:54 UTC +++ Utilities/mutex.cpp @@ -5,8 +5,10 @@ #include #include +#if 0 // TLS variable for tracking owned mutexes thread_local std::vector g_tls_locks; +#endif void shared_mutex::imp_lock_shared(s64 _old) { @@ -258,6 +260,7 @@ bool shared_mutex::try_lock_degrade() return m_value.compare_and_swap_test(0, c_one - c_min); } +#if 0 safe_reader_lock::safe_reader_lock(shared_mutex& mutex) : m_mutex(mutex) , m_is_owned(false) @@ -332,3 +335,4 @@ safe_writer_lock::~safe_writer_lock() // TODO: order locks } +#endif --- Utilities/mutex.h.orig 2017-10-08 20:37:54 UTC +++ Utilities/mutex.h @@ -177,6 +177,7 @@ class writer_lock final (public) } }; +#if 0 // Safe reader lock. Can be recursive above other safe locks (reader or writer). class safe_reader_lock final { @@ -229,3 +230,4 @@ class safe_writer_lock final (public) ~safe_writer_lock(); }; +#endif --- Utilities/types.h.orig 2017-08-24 18:20:18 UTC +++ Utilities/types.h @@ -32,6 +32,7 @@ #define SAFE_BUFFERS #define NEVER_INLINE __attribute__((noinline)) #define FORCE_INLINE __attribute__((always_inline)) inline +#define thread_local __thread #endif #define CHECK_SIZE(type, size) static_assert(sizeof(type) == size, "Invalid " #type " type size") --- rpcs3/Emu/System.cpp.orig 2017-08-24 18:20:18 UTC +++ rpcs3/Emu/System.cpp @@ -797,20 +797,26 @@ void Emulator::Stop() s32 error_code::error_report(const fmt_type_info* sup, u64 arg, const fmt_type_info* sup2, u64 arg2) { - static thread_local std::unordered_map g_tls_error_stats; - static thread_local std::string g_tls_error_str; + static thread_local std::unordered_map* g_tls_error_stats{}; + static thread_local std::string* g_tls_error_str{}; - if (g_tls_error_stats.empty()) + if (!g_tls_error_stats) { + g_tls_error_stats = new std::unordered_map; + g_tls_error_str = new std::string; + thread_ctrl::atexit([] { - for (auto&& pair : g_tls_error_stats) + for (auto&& pair : *g_tls_error_stats) { if (pair.second > 3) { LOG_ERROR(GENERAL, "Stat: %s [x%u]", pair.first, pair.second); } } + + delete g_tls_error_stats; + delete g_tls_error_str; }); } @@ -840,15 +846,15 @@ s32 error_code::error_report(const fmt_type_info* sup, } // Format log message (use preallocated buffer) - g_tls_error_str.clear(); - fmt::append(g_tls_error_str, "'%s' failed with 0x%08x%s%s%s%s", func, arg, sup ? " : " : "", std::make_pair(sup, arg), sup2 ? ", " : "", std::make_pair(sup2, arg2)); + g_tls_error_str->clear(); + fmt::append(*g_tls_error_str, "'%s' failed with 0x%08x%s%s%s%s", func, arg, sup ? " : " : "", std::make_pair(sup, arg), sup2 ? ", " : "", std::make_pair(sup2, arg2)); // Update stats and check log threshold - const auto stat = ++g_tls_error_stats[g_tls_error_str]; + const auto stat = ++(*g_tls_error_stats)[*g_tls_error_str]; if (stat <= 3) { - channel->format(level, "%s [%u]", g_tls_error_str, stat); + channel->format(level, "%s [%u]", *g_tls_error_str, stat); } return static_cast(arg); Index: branches/2018Q1 =================================================================== --- branches/2018Q1 (revision 464328) +++ branches/2018Q1 (revision 464329) Property changes on: branches/2018Q1 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head:r464326