summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authora-shaurtaev <a.shaurtaev@partner.samsung.com>2023-04-10 13:09:27 +0300
committerGleb Balykov/Advanced System SW Lab /SRR/Staff Engineer/Samsung Electronics <g.balykov@samsung.com>2023-04-16 11:00:23 +0300
commitf9ad695ef2118b44d15f74591c9bff9da29ddef1 (patch)
tree9da6d10147907bd6ab9cbeb9c6216568fec1df01
parentdbff3d423822f2b89aec941147a1b11e8ea34ded (diff)
downloadheaptrack-f9ad695ef2118b44d15f74591c9bff9da29ddef1.tar.gz
heaptrack-f9ad695ef2118b44d15f74591c9bff9da29ddef1.tar.bz2
heaptrack-f9ad695ef2118b44d15f74591c9bff9da29ddef1.zip
Add x86_64 build
-rw-r--r--packaging/heaptrack.spec6
-rw-r--r--profiler/profiler/cross/amd64/toolchain.cmake39
2 files changed, 44 insertions, 1 deletions
diff --git a/packaging/heaptrack.spec b/packaging/heaptrack.spec
index c3655bc..e2e7f51 100644
--- a/packaging/heaptrack.spec
+++ b/packaging/heaptrack.spec
@@ -11,7 +11,7 @@ Source1001: heaptrack.manifest
%define heaptrack_build build-%{_target_platform}
AutoReqProv: no
-ExcludeArch: armv7hl x86_64
+ExcludeArch: armv7hl
BuildRequires: cmake
BuildRequires: gcc
@@ -74,6 +74,10 @@ make %{?jobs:-j%jobs} VERBOSE=1
%define arch_dir arm64
%endif
+%ifarch x86_64
+%define arch_dir amd64
+%endif
+
%ifarch %{ix86}
%define arch_dir x86
%endif
diff --git a/profiler/profiler/cross/amd64/toolchain.cmake b/profiler/profiler/cross/amd64/toolchain.cmake
new file mode 100644
index 0000000..e2243b0
--- /dev/null
+++ b/profiler/profiler/cross/amd64/toolchain.cmake
@@ -0,0 +1,39 @@
+set(CROSS_ROOTFS $ENV{ROOTFS_DIR})
+
+add_definitions(-D_TARGET_AMD64_ -DTARGET_AMD64 -D_TARGET_64BIT_ -DTARGET_64BIT -D_AMD64_ -DAMD64 -DHOST_AMD64 -D_WIN64 -DBIT64 -DHOST_64BIT -DLINUX64)
+
+set(CMAKE_SYSTEM_VERSION 1)
+set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_SYSTEM_PROCESSOR x86_64)
+
+## Specify the toolchain
+set(TOOLCHAIN "x86_64-tizen-linux-gnu")
+set(TOOLCHAIN_PREFIX ${TOOLCHAIN}-)
+
+if ("$ENV{CC}" MATCHES "lang")
+ add_compile_options(-target x86_64-tizen-linux-gnu)
+endif()
+add_compile_options(--sysroot=${CROSS_ROOTFS})
+
+if (DEFINED ENV{ENV_GCC_LIB_PATH})
+ set(GCC_LIB_PATH $ENV{ENV_GCC_LIB_PATH})
+else()
+ set(GCC_LIB_PATH /usr/lib64/gcc/${TOOLCHAIN}/9.2.0)
+endif()
+
+if ("$ENV{CC}" MATCHES "lang")
+ set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -target x86_64-linux-gnu")
+ set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B${CROSS_ROOTFS}${GCC_LIB_PATH}")
+endif()
+set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}${GCC_LIB_PATH}")
+set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} --sysroot=${CROSS_ROOTFS}")
+
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
+set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
+
+set(CMAKE_FIND_ROOT_PATH "${CROSS_ROOTFS}")
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) \ No newline at end of file