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

Fixes builds for Debian Linux ARM and gcc 12 #82

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
32 changes: 24 additions & 8 deletions build/ProductConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,12 @@ if (UNIX)
endif()

if(CMAKE_CL_64)
set(XMP_EXTRA_COMPILE_FLAGS "-m64")
set(XMP_EXTRA_LINK_FLAGS "-m64")

if(NOT ${CMAKE_ARCH} MATCHES "ARM64")
set(XMP_EXTRA_COMPILE_FLAGS "-m64")
set(XMP_EXTRA_LINK_FLAGS "-m64")
endif()

if(CENTOS)
set(XMP_PLATFORM_FOLDER "i80386linux_x64_centos") # add XMP_BUILDMODE_DIR to follow what other platforms do
set(XMP_GCC_LIBPATH /opt/llvm/lib)
Expand All @@ -124,7 +128,9 @@ if (UNIX)
set(XMP_GCC_LIBPATH /user/unicore/i80386linux_x64/compiler/gcc4.8.2/linux3.10_64/lib64)
endif()
else()
set(XMP_EXTRA_LINK_FLAGS "-m32 -mtune=i686")
if(NOT ${CMAKE_ARCH} MATCHES "ARM64")
set(XMP_EXTRA_LINK_FLAGS "-m32 -mtune=i686")
endif()
if(CENTOS)
set(XMP_GCC_LIBPATH /opt/llvm/lib)
set(XMP_PLATFORM_FOLDER "i80386linux_centos") # add XMP_BUILDMODE_DIR to follow what other platforms do
Expand All @@ -136,8 +142,11 @@ if (UNIX)
else()
# running toolchain
if(CMAKE_CL_64)
set(XMP_EXTRA_COMPILE_FLAGS "-m64")
set(XMP_EXTRA_LINK_FLAGS "-m64")

if(NOT ${CMAKE_ARCH} MATCHES "ARM64")
set(XMP_EXTRA_COMPILE_FLAGS "-m64")
set(XMP_EXTRA_LINK_FLAGS "-m64")
endif()

if(CENTOS)
set(XMP_GCC_LIBPATH /opt/llvm/lib)
Expand All @@ -147,8 +156,10 @@ if (UNIX)
set(XMP_GCC_LIBPATH /user/unicore/i80386linux_x64/compiler/gcc4.8.2/linux3.10_64/lib64)
endif()
else()
set(XMP_EXTRA_COMPILE_FLAGS "-m32 -mtune=i686")
set(XMP_EXTRA_LINK_FLAGS "-m32")
if(NOT ${CMAKE_ARCH} MATCHES "ARM64")
set(XMP_EXTRA_COMPILE_FLAGS "-m32 -mtune=i686")
set(XMP_EXTRA_LINK_FLAGS "-m32")
endif()
if(CENTOS)
set(XMP_GCC_LIBPATH /opt/llvm/lib)
set(XMP_PLATFORM_FOLDER "i80386linux_centos") # add XMP_BUILDMODE_DIR to follow what other platforms do
Expand All @@ -170,7 +181,12 @@ if (UNIX)
#set(CMAKE_CXX_COMPILER "/user/unicore/i80386linux/compiler/gcc4.4.4/linux2.6_32/bin/gcc")
#set(XMP_GCC_LIBPATH /user/unicore/i80386linux/compiler/gcc4.4.4/linux2.6_32/lib)

set(XMP_PLATFORM_LINK "-z defs -Xlinker -Bsymbolic -Wl,--no-undefined ${XMP_EXTRA_LINK_FLAGS} ${XMP_TOOLCHAIN_LINK_FLAGS} -lrt -Wl,--no-as-needed -ldl -lpthread ${XMP_GCC_LIBPATH}/libssp.a")
set(XMP_PLATFORM_LINK "-z defs -Xlinker -Bsymbolic -Wl,--no-undefined ${XMP_EXTRA_LINK_FLAGS} ${XMP_TOOLCHAIN_LINK_FLAGS} -lrt -Wl,--no-as-needed -ldl -lpthread")

if (XMP_ENABLE_SECURE_SETTINGS)
set (XMP_PLATFORM_LINK "${XMP_PLATFORM_LINK} ${XMP_GCC_LIBPATH}/libssp.a")
endif()

if(CENTOS)
set(XMP_PLATFORM_LINK " -lc++abi ${XMP_PLATFORM_LINK}")
endif()
Expand Down
3 changes: 3 additions & 0 deletions source/EndianUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
#elif __GNUC__ && (__sparc__)
#define kBigEndianHost 1
#define kLittleEndianHost 0
#elif __GNUC__ && (__aarch64__)
#define kBigEndianHost 1
#define kLittleEndianHost 0
#else
#error "Must define kBigEndianHost as 0 or 1 in the makefile."
#endif
Expand Down