Skip to content

Commit

Permalink
Merge pull request #3000 from knn-k/aarch64crossbuild1
Browse files Browse the repository at this point in the history
AArch64: CMake build settings
  • Loading branch information
0xdaryl committed Oct 15, 2018
2 parents 4d96857 + 67845d8 commit de7e6dc
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 9 deletions.
6 changes: 6 additions & 0 deletions cmake/modules/platform/arch/aarch64.cmake
Expand Up @@ -20,9 +20,15 @@
#############################################################################

list(APPEND OMR_PLATFORM_DEFINITIONS
-DAARCH64
-DJ9AARCH64
-DAARCH64GNU
-DFIXUP_UNALIGNED
-march=armv8-a+simd
-Wno-unused-but-set-variable
)

set(TR_HOST_ARCH aarch64)
set(TR_HOST_BITS 64)

list(APPEND TR_COMPILE_DEFINITIONS TR_HOST_ARM64 TR_TARGET_ARM64 TR_HOST_64BIT TR_TARGET_64BIT)
20 changes: 11 additions & 9 deletions cmake/modules/platform/toolcfg/gnu.cmake
Expand Up @@ -26,15 +26,17 @@ set(OMR_ENHANCED_WARNING_FLAG -Wall)
list(APPEND OMR_PLATFORM_COMPILE_OPTIONS -pthread)

if(OMR_ENV_DATA64)
list(APPEND OMR_PLATFORM_COMPILE_OPTIONS
-m64
)
list(APPEND OMR_PLATFORM_EXE_LINKER_OPTIONS
-m64
)
list(APPEND OMR_PLATFORM_SHARED_LINKER_OPTIONS
-m64
)
if (NOT (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64"))
list(APPEND OMR_PLATFORM_COMPILE_OPTIONS
-m64
)
list(APPEND OMR_PLATFORM_EXE_LINKER_OPTIONS
-m64
)
list(APPEND OMR_PLATFORM_SHARED_LINKER_OPTIONS
-m64
)
endif()
else()
list(APPEND OMR_PLATFORM_COMPILE_OPTIONS
-m32
Expand Down
32 changes: 32 additions & 0 deletions cmake/toolchains/aarch64-linux-cross.cmake
@@ -0,0 +1,32 @@
###############################################################################
# Copyright (c) 2018, 2018 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
# distribution and is available at http://eclipse.org/legal/epl-2.0
# or the Apache License, Version 2.0 which accompanies this distribution
# and is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# This Source Code may also be made available under the following Secondary
# Licenses when the conditions for such availability set forth in the
# Eclipse Public License, v. 2.0 are satisfied: GNU General Public License,
# version 2 with the GNU Classpath Exception [1] and GNU General Public
# License, version 2 with the OpenJDK Assembly Exception [2].
#
# [1] https://www.gnu.org/software/classpath/license.html
# [2] http://openjdk.java.net/legal/assembly-exception.html
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
#############################################################################

SET(CMAKE_SYSTEM_PROCESSOR aarch64)
SET(CMAKE_SYSTEM_NAME Linux)

SET(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
SET(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)

SET(CMAKE_FIND_ROOT_PATH /root/gcc-linaro-4.9.4-2017.01-x86_64_aarch64-linux-gnu)

SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
19 changes: 19 additions & 0 deletions compiler/aarch64/CMakeLists.txt
Expand Up @@ -21,6 +21,25 @@

compiler_library(aarch64
# Target files
${CMAKE_CURRENT_LIST_DIR}/codegen/ARM64BinaryEncoding.cpp
${CMAKE_CURRENT_LIST_DIR}/codegen/ARM64Debug.cpp
${CMAKE_CURRENT_LIST_DIR}/codegen/ARM64Instruction.cpp
${CMAKE_CURRENT_LIST_DIR}/codegen/ARM64OutOfLineCodeSection.cpp
${CMAKE_CURRENT_LIST_DIR}/codegen/ARM64SystemLinkage.cpp
${CMAKE_CURRENT_LIST_DIR}/codegen/BinaryEvaluator.cpp
${CMAKE_CURRENT_LIST_DIR}/codegen/ControlFlowEvaluator.cpp
${CMAKE_CURRENT_LIST_DIR}/codegen/FPTreeEvaluator.cpp
${CMAKE_CURRENT_LIST_DIR}/codegen/GenerateInstructions.cpp
${CMAKE_CURRENT_LIST_DIR}/codegen/OMRCodeGenerator.cpp
${CMAKE_CURRENT_LIST_DIR}/codegen/OMRInstruction.cpp
${CMAKE_CURRENT_LIST_DIR}/codegen/OMRLinkage.cpp
${CMAKE_CURRENT_LIST_DIR}/codegen/OMRMachine.cpp
${CMAKE_CURRENT_LIST_DIR}/codegen/OMRMemoryReference.cpp
${CMAKE_CURRENT_LIST_DIR}/codegen/OMRRealRegister.cpp
${CMAKE_CURRENT_LIST_DIR}/codegen/OMRRegisterDependency.cpp
${CMAKE_CURRENT_LIST_DIR}/codegen/OMRRegisterIterator.cpp
${CMAKE_CURRENT_LIST_DIR}/codegen/OMRSnippet.cpp
${CMAKE_CURRENT_LIST_DIR}/codegen/OMRTreeEvaluator.cpp
${CMAKE_CURRENT_LIST_DIR}/codegen/OpBinary.cpp
${CMAKE_CURRENT_LIST_DIR}/codegen/UnaryEvaluator.cpp
)

0 comments on commit de7e6dc

Please sign in to comment.