AM3352: ti-processor-sdk-linux-am335x-evm-09.01.00.001内核编译报错

Part Number: AM3352

各位专家好!

我在使用ti-processor-sdk-linux-am335x-evm-09.01.00.001编译Linux内核时,报如下错误。

error: cannot load plugin ./scripts/gcc-plugins/arm_ssp_per_task_plugin.so: ./scripts/gcc-plugins/arm_ssp_per_task_plugin.so: undefined symbol: _ZN8opt_pass14set_pass_paramEjb

这个怎么定位?

完整的编译信息如下。

make ARCH=arm CROSS_COMPILE=arm-oe-linux-gnueabi- uImage
  SYSHDR  arch/arm/include/generated/uapi/asm/unistd-oabi.h
  SYSHDR  arch/arm/include/generated/uapi/asm/unistd-eabi.h
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  LEX     scripts/dtc/dtc-lexer.lex.c
  YACC    scripts/dtc/dtc-parser.tab.[ch]
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
  HOSTCC  scripts/dtc/libfdt/fdt.o
  HOSTCC  scripts/dtc/libfdt/fdt_ro.o
  HOSTCC  scripts/dtc/libfdt/fdt_wip.o
  HOSTCC  scripts/dtc/libfdt/fdt_sw.o
  HOSTCC  scripts/dtc/libfdt/fdt_rw.o
  HOSTCC  scripts/dtc/libfdt/fdt_strerror.o
  HOSTCC  scripts/dtc/libfdt/fdt_empty_tree.o
  HOSTCC  scripts/dtc/libfdt/fdt_addresses.o
  HOSTCC  scripts/dtc/libfdt/fdt_overlay.o
  HOSTCC  scripts/dtc/fdtoverlay.o
  HOSTLD  scripts/dtc/fdtoverlay
  HOSTCXX scripts/gcc-plugins/arm_ssp_per_task_plugin.so
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/sorttable
  HOSTCC  scripts/asn1_compiler
  SYSNR   arch/arm/include/generated/asm/unistd-nr.h
  GEN     arch/arm/include/generated/asm/mach-types.h
  SYSTBL  arch/arm/include/generated/calls-oabi.S
  SYSTBL  arch/arm/include/generated/calls-eabi.S
  CC      scripts/mod/empty.o
cc1: error: cannot load plugin ./scripts/gcc-plugins/arm_ssp_per_task_plugin.so: ./scripts/gcc-plugins/arm_ssp_per_task_plugin.so: undefined symbol: _ZN8opt_pass14set_pass_paramEjb
make[1]: *** [scripts/Makefile.build:250:scripts/mod/empty.o] 错误 1

非常感谢!

  • 我现在换成最新版本的9.3也是同样的问题。

  • Thank you for your report. I am not seeing your exact behavior, but there are at least 2 major changes that need to be made to the AM335x Linux SDK documentation for building the kernel. Let's walk through both of those changes together.

    First, can I get you to run the top-level makefile build? 

    Like this:

    /path/to/ti-processor-sdk-linux-am335x-evm-09.01.00.001$ make linux

    First, I had to install some additional libraries based on this e2e thread:
    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1335480/am3358-ep-gmp-h-no-such-file-or-directory

    sudo apt-get install libgmp3-dev
    sudo apt-get install libmpc-dev

    I have filed a bug against the SDK docs to add some information about these necessary Libraries.

    Now that we have those libraries installed, I am able to see your behavior with this modified set of steps:

    export CROSS_COMPILE_32="/path/to/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-"
    make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" distclean
    make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" multi_v7_defconfig ti_multi_v7_prune.config no_smp.config
    make -j<thread_number> ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" zImage
    ...
    cc1: error: cannot load plugin ./scripts/gcc-plugins/arm_ssp_per_task_plugin.so: ./scripts/gcc-plugins/arm_ssp_per_task_plugin.so: undefined symbol: _ZN8opt_pass14set_pass_paramEjb
    cc1: error: cannot load plugin ./scripts/gcc-plugins/arm_ssp_per_task_plugin.so: ./scripts/gcc-plugins/arm_ssp_per_task_plugin.so: undefined symbol: _ZN8opt_pass14set_pass_paramEjb
    make[1]: *** [scripts/Makefile.build:250: scripts/mod/empty.o] Error 1
    make[1]: *** Waiting for unfinished jobs....
    make[1]: *** [scripts/Makefile.build:118: scripts/mod/devicetable-offsets.s] Error 1
    make: *** [Makefile:1288: prepare0] Error 2

    The next step is to use the correct toolchain. When you look at that "make linux" output in the previous reply, you will see that we are NOT using the toolchain that is currently documented in SDK 9.1 or SDK 9.3:
    https://software-dl.ti.com/processor-sdk-linux/esd/AM335X/09_01_00_001/exports/docs/linux/Foundational_Components_Kernel_Users_Guide.html

    Instead, the makefile is using a toolchain in a separate directory, called external-toolchain-dir, as discussed here: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1333628/am3359-compile-kernel-sdk-9-01-00-001

    I have filed another bug against this toolchain documentation issue.

    I am running out of time for today. Can I get you to try again, using the toolchain in that external-toolchain-dir?

  • Hi Taylor

    Thanks a lot for your reply.

    I will try it according to your guidance.

    Yours sincerely

    Qin Long

  • Hi Taylor

    This issue has been resolved

    Yours sincerely

    Qin Long