Error unsupported relocate against assembly system call

江枫思渺然 提交于 2019-12-11 00:00:15

问题


I am trying to cross compile glibc-2.18 for powerpc freescale evaluation board.

At one of the stages in the build I get following error:

    glibc
Failed:
 ../sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S: Assembler messages:
 ../sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S:40: Error: unsupported relocation against swapcontext
 make[3]: *** [/home/user/Desktop/SmoothWall/bcutm/distrib/build/sources/glibc/glibc-2.18-compile/stdlib/setcontext.o] Error 1
 make[3]: Leaving directory  /home/user/Desktop/SmoothWall/bcutm/distrib/build/sources/glibc/glibc-2.18/stdlib'
 make[2]: *** [stdlib/subdir_lib] Error 2
 make[2]: Leaving directory `/home/user/Desktop/SmoothWall/bcutm/distrib/build/sources/glibc/glibc-2.18'
 make[1]: *** [all] Error 2
 make[1]: Leaving directory `/home/user/Desktop/SmoothWall/bcutm/distrib/build/sources/glibc/glibc-2.18-compile'

回答1:


The SYS_ify(swapcontext) macro there should evaluate to __NR_swapcontext, which is the number for the swapcontext system call.

__NR_swapcontext is a macro, not a variable name - so it should have been resolved by the preprocessor (see asm/unistd.h). It looks like you don't have a definition for this, and so it didn't get preprocessed to the syscall number, and so left you with an unresolved variable name.

So, your problem is the missing definition for __NR_swapcontext, which should be provided by the kernel headers that glibc is compiling against. Do you have the correct kernel headers available?

Since swapcontext is a powerpc-only system call, it it possible that you're trying to compile glibc against your build machine's headers instead.



来源:https://stackoverflow.com/questions/33785554/error-unsupported-relocate-against-assembly-system-call

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!