summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>2019-04-10 03:20:22 (GMT)
committerGitHub Enterprise <noreply-CODE@samsung.com>2019-04-10 03:20:22 (GMT)
commit8d2222f661cb7fcdc7c54aeec8012c61b3335b77 (patch)
tree8ad228daa4a1c7816e03d71679cad0584a1a7fda
parentc68a3c27d8dc063493d05859cc8349a6f9653b7c (diff)
downloadnnfw-8d2222f661cb7fcdc7c54aeec8012c61b3335b77.zip
nnfw-8d2222f661cb7fcdc7c54aeec8012c61b3335b77.tar.gz
nnfw-8d2222f661cb7fcdc7c54aeec8012c61b3335b77.tar.bz2
Move rootfs setting into cmake/buildtool/cross (#4958)
Move rootfs setting and check correctness into cmake/buildtool/cross Remove different variable name for each architecture rootfs Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
-rw-r--r--cmake/buildtool/config/config_aarch64-linux.cmake4
-rw-r--r--cmake/buildtool/config/config_aarch64-tizen.cmake2
-rw-r--r--cmake/buildtool/config/config_armv7l-linux.cmake4
-rw-r--r--cmake/buildtool/config/config_armv7l-tizen.cmake2
-rw-r--r--cmake/buildtool/cross/toolchain_aarch64-linux.cmake18
-rw-r--r--cmake/buildtool/cross/toolchain_aarch64-tizen.cmake44
-rw-r--r--cmake/buildtool/cross/toolchain_armv7l-linux.cmake17
-rw-r--r--cmake/buildtool/cross/toolchain_armv7l-tizen.cmake44
-rw-r--r--contrib/tflite_classify/CMakeLists.txt4
-rw-r--r--docs/howto/CrossBuildForArm.md2
10 files changed, 72 insertions, 69 deletions
diff --git a/cmake/buildtool/config/config_aarch64-linux.cmake b/cmake/buildtool/config/config_aarch64-linux.cmake
index cdde5e3..f859bbf 100644
--- a/cmake/buildtool/config/config_aarch64-linux.cmake
+++ b/cmake/buildtool/config/config_aarch64-linux.cmake
@@ -7,10 +7,6 @@ message(STATUS "Building for AARCH64 Linux")
# include linux common
include("cmake/buildtool/config/config_linux.cmake")
-if(NOT EXISTS "${ROOTFS_ARM64}/lib/aarch64-linux-gnu")
- message(FATAL_ERROR "Please prepare RootFS for ARM64")
-endif()
-
# addition for aarch64-linux
set(FLAGS_COMMON ${FLAGS_COMMON}
)
diff --git a/cmake/buildtool/config/config_aarch64-tizen.cmake b/cmake/buildtool/config/config_aarch64-tizen.cmake
index b6a3794..fa1e8b0 100644
--- a/cmake/buildtool/config/config_aarch64-tizen.cmake
+++ b/cmake/buildtool/config/config_aarch64-tizen.cmake
@@ -8,8 +8,6 @@ message(STATUS "Building for AARCH64 Tizen")
# include linux common
include("cmake/buildtool/config/config_linux.cmake")
-# TODO : support rootfs setting for tizen cross-build
-
# addition for aarch64-tizen
set(FLAGS_COMMON ${FLAGS_COMMON}
)
diff --git a/cmake/buildtool/config/config_armv7l-linux.cmake b/cmake/buildtool/config/config_armv7l-linux.cmake
index 50fb2d7..ef6dd41 100644
--- a/cmake/buildtool/config/config_armv7l-linux.cmake
+++ b/cmake/buildtool/config/config_armv7l-linux.cmake
@@ -7,10 +7,6 @@ message(STATUS "Building for ARMv7l Linux")
# include linux common
include("cmake/buildtool/config/config_linux.cmake")
-if(NOT EXISTS "${ROOTFS_ARM}/lib/arm-linux-gnueabihf")
- message(FATAL_ERROR "Please prepare RootFS for ARM")
-endif()
-
# addition for arm-linux
set(FLAGS_COMMON ${FLAGS_COMMON}
"-mcpu=cortex-a7"
diff --git a/cmake/buildtool/config/config_armv7l-tizen.cmake b/cmake/buildtool/config/config_armv7l-tizen.cmake
index 90b0317..0bbe0dd 100644
--- a/cmake/buildtool/config/config_armv7l-tizen.cmake
+++ b/cmake/buildtool/config/config_armv7l-tizen.cmake
@@ -8,8 +8,6 @@ message(STATUS "Building for ARMv7l(softfp) Tizen")
# include linux common
include("cmake/buildtool/config/config_linux.cmake")
-# TODO : support rootfs setting for tizen cross-build
-
# addition for arm-linux
set(FLAGS_COMMON ${FLAGS_COMMON}
"-mcpu=cortex-a8"
diff --git a/cmake/buildtool/cross/toolchain_aarch64-linux.cmake b/cmake/buildtool/cross/toolchain_aarch64-linux.cmake
index f7ab4f4..8d3bd8f 100644
--- a/cmake/buildtool/cross/toolchain_aarch64-linux.cmake
+++ b/cmake/buildtool/cross/toolchain_aarch64-linux.cmake
@@ -10,18 +10,22 @@ set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)
# where is the target environment
-set(ROOTFS_ARM64 $ENV{ROOTFS_DIR})
-if(NOT EXISTS "${ROOTFS_ARM64}/lib/aarch64-linux-gnu")
- set(ROOTFS_ARM64 "${CMAKE_CURRENT_LIST_DIR}/../../../tools/cross/rootfs/arm64")
+set(NNFW_SOURCE_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../..")
+set(ROOTFS_AARCH64 "${NNFW_SOURCE_ROOT}/tools/cross/rootfs/arm64")
+include("${NNFW_SOURCE_ROOT}/cmake/modules/OptionTools.cmake")
+
+envoption(ROOTFS_DIR ${ROOTFS_AARCH64})
+if(NOT EXISTS "${ROOTFS_DIR}/lib/aarch64-linux-gnu")
+ message(FATAL_ERROR "Please prepare RootFS for AARCH64")
endif()
-set(CMAKE_SYSROOT ${ROOTFS_ARM64})
-set(CMAKE_FIND_ROOT_PATH ${ROOTFS_ARM64})
+set(CMAKE_SYSROOT ${ROOTFS_DIR})
+set(CMAKE_FIND_ROOT_PATH ${ROOTFS_DIR})
set(CMAKE_SHARED_LINKER_FLAGS
- "${CMAKE_SHARED_LINKER_FLAGS} --sysroot=${ROOTFS_ARM64}"
+ "${CMAKE_SHARED_LINKER_FLAGS} --sysroot=${ROOTFS_DIR}"
CACHE INTERNAL "" FORCE)
set(CMAKE_EXE_LINKER_FLAGS
- "${CMAKE_EXE_LINKER_FLAGS} --sysroot=${ROOTFS_ARM64}"
+ "${CMAKE_EXE_LINKER_FLAGS} --sysroot=${ROOTFS_DIR}"
CACHE INTERNAL "" FORCE)
# search for programs in the build host directories
diff --git a/cmake/buildtool/cross/toolchain_aarch64-tizen.cmake b/cmake/buildtool/cross/toolchain_aarch64-tizen.cmake
index 23a6b06..5bb3929 100644
--- a/cmake/buildtool/cross/toolchain_aarch64-tizen.cmake
+++ b/cmake/buildtool/cross/toolchain_aarch64-tizen.cmake
@@ -12,18 +12,22 @@ set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++-5)
set(TIZEN_TOOLCHAIN "aarch64-tizen-linux-gnu/6.2.1")
# where is the target environment
-set(ROOTFS_ARM64 $ENV{ROOTFS_DIR})
-if(NOT EXISTS "${ROOTFS_ARM64}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}")
- set(ROOTFS_ARM64 "${CMAKE_SOURCE_DIR}/tools/cross/rootfs/arm64")
+set(NNFW_SOURCE_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../..")
+set(ROOTFS_AARCH64 "${NNFW_SOURCE_ROOT}/tools/cross/rootfs/arm64")
+include("${NNFW_SOURCE_ROOT}/cmake/modules/OptionTools.cmake")
+
+envoption(ROOTFS_DIR ${ROOTFS_AARCH64})
+if(NOT EXISTS "${ROOTFS_DIR}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}")
+ message(FATAL_ERROR "Please prepare RootFS for tizen aarch64")
endif()
-set(CMAKE_SYSROOT ${ROOTFS_ARM64})
-set(CMAKE_FIND_ROOT_PATH ${ROOTFS_ARM64})
+set(CMAKE_SYSROOT ${ROOTFS_DIR})
+set(CMAKE_FIND_ROOT_PATH ${ROOTFS_DIR})
set(CMAKE_SHARED_LINKER_FLAGS
- "${CMAKE_SHARED_LINKER_FLAGS} --sysroot=${ROOTFS_ARM64}"
+ "${CMAKE_SHARED_LINKER_FLAGS} --sysroot=${ROOTFS_DIR}"
CACHE INTERNAL "" FORCE)
set(CMAKE_EXE_LINKER_FLAGS
- "${CMAKE_EXE_LINKER_FLAGS} --sysroot=${ROOTFS_ARM64}"
+ "${CMAKE_EXE_LINKER_FLAGS} --sysroot=${ROOTFS_DIR}"
CACHE INTERNAL "" FORCE)
# search for programs in the build host directories
@@ -33,23 +37,23 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
-add_compile_options(--sysroot=${ROOTFS_ARM64})
+add_compile_options(--sysroot=${ROOTFS_DIR})
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --sysroot=${ROOTFS_ARM64}")
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --sysroot=${ROOTFS_DIR}")
-set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --sysroot=${ROOTFS_ARM64}")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --sysroot=${ROOTFS_DIR}")
-include_directories(SYSTEM ${ROOTFS_ARM64}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}/include/c++/)
-include_directories(SYSTEM ${ROOTFS_ARM64}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}/include/c++/aarch64-tizen-linux-gnu)
+include_directories(SYSTEM ${ROOTFS_DIR}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}/include/c++/)
+include_directories(SYSTEM ${ROOTFS_DIR}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}/include/c++/aarch64-tizen-linux-gnu)
add_compile_options(-Wno-deprecated-declarations) # compile-time option
add_compile_options(-D__extern_always_inline=inline) # compile-time option
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -B${ROOTFS_ARM64}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}")
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L${ROOTFS_ARM64}/lib64")
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L${ROOTFS_ARM64}/usr/lib64")
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L${ROOTFS_ARM64}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}")
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -B${ROOTFS_DIR}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}")
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L${ROOTFS_DIR}/lib64")
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L${ROOTFS_DIR}/usr/lib64")
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L${ROOTFS_DIR}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}")
-set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -B${ROOTFS_ARM64}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}")
-set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${ROOTFS_ARM64}/lib64")
-set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${ROOTFS_ARM64}/usr/lib64")
-set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${ROOTFS_ARM64}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -B${ROOTFS_DIR}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${ROOTFS_DIR}/lib64")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${ROOTFS_DIR}/usr/lib64")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${ROOTFS_DIR}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}")
diff --git a/cmake/buildtool/cross/toolchain_armv7l-linux.cmake b/cmake/buildtool/cross/toolchain_armv7l-linux.cmake
index 6c51a54..733c67b 100644
--- a/cmake/buildtool/cross/toolchain_armv7l-linux.cmake
+++ b/cmake/buildtool/cross/toolchain_armv7l-linux.cmake
@@ -2,6 +2,7 @@
# config for arm-linux
#
include(CMakeForceCompiler)
+include("${CMAKE_CURRENT_LIST_DIR}/../../modules/OptionTools.cmake")
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR armv7l)
@@ -10,18 +11,20 @@ set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)
# where is the target environment
-set(ROOTFS_ARM $ENV{ROOTFS_DIR})
-if(NOT EXISTS "${ROOTFS_ARM}/lib/arm-linux-gnueabihf")
- set(ROOTFS_ARM "${CMAKE_CURRENT_LIST_DIR}/../../../tools/cross/rootfs/arm")
+set(ROOTFS_ARM "${CMAKE_CURRENT_LIST_DIR}/../../../tools/cross/rootfs/arm")
+envoption(ROOTFS_DIR ${ROOTFS_ARM})
+
+if(NOT EXISTS "${ROOTFS_DIR}/lib/arm-linux-gnueabihf")
+ message(FATAL_ERROR "Please prepare RootFS for ARM")
endif()
-set(CMAKE_SYSROOT ${ROOTFS_ARM})
-set(CMAKE_FIND_ROOT_PATH ${ROOTFS_ARM})
+set(CMAKE_SYSROOT ${ROOTFS_DIR})
+set(CMAKE_FIND_ROOT_PATH ${ROOTFS_DIR})
set(CMAKE_SHARED_LINKER_FLAGS
- "${CMAKE_SHARED_LINKER_FLAGS} --sysroot=${ROOTFS_ARM}"
+ "${CMAKE_SHARED_LINKER_FLAGS} --sysroot=${ROOTFS_DIR}"
CACHE INTERNAL "" FORCE)
set(CMAKE_EXE_LINKER_FLAGS
- "${CMAKE_EXE_LINKER_FLAGS} --sysroot=${ROOTFS_ARM}"
+ "${CMAKE_EXE_LINKER_FLAGS} --sysroot=${ROOTFS_DIR}"
CACHE INTERNAL "" FORCE)
# search for programs in the build host directories
diff --git a/cmake/buildtool/cross/toolchain_armv7l-tizen.cmake b/cmake/buildtool/cross/toolchain_armv7l-tizen.cmake
index ffc81e6..444181a 100644
--- a/cmake/buildtool/cross/toolchain_armv7l-tizen.cmake
+++ b/cmake/buildtool/cross/toolchain_armv7l-tizen.cmake
@@ -12,18 +12,22 @@ set(CMAKE_CXX_COMPILER arm-linux-gnueabi-g++)
set(TIZEN_TOOLCHAIN "armv7l-tizen-linux-gnueabi/6.2.1")
# where is the target environment
-set(ROOTFS_ARM $ENV{ROOTFS_DIR})
-if(NOT EXISTS "${ROOTFS_ARM}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
- set(ROOTFS_ARM "${CMAKE_SOURCE_DIR}/tools/cross/rootfs/armel")
+set(NNFW_SOURCE_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../..")
+set(ROOTFS_ARM "${NNFW_SOURCE_ROOT}/tools/cross/rootfs/armel")
+include("${NNFW_SOURCE_ROOT}/cmake/modules/OptionTools.cmake")
+
+envoption(ROOTFS_DIR ${ROOTFS_ARM})
+if(NOT EXISTS "${ROOTFS_DIR}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
+ message(FATAL_ERROR "Please prepare RootFS for tizen ARM softfp")
endif()
-set(CMAKE_SYSROOT ${ROOTFS_ARM})
-set(CMAKE_FIND_ROOT_PATH ${ROOTFS_ARM})
+set(CMAKE_SYSROOT ${ROOTFS_DIR})
+set(CMAKE_FIND_ROOT_PATH ${ROOTFS_DIR})
set(CMAKE_SHARED_LINKER_FLAGS
- "${CMAKE_SHARED_LINKER_FLAGS} --sysroot=${ROOTFS_ARM}"
+ "${CMAKE_SHARED_LINKER_FLAGS} --sysroot=${ROOTFS_DIR}"
CACHE INTERNAL "" FORCE)
set(CMAKE_EXE_LINKER_FLAGS
- "${CMAKE_EXE_LINKER_FLAGS} --sysroot=${ROOTFS_ARM}"
+ "${CMAKE_EXE_LINKER_FLAGS} --sysroot=${ROOTFS_DIR}"
CACHE INTERNAL "" FORCE)
# search for programs in the build host directories
@@ -38,23 +42,23 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
add_compile_options(-mthumb)
add_compile_options(-mfpu=neon-vfpv4)
add_compile_options(-mfloat-abi=softfp)
-add_compile_options(--sysroot=${ROOTFS_ARM})
+add_compile_options(--sysroot=${ROOTFS_DIR})
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --sysroot=${ROOTFS_ARM}")
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --sysroot=${ROOTFS_DIR}")
-set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --sysroot=${ROOTFS_ARM}")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --sysroot=${ROOTFS_DIR}")
-include_directories(SYSTEM ${ROOTFS_ARM}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/)
-include_directories(SYSTEM ${ROOTFS_ARM}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/armv7l-tizen-linux-gnueabi)
+include_directories(SYSTEM ${ROOTFS_DIR}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/)
+include_directories(SYSTEM ${ROOTFS_DIR}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/armv7l-tizen-linux-gnueabi)
add_compile_options(-Wno-deprecated-declarations) # compile-time option
add_compile_options(-D__extern_always_inline=inline) # compile-time option
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -B${ROOTFS_ARM}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L${ROOTFS_ARM}/lib")
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L${ROOTFS_ARM}/usr/lib")
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L${ROOTFS_ARM}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -B${ROOTFS_DIR}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L${ROOTFS_DIR}/lib")
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L${ROOTFS_DIR}/usr/lib")
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L${ROOTFS_DIR}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
-set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -B${ROOTFS_ARM}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
-set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${ROOTFS_ARM}/lib")
-set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${ROOTFS_ARM}/usr/lib")
-set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${ROOTFS_ARM}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -B${ROOTFS_DIR}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${ROOTFS_DIR}/lib")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${ROOTFS_DIR}/usr/lib")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${ROOTFS_DIR}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
diff --git a/contrib/tflite_classify/CMakeLists.txt b/contrib/tflite_classify/CMakeLists.txt
index 3ae4adc..c0bf627 100644
--- a/contrib/tflite_classify/CMakeLists.txt
+++ b/contrib/tflite_classify/CMakeLists.txt
@@ -10,8 +10,8 @@ list(APPEND SOURCES "src/InferenceInterface.cc")
find_package(OpenCV REQUIRED)
find_package(Boost REQUIRED COMPONENTS system filesystem)
-# Without this line, this appliation couldn't search the opencv library that were already installed in ${ROOTFS_ARM}/usr/lib/arm-linux-gnueabihf directory
-set(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${ROOTFS_ARM}/usr/lib/arm-linux-gnueabihf -Wl,--rpath=${ROOTFS_ARM}/lib/arm-linux-gnueabihf")
+# Without this line, this appliation couldn't search the opencv library that were already installed in ${ROOTFS_DIR}/usr/lib/arm-linux-gnueabihf directory
+set(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${ROOTFS_DIR}/usr/lib/arm-linux-gnueabihf -Wl,--rpath=${ROOTFS_DIR}/lib/arm-linux-gnueabihf")
add_executable(tflite_classify ${SOURCES})
target_include_directories(tflite_classify PRIVATE src)
diff --git a/docs/howto/CrossBuildForArm.md b/docs/howto/CrossBuildForArm.md
index 67d1eca..92e51ba 100644
--- a/docs/howto/CrossBuildForArm.md
+++ b/docs/howto/CrossBuildForArm.md
@@ -94,7 +94,7 @@ If you used `ROOTFS_DIR` to prepare in alternative folder, you should also give
CROSS_BUILD=1 TARGET_ARCH=armv7l make all install
# If ROOTFS_DIR is in alternative folder
-ROOTFS_DIR=ROOTFS_ARM=/path/to/your/rootfs/arm \
+ROOTFS_DIR=/path/to/your/rootfs/arm \
CROSS_BUILD=1 TARGET_ARCH=armv7l make all install
```