如何使用 LTTng 跟踪 arm-linux-gnueabi 目标平台的交叉编译应用程序?

问题描述

我正在构建 HelloWorld example application。但我已经将其更改为针对工具链 arm-none-linux-gnueabi。

如果编译器是如下原生的,没问题,它编译。

cmake_minimum_required(VERSION 3.10.2)

set(CMAKE_SYstem_NAME Generic)

set(CMAKE_SYstem_PROCESSOR arm)

set(CMAKE_CROSSCOMPILING 1)

set(CMAKE_BUILD_IMAGE_VERSION 1)
   

set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
 
set(CMAKE_EXE_LINKER_FLAGS " -Wl,--no-as-needed -ldl -llttng-ust")

   
project(HelloWorld LANGUAGES C CXX)
    

include_directories(/usr/lib/x86_64-linux-gnu)

include_directories(${CMAKE_CURRENT_SOURCE_DIR})

include_directories(/usr/include/x86_64-linux-gnu/lttng)
      


add_library(hello-tp STATIC hello-tp.c hello-tp.h)
  

add_library(hello hello.c)

target_link_libraries(hello hello-tp)


target_include_directories(hello PUBLIC /usr/include/x86_64-linux-gnu/lttng)

但是如果我想通过添加以下两行来交叉编译:

set(CMAKE_C_COMPILER "/usr/bin/arm-linux-gnueabi-gcc")
set(CMAKE_CXX_COMPILER "/usr/bin/arm-linux-gnueabi-g++")

如果我本地安装 lttng -> 为本地编译器成功构建 当我尝试为 arm-linux-gnueabi-gcc 编译器构建应用程序时 - 我收到以下错误

Fatal error: lttng/tracepoint.h: No such file or directory 

#include <lttng/tracepoint.h> 

如何让 lttng 跟踪交叉编译的应用程序?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)