-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Miscellaneous portability fixes #7772
Conversation
OSX has built fine for a long time, I guess it's a bit more different from BSD than expected... I'll review tomorrow. |
Mainly to keep my sanity if a regression pops up. GitHub: hrydgard/native#271 (merged), hrydgard/ppsspp#7772 git-svn-id: svn+ssh://svn.freebsd.org/ports/head@387452 35697150-7ecd-e111-bb59-0022644237b5
Mainly to keep my sanity if a regression pops up. GitHub: hrydgard/native#271 (merged), hrydgard/ppsspp#7772
@@ -21,7 +21,11 @@ if(CMAKE_SYSTEM_PROCESSOR) | |||
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^armv7") | |||
set(ARMV7 ON) | |||
endif() | |||
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^x86" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "i.86") | |||
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^amd64") | |||
set(X86 ON) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, are both of these elseifs needed?
-[Unknown]
Squashing fixups is not necessary, although I don't mind if you do either. Hm, lots of warnings for unused parameters. Might be good to add -Wunused-parameter to the cmake files as I don't think we'll fix all those anytime soon, not sure we even want to. |
Common/ColorConv.cpp:199:33: error: use of undeclared identifier '_mm_packus_epi32'; did you mean '_mm_packs_epi32'? _mm_store_si128(&dstp[i / 2], _mm_packus_epi32(c1, c2)); ^~~~~~~~~~~~~~~~ _mm_packs_epi32 /usr/bin/../lib/clang/3.6.0/include/emmintrin.h:1254:1: note: '_mm_packs_epi32' declared here _mm_packs_epi32(__m128i __a, __m128i __b) ^ Common/ColorConv.cpp:241:33: error: use of undeclared identifier '_mm_packus_epi32'; did you mean '_mm_packs_epi32'? _mm_store_si128(&dstp[i / 2], _mm_packus_epi32(c1, c2)); ^~~~~~~~~~~~~~~~ _mm_packs_epi32 /usr/bin/../lib/clang/3.6.0/include/emmintrin.h:1254:1: note: '_mm_packs_epi32' declared here _mm_packs_epi32(__m128i __a, __m128i __b) ^ 2 errors generated. GPU/Common/TextureScalerCommon.cpp:294:6: error: unknown type name '__m128' __m128 result = _mm_set1_ps(0.0f); ^ GPU/Common/TextureScalerCommon.cpp:294:22: error: use of undeclared identifier '_mm_set1_ps' __m128 result = _mm_set1_ps(0.0f); ^ GPU/Common/TextureScalerCommon.cpp:305:9: error: unknown type name '__m128i' __m128i samp... ^ GPU/Common/TextureScalerCommon.cpp:305:26: error: use of undeclared identifier '_mm_cvtsi32_si128' ...__m128i sample = _mm_cvtsi32_si128(data[csy*w + csx]); ^ GPU/Common/TextureScalerCommon.cpp:307:9: error: unknown type name '__m128' __m128 col ... ^ GPU/Common/TextureScalerCommon.cpp:308:31: error: use of undeclared identifier '_mm_set1_ps' ...col = _mm_mul_ps(col, _mm_set1_ps(weight)); ^ GPU/Common/TextureScalerCommon.cpp:314:6: error: unknown type name '__m128i' __m128i pixel = _mm_cvtps_epi32(_mm_... ^ GPU/Common/TextureScalerCommon.cpp:314:57: error: use of undeclared identifier '_mm_set1_ps' ...__m128i pixel = _mm_cvtps_epi32(_mm_mul_ps(result, _mm_set1_ps(bicubicInvSum... ^ 8 errors generated.
Core/MIPS/fake/FakeJit.cpp:141:46: error: unknown type name 'FakeJitBlock'; did you mean 'JitBlock'? const u8 *FakeJit::DoFakeJit(u32 em_address, FakeJitBlock *b) ^~~~~~~~~~~~ JitBlock Core/MIPS/JitCommon/JitBlockCache.h:59:8: note: 'JitBlock' declared here struct JitBlock { ^ Core/MIPS/fake/FakeJit.cpp:141:20: error: out-of-line definition of 'DoFakeJit' does not match any declaration in 'MIPSComp::FakeJit' const u8 *FakeJit::DoFakeJit(u32 em_address, FakeJitBlock *b) ^~~~~~~~~ Core/HLE/ReplaceTables.cpp:1044:29: error: use of undeclared identifier 'JITFUNC' { "fabsf", &Replace_fabsf, JITFUNC(Replace_fabsf), REPFLAG_ALLOWINLI... ^ Core/HLE/ReplaceTables.cpp:1101:27: error: invalid application of 'sizeof' to an incomplete type 'const ReplacementTableEntry []' for (int i = 0; i < (int)ARRAY_SIZE(entries); i++) { ^~~~~~~~~~~~~~~~~~~ native/math/../base/basictypes.h:67:30: note: expanded from macro 'ARRAY_SIZE' #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) ^~~ Core/HLE/ReplaceTables.cpp:1117:9: error: invalid application of 'sizeof' to an incomplete type 'const ReplacementTableEntry []' return ARRAY_SIZE(entries); ^~~~~~~~~~~~~~~~~~~ native/math/../base/basictypes.h:67:30: note: expanded from macro 'ARRAY_SIZE' #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) ^~~ Core/MIPS/JitCommon/JitCommon.cpp:31:2: error: unknown type name 'Jit' Jit *jit; ^ Core/MIPS/JitCommon/JitCommon.cpp:100:21: error: no member named 'Asm' in 'MIPSComp::FakeJit' if (MIPSComp::jit->Asm().IsInSpace((u8 *)(intptr_t)addr)) { ~~~~~~~~~~~~~ ^ Core/MIPS/JitCommon/JitCommon.cpp:101:45: error: no member named 'Asm' in 'MIPSComp::FakeJit' *offset = addr - (uint64_t)MIPSComp::jit->Asm().GetBasePtr(); ~~~~~~~~~~~~~ ^ Core/MemMap.cpp:197:57: error: use of undeclared identifier 'MEMVIEW32_MASK' ...position, view.size, base + (view.virtual_address & MEMVIEW32_MASK)); ^
Core/Dialog/SavedataParam.cpp:269:26: error: use of undeclared identifier 'strnlen' return std::string(str, strnlen(str, n)); ^ Core/Dialog/SavedataParam.cpp:943:55: error: use of undeclared identifier 'strnlen' const std::string gameName(param->msData->gameName, strnlen(... ^ Core/Dialog/SavedataParam.cpp:944:55: error: use of undeclared identifier 'strnlen' const std::string saveName(param->msData->saveName, strnlen(... ^ Core/ELF/ElfReader.cpp:399:14: error: use of undeclared identifier 'strnlen' size_t n = strnlen(modInfo->name, 28); ^ Core/HLE/sceKernelModule.cpp:903:15: error: use of undeclared identifier 'strnlen' size_t n = strnlen(head->modname, 28); ^
Affects at least FreeBSD and OpenBSD.
/usr/bin/ld: cannot find -ldl
Clang still pretends as GCC 4.2.1 even with libc++ or newer libstdc++. In file included from Common/ConsoleListener.cpp:33: In file included from Common/ConsoleListener.h:20: In file included from Common/LogManager.h:26: Common/StdMutex.h:197:28: error: reference to 'adopt_lock_t' is ambiguous lock_guard(mutex_type& m, adopt_lock_t) ^ Common/StdMutex.h:183:6: note: candidate found by name lookup is 'std::adopt_lock_t' enum adopt_lock_t { adopt_lock }; ^ /usr/include/c++/v1/__mutex_base:55:25: note: candidate found by name lookup is 'std::__1::adopt_lock_t' struct _LIBCPP_TYPE_VIS adopt_lock_t {}; ^ In file included from Common/ConsoleListener.cpp:33: In file included from Common/ConsoleListener.h:20: In file included from Common/LogManager.h:26: Common/StdMutex.h:230:29: error: reference to 'defer_lock_t' is ambiguous unique_lock(mutex_type& m, defer_lock_t) ^ Common/StdMutex.h:181:6: note: candidate found by name lookup is 'std::defer_lock_t' enum defer_lock_t { defer_lock }; ^ /usr/include/c++/v1/__mutex_base:53:25: note: candidate found by name lookup is 'std::__1::defer_lock_t' struct _LIBCPP_TYPE_VIS defer_lock_t {}; ^ In file included from Common/ConsoleListener.cpp:33: In file included from Common/ConsoleListener.h:20: In file included from Common/LogManager.h:26: Common/StdMutex.h:234:29: error: reference to 'try_to_lock_t' is ambiguous unique_lock(mutex_type& m, try_to_lock_t) ^ Common/StdMutex.h:182:6: note: candidate found by name lookup is 'std::try_to_lock_t' enum try_to_lock_t { try_to_lock }; ^ /usr/include/c++/v1/__mutex_base:54:25: note: candidate found by name lookup is 'std::__1::try_to_lock_t' struct _LIBCPP_TYPE_VIS try_to_lock_t {}; ^ In file included from Common/ConsoleListener.cpp:33: In file included from Common/ConsoleListener.h:20: In file included from Common/LogManager.h:26: Common/StdMutex.h:238:29: error: reference to 'adopt_lock_t' is ambiguous unique_lock(mutex_type& m, adopt_lock_t) ^ Common/StdMutex.h:183:6: note: candidate found by name lookup is 'std::adopt_lock_t' enum adopt_lock_t { adopt_lock }; ^ /usr/include/c++/v1/__mutex_base:55:25: note: candidate found by name lookup is 'std::__1::adopt_lock_t' struct _LIBCPP_TYPE_VIS adopt_lock_t {}; ^ In file included from Common/ConsoleListener.cpp:33: In file included from Common/ConsoleListener.h:20: In file included from Common/LogManager.h:26: Common/StdMutex.h:345:6: warning: variable templates are a C++14 extension [-Wc++14-extensions] void swap(unique_lock<Mutex>& x, unique_lock<Mutex>& y) ^ Common/StdMutex.h:345:6: error: variable has incomplete type 'void' Common/StdMutex.h:345:11: error: reference to 'unique_lock' is ambiguous void swap(unique_lock<Mutex>& x, unique_lock<Mutex>& y) ^ Common/StdMutex.h:215:7: note: candidate found by name lookup is 'std::unique_lock' class unique_lock ^ /usr/include/c++/v1/__mutex_base:96:29: note: candidate found by name lookup is 'std::__1::unique_lock' class _LIBCPP_TYPE_VIS_ONLY unique_lock ^ In file included from Common/ConsoleListener.cpp:33: In file included from Common/ConsoleListener.h:20: In file included from Common/LogManager.h:26: Common/StdMutex.h:345:23: error: 'Mutex' does not refer to a value void swap(unique_lock<Mutex>& x, unique_lock<Mutex>& y) ^ Common/StdMutex.h:344:17: note: declared here template <class Mutex> ^ Common/StdMutex.h:345:31: error: use of undeclared identifier 'x' void swap(unique_lock<Mutex>& x, unique_lock<Mutex>& y) ^ Common/StdMutex.h:345:34: error: reference to 'unique_lock' is ambiguous void swap(unique_lock<Mutex>& x, unique_lock<Mutex>& y) ^ Common/StdMutex.h:215:7: note: candidate found by name lookup is 'std::unique_lock' class unique_lock ^ /usr/include/c++/v1/__mutex_base:96:29: note: candidate found by name lookup is 'std::__1::unique_lock' class _LIBCPP_TYPE_VIS_ONLY unique_lock ^ In file included from Common/ConsoleListener.cpp:33: In file included from Common/ConsoleListener.h:20: In file included from Common/LogManager.h:26: Common/StdMutex.h:345:46: error: 'Mutex' does not refer to a value void swap(unique_lock<Mutex>& x, unique_lock<Mutex>& y) ^ Common/StdMutex.h:344:17: note: declared here template <class Mutex> ^ Common/StdMutex.h:345:54: error: use of undeclared identifier 'y' void swap(unique_lock<Mutex>& x, unique_lock<Mutex>& y) ^ Common/StdMutex.h:345:56: error: expected ';' at end of declaration void swap(unique_lock<Mutex>& x, unique_lock<Mutex>& y) ^ ; Common/StdMutex.h:346:1: error: expected unqualified-id { ^ In file included from Common/ConsoleListener.cpp:33: In file included from Common/ConsoleListener.h:20: Common/LogManager.h:54:7: error: reference to 'mutex' is ambiguous std::mutex m_log_lock; ^ /usr/include/c++/v1/__mutex_base:27:24: note: candidate found by name lookup is 'std::__1::mutex' class _LIBCPP_TYPE_VIS mutex ^ Common/StdMutex.h:107:7: note: candidate found by name lookup is 'std::mutex' class mutex ^ In file included from Common/ConsoleListener.cpp:33: In file included from Common/ConsoleListener.h:20: Common/LogManager.h:116:7: error: reference to 'mutex' is ambiguous std::mutex m_listeners_lock; ^ /usr/include/c++/v1/__mutex_base:27:24: note: candidate found by name lookup is 'std::__1::mutex' class _LIBCPP_TYPE_VIS mutex ^ Common/StdMutex.h:107:7: note: candidate found by name lookup is 'std::mutex' class mutex ^ In file included from Common/ConsoleListener.cpp:33: In file included from Common/ConsoleListener.h:20: Common/LogManager.h:131:7: error: reference to 'mutex' is ambiguous std::mutex log_lock_; ^ /usr/include/c++/v1/__mutex_base:27:24: note: candidate found by name lookup is 'std::__1::mutex' class _LIBCPP_TYPE_VIS mutex ^ Common/StdMutex.h:107:7: note: candidate found by name lookup is 'std::mutex' class mutex ^ 1 warning and 16 errors generated.
Common/CPUDetect.cpp:70:2: error: use of undeclared identifier '__cpuidex'; did you mean 'do_cpuidex'? __cpuidex((int *)regs, cpuid_leaf, ecxval); ^~~~~~~~~ do_cpuidex Common/CPUDetect.cpp:69:6: note: 'do_cpuidex' declared here void do_cpuidex(u32 regs[4], u32 cpuid_leaf, u32 ecxval) { ^ Common/CPUDetect.cpp:70:12: error: cannot initialize a parameter of type 'u32 *' (aka 'unsigned int *') with an rvalue of type 'int *' __cpuidex((int *)regs, cpuid_leaf, ecxval); ^~~~~~~~~~~ Common/CPUDetect.cpp:69:21: note: passing argument to parameter 'regs' here void do_cpuidex(u32 regs[4], u32 cpuid_leaf, u32 ecxval) { ^ Common/CPUDetect.cpp:73:2: error: use of undeclared identifier '__cpuid'; did you mean 'do_cpuid'? __cpuid((int *)regs, cpuid_leaf); ^~~~~~~ do_cpuid Common/CPUDetect.cpp:72:6: note: 'do_cpuid' declared here void do_cpuid(u32 regs[4], u32 cpuid_leaf) { ^ Common/CPUDetect.cpp:73:10: error: cannot initialize a parameter of type 'u32 *' (aka 'unsigned int *') with an rvalue of type 'int *' __cpuid((int *)regs, cpuid_leaf); ^~~~~~~~~~~ Common/CPUDetect.cpp:72:19: note: passing argument to parameter 'regs' here void do_cpuid(u32 regs[4], u32 cpuid_leaf) { ^ 4 errors generated.
In file included from Common/CPUDetect.cpp:27: In file included from Common/Common.h:139: Common/Swap.h:76:23: error: C++ requires a type specifier for all declarations inline unsigned short bswap16(unsigned short x) { return (x << 8) | (x >> 8); } ^ /usr/include/sys/endian.h:59:20: note: expanded from macro 'bswap16' ^ /usr/include/x86/endian.h:74:16: note: expanded from macro '__bswap16' ((__uint16_t)(__builtin_constant_p(x) ? \ ^ In file included from Common/CPUDetect.cpp:27: In file included from Common/Common.h:139: Common/Swap.h:76:23: error: expected ')' /usr/include/sys/endian.h:59:20: note: expanded from macro 'bswap16' ^ /usr/include/x86/endian.h:74:40: note: expanded from macro '__bswap16' ((__uint16_t)(__builtin_constant_p(x) ? \ ^ Common/Swap.h:76:23: note: to match this '(' /usr/include/sys/endian.h:59:20: note: expanded from macro 'bswap16' ^ /usr/include/x86/endian.h:74:15: note: expanded from macro '__bswap16' ((__uint16_t)(__builtin_constant_p(x) ? \ ^ In file included from Common/CPUDetect.cpp:27: In file included from Common/Common.h:139: Common/Swap.h:76:59: error: use of undeclared identifier 'x' inline unsigned short bswap16(unsigned short x) { return (x << 8) | (x >> 8); } ^ Common/Swap.h:76:70: error: use of undeclared identifier 'x' inline unsigned short bswap16(unsigned short x) { return (x << 8) | (x >> 8); } ^ Common/Swap.h:77:21: error: expected ')' inline unsigned int bswap32(unsigned int x) { return (x >> 24) | ((x & 0xFF0... ^ /usr/include/sys/endian.h:60:20: note: expanded from macro 'bswap32' ^ /usr/include/x86/endian.h:77:27: note: expanded from macro '__bswap32' (__builtin_constant_p(x) ? \ ^ Common/Swap.h:77:21: note: to match this '(' /usr/include/sys/endian.h:60:20: note: expanded from macro 'bswap32' ^ /usr/include/x86/endian.h:77:2: note: expanded from macro '__bswap32' (__builtin_constant_p(x) ? \ ^ In file included from Common/CPUDetect.cpp:27: In file included from Common/Common.h:139: Common/Swap.h:77:21: error: functions that differ only in their return type cannot be overloaded inline unsigned int bswap32(unsigned int x) { return (x >> 24) | ((x & 0xFF0... ^ /usr/include/sys/endian.h:60:20: note: expanded from macro 'bswap32' ^ /usr/include/x86/endian.h:77:3: note: expanded from macro '__bswap32' (__builtin_constant_p(x) ? \ ^ native/base/basictypes.h:92:44: note: previous implicit declaration is here inline uint16 swap16(uint16 _data) {return bswap16(_data);} ^ /usr/include/sys/endian.h:59:20: note: expanded from macro 'bswap16' ^ /usr/include/x86/endian.h:74:16: note: expanded from macro '__bswap16' ((__uint16_t)(__builtin_constant_p(x) ? \ ^ In file included from Common/CPUDetect.cpp:27: In file included from Common/Common.h:139: Common/Swap.h:78:27: error: expected ')' inline unsigned long long bswap64(unsigned long long x) { return ((unsigned ... ^ /usr/include/sys/endian.h:61:20: note: expanded from macro 'bswap64' ^ /usr/include/x86/endian.h:80:27: note: expanded from macro '__bswap64' (__builtin_constant_p(x) ? \ ^ Common/Swap.h:78:27: note: to match this '(' /usr/include/sys/endian.h:61:20: note: expanded from macro 'bswap64' ^ /usr/include/x86/endian.h:80:2: note: expanded from macro '__bswap64' (__builtin_constant_p(x) ? \ ^ In file included from Common/CPUDetect.cpp:27: In file included from Common/Common.h:139: Common/Swap.h:78:27: error: functions that differ only in their return type cannot be overloaded inline unsigned long long bswap64(unsigned long long x) { return ((unsigned ... ^ /usr/include/sys/endian.h:61:20: note: expanded from macro 'bswap64' ^ /usr/include/x86/endian.h:80:3: note: expanded from macro '__bswap64' (__builtin_constant_p(x) ? \ ^ native/base/basictypes.h:92:44: note: previous implicit declaration is here inline uint16 swap16(uint16 _data) {return bswap16(_data);} ^ /usr/include/sys/endian.h:59:20: note: expanded from macro 'bswap16' ^ /usr/include/x86/endian.h:74:16: note: expanded from macro '__bswap16' ((__uint16_t)(__builtin_constant_p(x) ? \ ^ 8 errors generated.
This is required by POSIX but may matter only in MAX_FIXED case.
Core/HLE/sceRtc.cpp:471:14: error: invalid argument type 'char *(*)(int, int)' to unary expression srcTick -= -timezone * 1000000ULL; ^~~~~~~~~ Core/HLE/sceRtc.cpp:498:14: error: invalid argument type 'char *(*)(int, int)' to unary expression srcTick += -timezone * 1000000ULL; ^~~~~~~~~ Core/HLE/sceRtc.cpp:1035:16: error: invalid argument type 'char *(*)(int, int)' to unary expression tz_seconds = -timezone; ^~~~~~~~~ Core/HLE/sceRtc.cpp:1074:16: error: invalid argument type 'char *(*)(int, int)' to unary expression tz_seconds = -timezone; ^~~~~~~~~ 4 errors generated.
Each one has different kernel and userland. They do cross-pollinate frequently but otherwise do not try to be compatible.
- Use xdg-open to open links and cheat files - Change OS name in compat reports: BSD -> FreeBSD - Minor FakeJit fixes GitHub: hrydgard/native#272, hrydgard/ppsspp#7772 git-svn-id: svn+ssh://svn.freebsd.org/ports/head@387684 35697150-7ecd-e111-bb59-0022644237b5
- Use xdg-open to open links and cheat files - Change OS name in compat reports: BSD -> FreeBSD - Minor FakeJit fixes GitHub: hrydgard/native#272, hrydgard/ppsspp#7772
Miscellaneous portability fixes
EDIT: added links
Rebased and slightly adjusted changes from my emulators/ppsspp port. A few hackish are left out [1][2]. 9c3fc6a, 32c7721, e638fbe may still need care. Package build logs:
Current Core/HLE/sceRtc.cpp makes me wonder how often OS X is build-tested. 1e31fd5 should have broke it.