When compiling "./build_dir/target-x86_64_musl/linux-x86_64/linux-5.4.114/tools/objtool" , the error can not be used when making a PIE object; recompile with -fPIE
appears. The solution is to modify the file: ./build_dir\target-x86_64_musl\linux-x86_64\linux-5.4.114\tools\objtool\Makefile
, change the line:
LDFLAGS += $(LIBELF_LIBS) $(LIBSUBCMD) $(KBUILD_HOSTLDFLAGS)
to
LDFLAGS += -no-pie $(LIBELF_LIBS) $(LIBSUBCMD) $(KBUILD_HOSTLDFLAGS)
The specific reason is not clear, it can be the reason for using different versions of gcc.