This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] AM5728:使用 SDK 版本09.03.06.05无法交叉编译 am5728的简单 hello_world.c

Guru**** 2460850 points
Other Parts Discussed in Thread: AM5728

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1467324/am5728-unable-to-cross-compile-simple-hello_world-c-for-am5728-using-sdk-version-09-03-06-05

器件型号:AM5728

工具与软件:

您好!

我使用的是 https://software-dl.ti.com/processor-sdk-linux/esd/AM57X/09_03_06_05/exports/docs/linux/Overview/GCC_ToolChain.html#链接 使用编译简单的 hello_world.c (如链接中所述) Linux SDK 9.03.06.05 内容 AM5728 EVM 但我遇到了编译错误:-

hello_world.c 的内容

#include <stdio.h>

int main() {
printf ("Hello World from TI!!!\n");
return 0;
}

编译时出错。

root@TI-SDK-9:/tmp# ${CROSS_COMPILE_32}gcc --sysroot=${SYSROOT_32} hello_world.c -o hello_world
In file included from /opt/ti-processor-sdk-linux-am57xx-evm-09_03_06_05/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/gnu/stubs.h:23,
from /opt/ti-processor-sdk-linux-am57xx-evm-09_03_06_05/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/features.h:514,
from /opt/ti-processor-sdk-linux-am57xx-evm-09_03_06_05/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/bits/libc-header-start.h:33,
from /opt/ti-processor-sdk-linux-am57xx-evm-09_03_06_05/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/stdio.h:27,
from hello_world.c:1:
/opt/ti-processor-sdk-linux-am57xx-evm-09_03_06_05/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/gnu/stubs-32.h:7:11: fatal error: gnu/stubs-soft.h: No such file or directory
7 | # include <gnu/stubs-soft.h>
| ^~~~~~~~
compilation terminated.

I have installed Linux SDK 09.03.06.05 on ubuntu 22.04.

Please help!

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Vishal、

    您是否获取了环境设置?

    您是否检查过您正在使用的变量是否已导出/定义?

    该文档是为许多其他器件制作的、因此我认为它不能开包即用、适用于所有器件。

    确保变量 cross_compile_32指向正确的目录、并且您使用的是正确的 CFLAGS。 请参阅父 SDK 目录中的 Rules.make 文件。

    -若苏厄

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    以下是我编译所遵循的步骤:-

    root@TI-SDK-9:/tmp# cat set_paths_9.03.sh 
    SDK_INSTALL_DIR=/opt/ti-processor-sdk-linux-am57xx-evm-09_03_06_05/
    export CROSS_COMPILE_32="${SDK_INSTALL_DIR}/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-"
    export SYSROOT_32="${SDK_INSTALL_DIR}/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi"
    export CC_32="${CROSS_COMPILE_32}gcc --sysroot=${SYSROOT_32}"
    export ENV_SETUP_32="${SDK_INSTALL_DIR}/linux-devkit/environment-setup-armv7at2hf-neon-oe-linux-gnueabi"
    
    
    root@TI-SDK-9:/tmp# source ./set_paths_9.03.sh 
    root@TI-SDK-9:/tmp# echo $CROSS_COMPILE_32 
    /opt/ti-processor-sdk-linux-am57xx-evm-09_03_06_05//linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-
    
    
    root@TI-SDK-9:/tmp# source ${ENV_SETUP_32}
    
    root@TI-SDK-9:/tmp# ${CROSS_COMPILE_32}gcc --sysroot=${SYSROOT_32} ./hello_world.c -o hello_world
    In file included from /opt/ti-processor-sdk-linux-am57xx-evm-09_03_06_05/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/gnu/stubs.h:23,
                     from /opt/ti-processor-sdk-linux-am57xx-evm-09_03_06_05/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/features.h:514,
                     from /opt/ti-processor-sdk-linux-am57xx-evm-09_03_06_05/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/bits/libc-header-start.h:33,
                     from /opt/ti-processor-sdk-linux-am57xx-evm-09_03_06_05/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/stdio.h:27,
                     from ./hello_world.c:1:
    /opt/ti-processor-sdk-linux-am57xx-evm-09_03_06_05/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/gnu/stubs-32.h:7:11: fatal error: gnu/stubs-soft.h: No such file or directory
        7 | # include <gnu/stubs-soft.h>
          |           ^~~~~~~~
    compilation terminated.


    请帮助!

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Vishal

    我在 SDK 顶层目录中按以下步骤编译:

    source environment-setup
    export CROSS_COMPILE_32=/mnt/4a1d5549-6f29-46e7-aaf3-d2815c00be93/sdk_s/am57x/ti-processor-sdk-linux-am57xx-evm-09_03_06_05_prod_release/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-
    ${CROSS_COMPILE_32}gcc ${CFLAGS} helloworld.c -o helloworld
    ll
    total 72
    drwxr-xr-x  3 josue josue  4096 Jan 28 13:26 ./
    drwxrwxr-x 13 josue josue  4096 Dec 30 13:27 ../
    -rw-r--r--  1 josue josue  4045 Dec 30 13:27 environment-setup
    -rw-r--r--  1 josue josue  5028 Dec 30 13:27 environment-setup-armv7at2hf-neon-oe-linux-gnueabi
    -rwxrwxr-x  1 josue josue 10336 Jan 28 13:26 helloworld*
    -rw-rw-r--  1 josue josue    90 Jan 28 11:19 helloworld.c
    -rw-r--r--  1 josue josue   848 Apr  5  2011 post-relocate-setup.sh
    -rw-r--r--  1 josue josue 22387 Apr  5  2011 site-config-armv7at2hf-neon-oe-linux-gnueabi
    drwxr-xr-x  4 josue josue  4096 Dec 17 23:17 sysroots/
    -rw-r--r--  1 josue josue   124 Apr  5  2011 version-armv7at2hf-neon-oe-linux-gnueabi
    

    此致!

    若苏厄

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    您的建议有效。

    实际上、  

    我 正在运行低于->的命令
     source environment-setup-armv7at2hf-none-oe-linux-gnueabi  我得到了我发布的错误。

    我之所以这样做、是因为在链路中  https://software-dl.ti.com/processor-sdk-linux/esd/AM57X/09_03_06_05/exports/docs/linux/Overview/GCC_ToolChain.html、 有人提到应采用以下办法:

    ENV_Setup_32

    linux-devkit/environment-setup-armv7at2hf-none-oe-linux-gnueabi

    一个外壳脚本、用于设置环境变量以编译 ARMv8 Linux 目标的二进制文件

    它在任何地方都没有被提及使用  环境设置  用于设置环境的头文件。

    应 更正文档!

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    感谢您为 Vishal 指出这一点。 我将创建 JIRA 来修复此问题。

    注意: 如果以上答案可以解决您的问题、请将帖子标记为"已回答"

    -若苏厄

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 :  

     我 试图编译 qt-5.15.7 (这个版本在 Linux SDK 9_03中支持 am5728 ),以便 它可以交叉编译 运行 Linux SDK 9_03的 am5728的 Qt 应用程序。 我的问题如下面所述的步骤所示:-

    source /opt/ti-processor-sdk-linux-am57xx-evm-09_03_06_05/linux-devkit/environment-setup
    
    ./configure     -prefix=/usr/local/Qt-5.15.7     -xplatform  linux-arm-oe-gnueabi-g++     -opensource     -confirm-license     -optimized-qmake     -reduce-exports     -no-pch     -no-gtk     -no-opengl     -no-sql-odbc     -no-sql-sqlite     -no-dbus     -no-ssl
    + cd qtbase
    + /home/cdot/Downloads/qt-everywhere-src-5.15.7/qtbase/configure -top-level -prefix=/usr/local/Qt-5.15.7 -xplatform linux-arm-oe-gnueabi-g++ -opensource -confirm-license -optimized-qmake -reduce-exports -no-pch -no-gtk -no-opengl -no-sql-odbc -no-sql-sqlite -no-dbus -no-ssl
    Creating qmake...
    .In file included from /opt/ti-processor-sdk-linux-am57xx-evm-09_03_06_05/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/gnu/stubs.h:23:0,
                     from /opt/ti-processor-sdk-linux-am57xx-evm-09_03_06_05/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/features.h:514,
                     from /usr/include/x86_64-linux-gnu/c++/7/bits/os_defines.h:39,
                     from /usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:533,
                     from /usr/include/c++/7/type_traits:38,
                     from /home/cdot/Downloads/qt-everywhere-src-5.15.7/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:45,
                     from /home/cdot/Downloads/qt-everywhere-src-5.15.7/qtbase/include/QtCore/qglobal.h:1,
                     from /home/cdot/Downloads/qt-everywhere-src-5.15.7/qtbase/qmake/library/qmake_global.h:32,
                     from /home/cdot/Downloads/qt-everywhere-src-5.15.7/qtbase/qmake/library/qmakeparser.h:32,
                     from /home/cdot/Downloads/qt-everywhere-src-5.15.7/qtbase/qmake/library/qmakeevaluator.h:36,
                     from /home/cdot/Downloads/qt-everywhere-src-5.15.7/qtbase/qmake/project.h:32,
                     from /home/cdot/Downloads/qt-everywhere-src-5.15.7/qtbase/qmake/main.cpp:30:
    /opt/ti-processor-sdk-linux-am57xx-evm-09_03_06_05/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/gnu/stubs-32.h:7:11: fatal error: gnu/stubs-soft.h: No such file or directory
     # include <gnu/stubs-soft.h>
               ^~~~~~~~~~~~~~~~~~
    compilation terminated.
    make: *** [main.o] Error 1




    我已经根据 configure 命令的要求在 qtbase/mkspecs/文件夹中创建了一个名为 linux-arm-oe-gnueabi-g++的文件夹。 请帮助解决问题。  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Vishal  

    确保变量 cross_compile_32指向正确的目录并且您使用的是正确的 CFLAGS。 请参阅父 SDK 目录中的 Rules.make 文件。[/QUOT]

    出现的误差是因为未传递正确的 C 标志。
     查看几个链接,当你在 google 中搜索这个错误

    -若苏厄