Error Message "InputSection Too Large" Is Displayed When msSanitizer Uses --cce-enable-sanitizer -g to Compile Operators

Symptom

The error message ld.lld: error: InputSection too large for range extension thunk is displayed.

Possible Cause

The input code segment for operator linking is too large and exceeds the instruction jump range supported by the compiler.

Solution

Add compilation options to increase the jump range of the compiler. Add -Xaicore-start -mcmodel=large -mllvm -cce-aicore-relax -Xaicore-end after the operator code compilation option --cce-enable-sanitizer -g.

1
2
3
4
5
6
7
target_compile_options(${smoke_testcase}_npu PRIVATE
                     -O2
                     -std=c++17
                     --cce-enable-sanitizer
                     -g 
                     -Xaicore-start -mcmodel=large -mllvm -cce-aicore-relax -Xaicore-end
)