Skip to content

Conversation

@dylan-eustice
Copy link
Collaborator

When building unit tests on an AGX Orin Devkit, the following error was observed:

[100%] Linking CXX executable matx_test
CMakeFiles/matx_test.dir/main.cu.o: in function `main':
/home/deustice/MatX/test/main.cu:40:(.text+0xa4): relocation truncated to fit: R_AARCH64_CALL26 against symbol `testing::InitGoogleTest(int*, char**)' defined in .text section in ../lib/libgtest.a(gtest-all.cc.o)
CMakeFiles/matx_test.dir/main.cu.o: in function `__sti____cudaRegisterAll()':
/tmp/tmpxft_001053bc_00000000-6_main.cudafe1.stub.c:13:(.text+0x1b4): relocation truncated to fit: R_AARCH64_CALL26 against symbol `atexit' defined in .text section in /usr/lib/aarch64-linux-gnu/libc_nonshared.a(atexit.oS)
CMakeFiles/matx_test.dir/main.cu.o: in function `RUN_ALL_TESTS()':
/home/deustice/MatX/build/_deps/gtest-src/googletest/include/gtest/gtest.h:2334:(.text._Z13RUN_ALL_TESTSv[_Z13RUN_ALL_TESTSv]+0x8): relocation truncated to fit: R_AARCH64_CALL26 against symbol `testing::UnitTest::GetInstance()' defined in .text section in ../lib/libgtest.a(gtest-all.cc.o)
/home/deustice/MatX/build/_deps/gtest-src/googletest/include/gtest/gtest.h:2334:(.text._Z13RUN_ALL_TESTSv[_Z13RUN_ALL_TESTSv]+0xc): relocation truncated to fit: R_AARCH64_CALL26 against symbol `testing::UnitTest::Run()' defined in .text section in ../lib/libgtest.a(gtest-all.cc.o)
collect2: error: ld returned 1 exit status
make[2]: *** [test/CMakeFiles/matx_test.dir/build.make:1726: test/matx_test] Error 1
make[1]: *** [CMakeFiles/Makefile2:1119: test/CMakeFiles/matx_test.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

This fixes the relocation errors by enabling position independent code instead of the default 26-bit offsets. Since there is a small performance trade-off by doing this, we might want to think about a less heavy-handed fix. It's unknown if this is actually needed for all ARM architectures or just Jetsons.

@copy-pr-bot
Copy link

copy-pr-bot bot commented Jul 11, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@cliffburdick
Copy link
Collaborator

/build

@cliffburdick
Copy link
Collaborator

/build

@cliffburdick cliffburdick merged commit 7539be2 into NVIDIA:main Jul 15, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants