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

raknet fails to compile on arm64: "I can't tell what endian-ness to use for your architecture." #7

Closed
MrPowerMac opened this issue Dec 5, 2021 · 7 comments
Labels
A-net Related to dNet build Related to building the server P-medium This issue does affect gameplay, but not critically enough that they are unable to play.

Comments

@MrPowerMac
Copy link

Attempting to build the server on Ubuntu 20.04 arm64 throws an error when trying to compile AutoRPC.cpp, indicating that it doesn't recognize the architecture. Build continues for a bit, but will ultimately fail since the raknet component never finishes compiling. Should be a simple fix in theory but I'm not sure where to make the changes.

ubuntu@instance-20210714-1042:~/git/DarkflameServer/build$ make -j3
[  1%] Built target dChatFilter
[  1%] Built target libbcrypt
[  1%] Building CXX object CMakeFiles/raknet.dir/thirdparty/raknet/Source/AutoRPC.cpp.o
Scanning dependencies of target recast
Scanning dependencies of target dDatabase
[  1%] Building CXX object CMakeFiles/recast.dir/thirdparty/recastnavigation/Recast/Source/Recast.cpp.o
In file included from /home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:14,
                 from /home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/AutoRPC.h:29,
                 from /home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/AutoRPC.cpp:1:
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Types.h:101:3: error: #error "I can't tell what endian-ness to use for your architecture."
  101 | # error "I can't tell what endian-ness to use for your architecture."
      |   ^~~~~
In file included from /home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/AutoRPC.h:29,
                 from /home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/AutoRPC.cpp:1:
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:230:2: warning: #warning Unknown Architecture [-Wcpp]
  230 | #warning Unknown Architecture
      |  ^~~~~~~
[  1%] Building CXX object CMakeFiles/dDatabase.dir/dDatabase/CDClientDatabase.cpp.o
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:772:18: error: ‘NaturalWord’ in namespace ‘GenRPC’ does not name a type
  772 |  typedef GenRPC::NaturalWord NaturalWord;
      |                  ^~~~~~~~~~~
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:777:4: error: ‘NaturalWord’ does not name a type
  777 |    NaturalWord func_address_or_vtable_index;
      |    ^~~~~~~~~~~
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:778:4: error: ‘NaturalWord’ does not name a type
  778 |    NaturalWord class_offset;
      |    ^~~~~~~~~~~
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:780:3: error: ‘NaturalWord’ does not name a type
  780 |   NaturalWord raw_pointer[2];
      |   ^~~~~~~~~~~
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h: In copy constructor ‘GenRPC::PMF::PMF(const GenRPC::PMF&)’:
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:786:3: error: class ‘GenRPC::PMF’ does not have any field named ‘func_address_or_vtable_index’
  786 |   func_address_or_vtable_index( pmf.func_address_or_vtable_index ),
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:786:37: error: ‘const struct GenRPC::PMF’ has no member named ‘func_address_or_vtable_index’
  786 |   func_address_or_vtable_index( pmf.func_address_or_vtable_index ),
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:787:3: error: class ‘GenRPC::PMF’ does not have any field named ‘class_offset’
  787 |   class_offset( pmf.class_offset )
      |   ^~~~~~~~~~~~
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:787:21: error: ‘const struct GenRPC::PMF’ has no member named ‘class_offset’
  787 |   class_offset( pmf.class_offset )
      |                     ^~~~~~~~~~~~
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h: In constructor ‘GenRPC::PMF::PMF(int)’:
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:795:3: error: class ‘GenRPC::PMF’ does not have any field named ‘func_address_or_vtable_index’
  795 |   func_address_or_vtable_index( 0 ),
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:796:3: error: class ‘GenRPC::PMF’ does not have any field named ‘class_offset’
  796 |   class_offset( 0 )
      |   ^~~~~~~~~~~~
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h: In constructor ‘GenRPC::PMF::PMF(void*)’:
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:804:3: error: class ‘GenRPC::PMF’ does not have any field named ‘func_address_or_vtable_index’
  804 |   func_address_or_vtable_index( reinterpret_cast<NaturalWord>( func ) ),
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:804:50: error: ‘NaturalWord’ does not name a type
  804 |   func_address_or_vtable_index( reinterpret_cast<NaturalWord>( func ) ),
      |                                                  ^~~~~~~~~~~
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:805:3: error: class ‘GenRPC::PMF’ does not have any field named ‘class_offset’
  805 |   class_offset( 0 )
      |   ^~~~~~~~~~~~
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h: In constructor ‘GenRPC::PMF::PMF(void*, unsigned int)’:
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:812:18: error: class ‘GenRPC::PMF’ does not have any field named ‘func_address_or_vtable_index’
  812 |   : castUp( 0 ), func_address_or_vtable_index( reinterpret_cast<NaturalWord>( func ) ),
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:812:65: error: ‘NaturalWord’ does not name a type
  812 |   : castUp( 0 ), func_address_or_vtable_index( reinterpret_cast<NaturalWord>( func ) ),
      |                                                                 ^~~~~~~~~~~
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:813:3: error: class ‘GenRPC::PMF’ does not have any field named ‘class_offset’
  813 |   class_offset( offset )
      |   ^~~~~~~~~~~~
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h: In constructor ‘GenRPC::PMF::PMF(Func, void* (*)(void*))’:
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:823:3: error: class ‘GenRPC::PMF’ does not have any field named ‘func_address_or_vtable_index’
  823 |   func_address_or_vtable_index( ((NaturalWord*)&func)[0] ),
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:823:35: error: ‘NaturalWord’ was not declared in this scope
  823 |   func_address_or_vtable_index( ((NaturalWord*)&func)[0] ),
      |                                   ^~~~~~~~~~~
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:823:47: error: expected primary-expression before ‘)’ token
  823 |   func_address_or_vtable_index( ((NaturalWord*)&func)[0] ),
      |                                               ^
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:824:3: error: class ‘GenRPC::PMF’ does not have any field named ‘class_offset’
  824 |   class_offset( ((NaturalWord*)&func)[1] )
      |   ^~~~~~~~~~~~
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:824:31: error: expected primary-expression before ‘)’ token
  824 |   class_offset( ((NaturalWord*)&func)[1] )
      |                               ^
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h: In member function ‘void* GenRPC::PMF::computeFuncAddr(void*)’:
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:833:10: error: ‘func_address_or_vtable_index’ was not declared in this scope
  833 |   if ( ( func_address_or_vtable_index & 1 ) == 0 )
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:840:28: error: ‘NaturalWord’ was not declared in this scope
  840 |    char* vtable = (char*)*(NaturalWord**)_object;
      |                            ^~~~~~~~~~~
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:840:41: error: expected primary-expression before ‘)’ token
  840 |    char* vtable = (char*)*(NaturalWord**)_object;
      |                                         ^
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:841:50: error: expected primary-expression before ‘)’ token
  841 |    return reinterpret_cast<void*>( *(NaturalWord*)( vtable + func_address_or_vtable_index - 1 ) );
      |                                                  ^
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h: In member function ‘void* GenRPC::PMF::computeThis(void*)’:
/home/ubuntu/git/DarkflameServer/thirdparty/raknet/Source/Gen_RPC8.h:853:35: error: ‘class_offset’ was not declared in this scope
  853 |   return (void*)( (char*)object + class_offset );
      |                                   ^~~~~~~~~~~~
make[2]: *** [CMakeFiles/raknet.dir/build.make:76: CMakeFiles/raknet.dir/thirdparty/raknet/Source/AutoRPC.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:265: CMakeFiles/raknet.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

build continues for a bit...

make: *** [Makefile:84: all] Error 2
@codeshaunted
Copy link
Member

codeshaunted commented Dec 6, 2021

To my knowledge version of RakNet was never designed to run on ARM (especially modern ARM). What compiler are you using? If you’re using gcc, clang (untested on linux) would likely be a better option because of it’s usage of LLVM IR. You will also encounter much bigger problems than RakNet not compiling. Notably, Oracle does not provide pre-built ARM binaries for MySQL Connector C++.

@MrPowerMac
Copy link
Author

I was using GCC 9 if I recall correctly; whatever was installed by default along with the build-essential package.

I’m not familiar with MySQL Connector C++; is that something a binary is provided for in the server source for x86? I was able to get the server up and running just fine on a separate machine running Ubuntu 20.04 amd64. Not sure if there’s an equivalent that can be used on ARM platforms.

@C0gwh33l
Copy link

C0gwh33l commented Dec 6, 2021

i hit the same compilation error with MacOS monterey, all required packages are installed trough homebrew where necessary and are up to date, so essentially getting architecture error, what could i be missing ?

terminal photo with redacted homefolder
https://imgur.com/a/PVw93Vx

@MickVermeulen
Copy link
Contributor

MickVermeulen commented Dec 6, 2021

Trying to build on Apple Silicon is still a bit of a mystery, I've attempted to do so a couple of times but thus far have not got it to work. The macOS build steps thus don't really apply to it.

@MrPowerMac
Copy link
Author

This will likely be closed by #111 once it is merged. I'll test it in the original environment that I was in when I wrote this issue, then if it seems to work I'll close it

@MickVermeulen MickVermeulen added build Related to building the server P-medium This issue does affect gameplay, but not critically enough that they are unable to play. labels Dec 9, 2021
@MrPowerMac
Copy link
Author

#111 has been superseded by #231, but it should still close this issue when merged. Will continue to keep an eye on it.

@Xiphoseer Xiphoseer added the A-net Related to dNet label Feb 5, 2022
Jettford referenced this issue in Squareville/wonderland-server Mar 25, 2022
@EmosewaMC
Copy link
Collaborator

#231 has been merged and resolves this issue. Feel free to let us know if any more issues arise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-net Related to dNet build Related to building the server P-medium This issue does affect gameplay, but not critically enough that they are unable to play.
Projects
None yet
Development

No branches or pull requests

6 participants