Skip to content
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

Merged
merged 5 commits into from
Jul 15, 2018
Merged

Clang compilation fixes #4882

merged 5 commits into from
Jul 15, 2018

Conversation

scribam
Copy link
Contributor

@scribam scribam commented Jul 14, 2018

Compilation fixes for old versions of Clang, still supported by RPCS3.

  • Error on 3.8:
../Utilities/JIT.cpp:472:11: error: no viable conversion from returned value of type 'unique_ptr<llvm::WritableMemoryBuffer, default_delete<llvm::WritableMemoryBuffer>>' to function return type 'unique_ptr<llvm::MemoryBuffer, default_delete<llvm::MemoryBuffer>>'
   return buf;
  • Error on 3.7:
../Utilities/JIT.cpp:16:19: error: use of undeclared identifier '_XABORT_RETRY'
 c.test(x86::eax, _XABORT_RETRY);
  • Error on 3.6:
../rpcs3/Emu/Cell/Modules/cellGcmSys.cpp:31:41: error: no matching constructor for initialization of 'vm::ptr<CellGcmDisplayInfo>' (aka 'vm::_ptr_base<CellGcmDisplayInfo, unsigned int>')
 vm::ptr<CellGcmDisplayInfo> gcm_buffers{ vm::null };

About the cmake change, these two lines does the same job:

I kept the first one.

@@ -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)
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

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

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All right, done.

@Nekotekina Nekotekina merged commit 65d270e into RPCS3:master Jul 15, 2018
@scribam scribam deleted the clang-compilation-fixes branch July 15, 2018 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants