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.

AM3352: ti-processor-sdk-linux-am335x-evm-09.01.00.001 build error

Part Number: AM3352

Hi,

I installed ti-processor-sdk-linux-am335x-evm-09.01.00.001-Linux-x86-Install.bin at my ubuntu 22.04 (LTS) 64bit virtual machine (VBOX)

see below 

howdoudo@howdoudo-VirtualBox:plugin$ uname -a
Linux howdoudo-VirtualBox 6.5.0-17-generic #17~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 16 14:32:32 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

After install SDK and Prerequisites,

I run "source linux-devkit/environment-setup"

then run make

While building kernel image, i got an error message like below

...

make[1]: Entering directory '/home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/board-support/ti-linux-kernel-6.1.46+gitAUTOINC+1d4b5da681-g1d4b5da681'
SYNC include/config/auto.conf.cmd
HOSTCXX scripts/gcc-plugins/arm_ssp_per_task_plugin.so
In file included from /home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/system.h:531,
from /home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/gcc-plugin.h:28,
from scripts/gcc-plugins/gcc-common.h:7,
from scripts/gcc-plugins/arm_ssp_per_task_plugin.c:3:
/home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/stdint.h:109: warning: "__INT64_C" redefined
109 | # define __INT64_C(c) c ## LL
|
<built-in>: note: this is the location of the previous definition
In file included from /home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/system.h:531,
from /home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/gcc-plugin.h:28,
from scripts/gcc-plugins/gcc-common.h:7,
from scripts/gcc-plugins/arm_ssp_per_task_plugin.c:3:
/home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/stdint.h:110: warning: "__UINT64_C" redefined
110 | # define __UINT64_C(c) c ## ULL
|
<built-in>: note: this is the location of the previous definition
In file included from /home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/system.h:535,
from /home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/gcc-plugin.h:28,
from scripts/gcc-plugins/gcc-common.h:7,
from scripts/gcc-plugins/arm_ssp_per_task_plugin.c:3:
/home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/inttypes.h:290:17: warning: declaration of ‘intmax_t imaxabs(intmax_t ’ conflicts with built-in declaration ‘long int imaxabs(long int)’ [-Wbuiltin-declaration-mismatch]
290 | extern intmax_t imaxabs (intmax_t __n) __THROW __attribute__ ((__const__));
| ^~~~~~~
In file included from scripts/gcc-plugins/gcc-common.h:18,
from scripts/gcc-plugins/arm_ssp_per_task_plugin.c:3:
/home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/tree.h: In function ‘hashval_t struct_ptr_hash(const void*)’:
/home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/tree.h:5184:10: error: cast from ‘const void*’ to ‘intptr_t’ {aka ‘int’} loses precision [-fpermissive]
5184 | return (intptr_t)*x >> 4;
| ^~~~~~~~~~~~
In file included from /home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/tree-pretty-print.h:25,
from scripts/gcc-plugins/gcc-common.h:52,
from scripts/gcc-plugins/arm_ssp_per_task_plugin.c:3:
/home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/pretty-print.h: In function ‘void pp_wide_integer(pretty_printer*, long int)’:
/home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/hwint.h:110:33: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘long int’ [-Wformat=]
110 | #define HOST_WIDE_INT_PRINT_DEC "%" PRId64
/home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/pretty-print.h:329:46: note: in definition of macro ‘pp_scalar’
329 | sprintf (pp_buffer (PP)->digit_buffer, FORMAT, SCALAR); \
| ^~~~~~
/home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/pretty-print.h:430:18: note: in expansion of macro ‘HOST_WIDE_INT_PRINT_DEC’
430 | pp_scalar (pp, HOST_WIDE_INT_PRINT_DEC, i);
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/system.h:535,
from /home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/gcc-plugin.h:28,
from scripts/gcc-plugins/gcc-common.h:7,
from scripts/gcc-plugins/arm_ssp_per_task_plugin.c:3:
/home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/usr/include/inttypes.h:57:41: note: format string is defined here
57 | # define PRId64 __PRI64_PREFIX "d"
In file included from /home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/hash-table.h:252,
from /home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/coretypes.h:482,
from /home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/gcc-plugin.h:29,
from scripts/gcc-plugins/gcc-common.h:7,
from scripts/gcc-plugins/arm_ssp_per_task_plugin.c:3:
/home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/hash-traits.h: In instantiation of ‘static hashval_t pointer_hash<Type>::hash(Type* const&) [with Type = const void; hashval_t = unsigned int; pointer_hash<Type>::value_type = const void*]’:
/home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/hash-map-traits.h:50:18: required from ‘static hashval_t simple_hashmap_traits<H, Value>::hash(const key_type&) [with H = default_hash_traits<const void*>; Value = mem_usage_pair<mem_usage>; hashval_t = unsigned int; simple_hashmap_traits<H, Value>::key_type = const void*]’
/home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/hash-map.h:185:63: required from ‘Value* hash_map< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::get(const Key&) [with KeyId = const void*; Value = mem_usage_pair<mem_usage>; Traits = simple_hashmap_traits<default_hash_traits<const void*>, mem_usage_pair<mem_usage> >; hash_map< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::Key = const void*]’
/home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/mem-stats.h:514:48: required from ‘T* mem_alloc_description<T>::release_instance_overhead(void*, size_t, bool) [with T = mem_usage; size_t = long unsigned int]’
/home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/hash-table.h:689:22: required from ‘hash_table<Descriptor, Lazy, Allocator>::~hash_table() [with Descriptor = hash_map<int_hash<short unsigned int, 0>, short unsigned int>::hash_entry; bool Lazy = false; Allocator = xcallocator]’
/home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/hash-map.h:39:19: required from here
/home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/external-toolchain-dir/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../lib/gcc/arm-none-linux-gnueabihf/11.3.1/plugin/include/hash-traits.h:166:23: error: cast from ‘pointer_hash<const void>::value_type’ {aka ‘const void*’} to ‘intptr_t’ {aka ‘int’} loses precision [-fpermissive]
166 | return (hashval_t) ((intptr_t)candidate >> 3);
| ^~~~~~~~~~~~~~~~~~~
make[3]: *** [scripts/gcc-plugins/Makefile:54: scripts/gcc-plugins/arm_ssp_per_task_plugin.so] Error 1
make[2]: *** [scripts/Makefile.build:502: scripts/gcc-plugins] Error 2
make[1]: *** [Makefile:1273: scripts] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/board-support/ti-linux-kernel-6.1.46+gitAUTOINC+1d4b5da681-g1d4b5da681'
make: *** [makerules/Makefile_linux:8: linux] Error 2

It seems intptr_t is not working in my ubuntu.

I attached my environment-setup 

Please let me know how to fix above error

SDK_PATH="/home/howdoudo/ti-processor-sdk-linux-am335x-evm-09.01.00.001/linux-devkit"
if [ -z "$ZSH_NAME" ] && [ "x$0" = "x./environment-setup" ]; then
    echo "Error: This script needs to be sourced. Please run as \". ./environment-setup\""
    exit 1
else
    if [ -n "$BASH_SOURCE" ]; then
        SDK_PATH="`dirname $BASH_SOURCE`"
    fi
    SDK_PATH=`readlink -f "$SDK_PATH"`
    export SDK_PATH
fi
export SDK_SYS=x86_64-arago-linux
export REAL_MULTIMACH_TARGET_SYS=armv7at2hf-neon-oe-linux-gnueabi
export TARGET_SYS=arm-oe-linux-gnueabi
export TARGET_PREFIX=$TARGET_SYS-
export SDK_PATH_NATIVE=$SDK_PATH/sysroots/$SDK_SYS
export SDK_PATH_TARGET=$SDK_PATH/sysroots/$REAL_MULTIMACH_TARGET_SYS
export PATH=$SDK_PATH_NATIVE/usr/bin:$SDK_PATH_NATIVE/usr/bin/arm-oe-linux-gnueabi:$PATH
export CPATH=$SDK_PATH_TARGET/usr/include:$CPATH
export PKG_CONFIG_SYSROOT_DIR=$SDK_PATH_TARGET
export PKG_CONFIG_PATH=$SDK_PATH_TARGET/usr/lib/pkgconfig:$SDK_PATH_TARGET/usr/share/pkgconfig
export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
export CONFIG_SITE=$SDK_PATH/site-config-$REAL_MULTIMACH_TARGET_SYS
export CC="${TARGET_PREFIX}gcc --sysroot=$SDK_PATH_TARGET"
export CXX="${TARGET_PREFIX}g++ --sysroot=$SDK_PATH_TARGET"
export GDB=${TARGET_PREFIX}gdb
export CPP="${TARGET_PREFIX}gcc -E --sysroot=$SDK_PATH_TARGET"
export LD="${TARGET_PREFIX}ld --sysroot=$SDK_PATH_TARGET"
export NM=${TARGET_PREFIX}nm
export AS=${TARGET_PREFIX}as
export AR=${TARGET_PREFIX}ar
export RANLIB=${TARGET_PREFIX}ranlib
export OBJCOPY=${TARGET_PREFIX}objcopy
export OBJDUMP=${TARGET_PREFIX}objdump
export STRIP=${TARGET_PREFIX}strip
export CONFIGURE_FLAGS="--target=arm-oe-linux-gnueabi --host=arm-oe-linux-gnueabi --build=x86_64-linux --with-libtool-sysroot=$SDK_PATH_TARGET"
export CPPFLAGS=" -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=$SDK_PATH_TARGET"
export CFLAGS="$CPPFLAGS"
export CXXFLAGS="$CPPFLAGS"
export LDFLAGS=" --sysroot=$SDK_PATH_TARGET"
export OECORE_NATIVE_SYSROOT=$SDK_PATH_NATIVE
export OECORE_TARGET_SYSROOT=$SDK_PATH_TARGET
export SDKTARGETSYSROOT=$SDK_PATH_TARGET
export OECORE_ACLOCAL_OPTS="-I $SDK_PATH_NATIVE/usr/share/aclocal"
export OECORE_DISTRO_VERSION="2023.04"
export OECORE_SDK_VERSION="2023.04"
export OECORE_BASELIB="lib"
export OECORE_TARGET_ARCH="arm"
export OECORE_TARGET_OS="linux-gnueabi"

# Append environment subscripts
if [ -d "$OECORE_TARGET_SYSROOT/environment-setup.d" ]; then
    for envfile in $OECORE_TARGET_SYSROOT/environment-setup.d/*.sh; do
            . $envfile
    done
fi
if [ -d "$OECORE_NATIVE_SYSROOT/environment-setup.d" ]; then
    for envfile in $OECORE_NATIVE_SYSROOT/environment-setup.d/*.sh; do
            . $envfile
    done
fi
export PS1="\[\e[32;1m\][linux-devkit]\[\e[0m\]:\w> "
export PATH=$SDK_PATH_NATIVE/usr/bin/${QT_DIR_NAME}:$PATH
export OE_QMAKE_CFLAGS="$CFLAGS"
export OE_QMAKE_CXXFLAGS="$CXXFLAGS"
export OE_QMAKE_LDFLAGS="$LDFLAGS"
export OE_QMAKE_CC="$CC"
export OE_QMAKE_CXX="$CXX"
export OE_QMAKE_LINK="$CXX"
export OE_QMAKE_AR="$AR"
export OE_QMAKE_PREFIX_QT=/usr
export OE_QMAKE_LIBDIR_QT=/usr/lib
export OE_QMAKE_INCDIR_QT=/usr/include/${QT_DIR_NAME}
export OE_QMAKE_HOST_BINDIR_QT=$SDK_PATH_NATIVE/usr/bin/${QT_BIN_PREFIX}
export OE_QMAKE_MOC=$SDK_PATH_NATIVE/usr/bin/${QT_BIN_PREFIX}moc${QT_BIN_SUFFIX}
export OE_QMAKE_UIC=$SDK_PATH_NATIVE/usr/bin/${QT_BIN_PREFIX}uic${QT_BIN_SUFFIX}
export OE_QMAKE_UIC3=$SDK_PATH_NATIVE/usr/bin/${QT_BIN_PREFIX}uic3${QT_BIN_SUFFIX}
export OE_QMAKE_RCC=$SDK_PATH_NATIVE/usr/bin/${QT_BIN_PREFIX}rcc${QT_BIN_SUFFIX}
export OE_QMAKE_QDBUSCPP2XML=$SDK_PATH_NATIVE/usr/bin/${QT_BIN_PREFIX}qdbuscpp2xml${QT_BIN_SUFFIX}
export OE_QMAKE_QDBUSXML2CPP=$SDK_PATH_NATIVE/usr/bin/${QT_BIN_PREFIX}qdbusxml2cpp${QT_BIN_SUFFIX}
export OE_QMAKE_QT_CONFIG=$SDK_PATH_TARGET/usr/lib/${QT_DIR_NAME}/mkspecs/qconfig.pri
export OE_QMAKE_STRIP="echo"
export QMAKESPEC=$SDK_PATH_TARGET/usr/lib/${QT_DIR_NAME}/mkspecs/linux-oe-g++
export QMAKE_DEFAULT_LIBDIRS=${QT_QMAKE_LIBDIR_QT}
export QMAKE_DEFAULT_INCDIRS=${QT_QMAKE_INCDIR_QT}

  • Hi Edward,

    I run "source linux-devkit/environment-setup"

    then run make

    Please don't source that environment-setup file, but directly run command 'make linux' to compile the kernel.

  • Hi,

    Thanks to your help

    Building kernel successfully,

    then when I have to run "source linux-devkit/environment-setup" for building something ?

    and I have 1 more question,

    I will not use LCD display, then what kind of targets can be removed from default MAKE_ALL_TARGETS ?

    MAKE_ALL_TARGETS?= pru-icss matrix-gui cryptodev u-boot linux linux-dtbs refresh-screen mmwavegesture-hmi evse-hmi protection-relays-hmi ti-sgx-ddk-km

  • Hi Edward,

    then when I have to run "source linux-devkit/environment-setup" for building something ?

    I don't use this env setup, but I think you can use it for compiling your own user space applications.

    I will not use LCD display, then what kind of targets can be removed from default MAKE_ALL_TARGETS ?

    MAKE_ALL_TARGETS?= pru-icss matrix-gui cryptodev u-boot linux linux-dtbs refresh-screen mmwavegesture-hmi evse-hmi protection-relays-hmi ti-sgx-ddk-km

    I currently don't have AM335x SDK 9.1 installed and cannot check what "pru-icss" is for, but I guess it is for a pru-icss example.

    "cryptodev" is a kernel driver providing access to kernel crypto API for user space applications. If you don't know what it is, you likely don't need it.

    Then you would need "u-boot linux linux-dtbs". The rest of the targets are display related.

    Please note that the "linux" target automatically invoke "linux-dtbs".

  • Hi,

    thanks to your help

    you can close this ticket