对组装系统调用错误不支持的重定位 [英] Error unsupported relocate against assembly system call

查看:770
本文介绍了对组装系统调用错误不支持的重定位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图交叉编译的glibc-2.18飞思卡尔PowerPC的评估板。

目前我得到下面的错误在构建的一个阶段:

 的glibc
失败:
 ../sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S:汇编的消息:
 ../sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S:40:错误:对不支持swapcontext搬迁
 使[3]:*** [/home/user/Desktop/SmoothWall/bcutm/distrib/build/sources/glibc/glibc-2.18-compile/stdlib/setcontext.o]错误1
 使[3]:离开目录/home/user/Desktop/SmoothWall/bcutm/distrib/build/sources/glibc/glibc-2.18/stdlib
 使[2]:*** [STDLIB / subdir_lib]错误2
 使[2]:离开目录`/home/user/Desktop/SmoothWall/bcutm/distrib/build/sources/glibc/glibc-2.18
 使[1]:*** [全部]错误2
 使[1]:离开目录`/home/user/Desktop/SmoothWall/bcutm/distrib/build/sources/glibc/glibc-2.18-compile


解决方案

SYS_ify(swapcontext)宏应该评估为 __ NR_swapcontext ,这对于swapcontext系统调用的数目。

__ NR_swapcontext 是一个宏观的,而不是一个变量名 - 所以它应该被preprocessor解决(见 ASM / unistd。 ^ h )。它看起来像你没有这个定义,所以它没有得到preprocessed的系统调用号,所以留下你一个悬而未决的变量名。

所以,你的问题是缺少的定义__ NR_swapcontext ,它应该由glibc的编译是针对内核头文件提供。你有正确的内核头文件是否可用?

由于 swapcontext 是一个唯一的PowerPC的系统调用,它有可能,你想编译glibc的对你构建机器的头吧。

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'

解决方案

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.

这篇关于对组装系统调用错误不支持的重定位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆