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

Support PowerPC64 architecture #85

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ check_type_size("void*" CMAKE_SIZEOF_VOID_P)
set(X86_64 OFF)
set(ARM32 OFF)
set(ARM64 OFF)
set(PPC64 OFF)
set(PPC64LE OFF)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
set(ARM32 ON)
set(Architecture "arm")
Expand All @@ -75,7 +77,11 @@ check_type_size("void*" CMAKE_SIZEOF_VOID_P)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "powerpc")
set(Architecture "ppc")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "powerpc64")
set(PPC64 ON)
set(Architecture "ppc64")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le")
set(PPC64LE ON)
set(Architecture "ppc64le")
else()
set(Architecture "${CMAKE_SYSTEM_PROCESSOR}")
endif()
Expand Down Expand Up @@ -113,6 +119,8 @@ if(APPLE AND X86_64)
set(compiler_flags_release ${compiler_flags_global})
elseif(X86_64)
set(compiler_flags_release ${compiler_flags_global})
elseif(PPC64LE OR PPC64)
set(compiler_flags_release ${compiler_flags_global} -mcpu=native)
else()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(compiler_flags_release ${compiler_flags_global} -march=i686 -Winline -ffast-math -fomit-frame-pointer -finline-functions)
Expand Down
7 changes: 2 additions & 5 deletions src/qcommon/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -3616,14 +3616,11 @@ static void Sys_GetProcessorId( char *vendor )
Com_sprintf( vendor, 128, "%s %s", ARCH_STRING, (const char*)getauxval( AT_PLATFORM ) );
#endif
#endif // !arm32
}

#if idppc || idppc64
static void Sys_GetProcessorId( char *vendor )
Copy link
Author

Choose a reason for hiding this comment

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

To address the build error:

/home/tle/Work/ETe/src/qcommon/common.c:3622:13: error: redefinition of ‘Sys_GetProcessorId’
 3622 | static void Sys_GetProcessorId( char *vendor )
      |             ^~~~~~~~~~~~~~~~~~

{
Com_sprintf( vendor, 100, "%s", ARCH_STRING );
}
Com_sprintf( vendor, 100, "%s", ARCH_STRING );
#endif
}

#endif // __linux__

Expand Down