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 to build under arm32 ( raspberry pi on 32bit debian). #261

Merged
merged 1 commit into from
Jun 22, 2024
Merged
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
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ if(${PCEM_CPU_TYPE} STREQUAL "i386")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
endif()

set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fomit-frame-pointer -mstackrealign -fno-strict-aliasing")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fomit-frame-pointer -mstackrealign -fno-strict-aliasing")
if(${PCEM_CPU_TYPE} MATCHES "arm.*")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fomit-frame-pointer -fno-strict-aliasing")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fomit-frame-pointer -fno-strict-aliasing")
else()
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fomit-frame-pointer -mstackrealign -fno-strict-aliasing")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fomit-frame-pointer -mstackrealign -fno-strict-aliasing")
endif()

set(PCEM_VERSION_STRING "vNext" CACHE STRING "PCem Version String")
set(PCEM_DISPLAY_ENGINE "wxWidgets" CACHE STRING "PCem Display Engine")
Expand Down
9 changes: 8 additions & 1 deletion cmake/arch-detect.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
set(archdetect_c_code "
#if defined(__arm__) || defined(__TARGET_ARCH_ARM)
#if defined(__ARM_ARCH_7__) \\
#if defined(__ARM_ARCH_8__) \\
|| defined(__ARM_ARCH_8A__) \\
|| (defined(__ARM_ARCH) && __ARM_ARCH >= 8) \\
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 8)
#error cmake_ARCH armv8
#elif defined(__ARM_ARCH_7__) \\
|| defined(__ARM_ARCH_7A__) \\
|| defined(__ARM_ARCH_7R__) \\
|| defined(__ARM_ARCH_7M__) \\
|| (defined(__ARM_ARCH) && __ARM_ARCH >= 7) \\
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 7)
#error cmake_ARCH armv7
#elif defined(__ARM_ARCH_6__) \\
Expand All @@ -13,6 +19,7 @@ set(archdetect_c_code "
|| defined(__ARM_ARCH_6K__) \\
|| defined(__ARM_ARCH_6ZK__) \\
|| defined(__ARM_ARCH_6M__) \\
|| (defined(__ARM_ARCH) && __ARM_ARCH >= 6) \\
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 6)
#error cmake_ARCH armv6
#elif defined(__ARM_ARCH_5TEJ__) \\
Expand Down
16 changes: 7 additions & 9 deletions src/codegen/codegen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,17 @@ if(${PCEM_CPU_TYPE} STREQUAL "i386")
)
endif()

if(${PCEM_CPU_TYPE} STREQUAL "arm")
set(PCEM_SRC ${PCEM_SRC}
codegen/arm32/codegen_backend_arm.c
codegen/arm32/codegen_backend_arm_ops.c
codegen/arm32/codegen_backend_arm_uops.c
)
endif()

if(${PCEM_CPU_TYPE} STREQUAL "arm64")
set(PCEM_SRC ${PCEM_SRC}
codegen/arm64/codegen_backend_arm64.c
codegen/arm64/codegen_backend_arm64_imm.c
codegen/arm64/codegen_backend_arm64_ops.c
codegen/arm64/codegen_backend_arm64_uops.c
)
endif()
elseif(${PCEM_CPU_TYPE} MATCHES "armv.*")
set(PCEM_SRC ${PCEM_SRC}
codegen/arm32/codegen_backend_arm.c
codegen/arm32/codegen_backend_arm_ops.c
codegen/arm32/codegen_backend_arm_uops.c
)
endif()
Loading