-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Clang compilation fixes #4882
Clang compilation fixes #4882
Conversation
rpcs3/CMakeLists.txt
Outdated
@@ -129,7 +129,7 @@ if(NOT MSVC) | |||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--allow-multiple-definition") | |||
endif() | |||
|
|||
add_compile_options(-msse -msse2 -mcx16) | |||
add_compile_options(-msse -msse2 -mcx16 -mrtm) |
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.
Very wrong, it assumes compilation for processors only with rtm support.
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.
How would you solve the undeclared indentifier knowing the file immintrin.h
contains this?
#ifdef __RTM__
#include <rtmintrin.h>
#endif
Source: https://web.archive.org/web/20150502153249/http://clang.llvm.org:80/doxygen/immintrin_8h_source.html
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.
It's just a constant, defined by x86 ISA
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.
So, what would be your suggestion to fix this issue without using -mrtm
?
- Add
#define __RTM__ 1
in the code? - Add
#ifndef _XABORT_RETRY #define _XABORT_RETRY (1 << 1) #endif
at the top of the JIT.cpp? - Bump the minimal version of clang required?
- Something else?
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.
Second is fine, first is wrong too.
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.
All right, done.
Compilation fixes for old versions of Clang, still supported by RPCS3.
About the cmake change, these two lines does the same job:
I kept the first one.