NVIDIA/jetson-rdma-picoevb

Build issue with 18.04 LTS on X86 PC

apexintern1 opened this issue · 4 comments

FATAL: parse error in symbol dump file
scripts/Makefile.modpost:92: recipe for target '__modpost' failed
make[2]: *** [__modpost] Error 1
Makefile:1678: recipe for target 'modules' failed
make[1]: *** [modules] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-137-generic'
Makefile:19: recipe for target 'modules' failed
make: *** [modules] Error 2

I am getting these errors when I run the ./build-for-pc-native.sh script.

Environment is 18.04 LTS on X86 PC

Can anyone explain in detail, on how to resolve the issue?
Thank you in advance.

Tasks

No tasks being tracked yet.

you need to add tab and/or -w in the grep command in the nvidia-ko-to-module-symvers in the echo command. Something like below:
--- a/kernel-module/nvidia-ko-to-module-symvers
+++ b/kernel-module/nvidia-ko-to-module-symvers
@@ -11,14 +11,14 @@ syms+=(nvidia_p2p_dma_unmap_pages)

nvidia_ko_fn="$1"
symvers_fn="$2"

+echo "nvidia ko file ${nvidia_ko_fn}"
touch "${symvers_fn}"
for sym in "${syms[@]}"; do

  • crc="$(objdump -t "${nvidia_ko_fn}" | grep "_crc${sym}" | awk '{print $1}')"
  • crc="$(objdump -t "${nvidia_ko_fn}" | grep -w "_crc${sym}" | awk '{print $1}')"
    if [ -z "${crc}" ]; then
    echo "Warning: Can't find symbol ${sym} in ${nvidia_ko_fn}; assuming CONFIG_MODVERSIONS=n so setting CRC=0"
    crc=00000000
    fi
    sed -i '/${sym}/d' "${symvers_fn}"
  • echo "0x${crc} ${sym} ${nvidia_ko_fn} EXPORT_SYMBOL" >> ${symvers_fn}
  • echo "0x${crc} ${sym} ${nvidia_ko_fn} EXPORT_SYMBOL " >> ${symvers_fn}
    done

May I ask what that means?
--- a/kernel-module/nvidia-ko-to-module-symvers
+++ b/kernel-module/nvidia-ko-to-module-symvers
@@ -11,14 +11,14 @@ syms+=(nvidia_p2p_dma_unmap_pages)

And I didn't solve the problem by following this method.
[#!/bin/bash

syms=()
syms+=(nvidia_p2p_init_mapping)
syms+=(nvidia_p2p_destroy_mapping)
syms+=(nvidia_p2p_get_pages)
syms+=(nvidia_p2p_put_pages)
syms+=(nvidia_p2p_free_page_table)
syms+=(nvidia_p2p_dma_map_pages)
syms+=(nvidia_p2p_dma_unmap_pages)

nvidia_ko_fn="$1"
symvers_fn="$2"
echo "nvidia ko file ${nvidia_ko_fn}"

touch "${symvers_fn}"
for sym in "${syms[@]}"; do
crc="$(objdump -t "${nvidia_ko_fn}" | grep "_crc${sym}" | awk '{print $1}')"
crc="$(objdump -t "${nvidia_ko_fn}" | grep -w "_crc${sym}" | awk '{print $1}')"
if [ -z "${crc}" ]; then
echo "Warning: Can't find symbol ${sym} in ${nvidia_ko_fn}; assuming CONFIG_MODVERSIONS=n so setting CRC=0"
crc=00000000
fi
sed -i '/${sym}/d' "${symvers_fn}"
echo "0x${crc} ${sym} ${nvidia_ko_fn} EXPORT_SYMBOL" >> ${symvers_fn}
echo "0x${crc} ${sym} ${nvidia_ko_fn} EXPORT_SYMBOL" >> ${symvers_fn}
done](url)

@pyt-hnu Hello, I also encountered the same problem as you on ubuntu 18.04. Is this problem solved now? I look forward to your reply.