在OS X上编译TCC时出现问题 [英] Problems compiling TCC on OS X

查看:160
本文介绍了在OS X上编译TCC时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人在OS X上成功编译了 TCC 吗?

Has anyone successfully compiled TCC on OS X?

据我所知应该有可能,但是当我运行make时,出现以下错误:

From what I know it should be possible but when I run make I get the following error:

$ make
gcc -o tcc tcc.c -DTCC_TARGET_I386 -O2 -g -Wall -fno-strict-aliasing -mpreferred-stack-                boundary=2 -march=i386 -falign-functions=0 -Wno-pointer-sign -Wno-sign-compare -D_FORTIFY_SOURCE=0 -lm -ldl
tcc.c:1: error: CPU you selected does not support x86-64 instruction set
tcc.c:1: error: CPU you selected does not support x86-64 instruction set
tcc.c:1: error: -mpreferred-stack-boundary=2 is not between 4 and 12
make: *** [tcc] Error 1

./configure运行正常,并提供以下输出:

./configure runs fine and gives the following output:

$ ./configure 
Binary  directory   /usr/local/bin
TinyCC directory    /usr/local/lib/tcc
Library directory   /usr/local/lib
Include directory   /usr/local/include
Manual directory    /usr/local/man
Doc directory       /usr/local/share/doc/tcc
Target root prefix  
Source path      /Users/aaron/Downloads/tcc-0.9.25
C compiler       gcc
CPU              x86
Big Endian       no
gprof enabled    no
cross compilers  no
use libgcc       no
Creating config.mak and config.h

我很确定问题很简单,但是我在OS X上编译的程序不足以引起注意...

I'm pretty sure the issue is something simple, but I haven't compiled enough programs on OS X to be aware of the pratfalls...

安装TCC的主要目的是获取libtcc,这样我就可以开始尝试从Ruby生成动态代码(以防万一:-p)

The primary purpose for installing TCC was to get libtcc so I could start experimenting with dynamic code generation from Ruby (in case that makes a difference :-p)

谢谢!

推荐答案

我现在将合并我的评论.

I'll consolidate my comments now.

似乎有几个问题.

  1. 从Mac OS 10.5开始,x86寄存器访问的命名方案已更改.请参见在OS X上通过ucontext访问EIP和EBP .这将需要破解源代码,直到可以说服维护者支持Mac OS X.
  2. tcc支持的可执行格式与Mac OS X本机运行的格式不重叠.但是, XBinary 可以解决此问题. (我找不到 fink 包或可以在OSX上加载/执行ELF文件的可能性.
  1. There has been a change in the naming scheme for the x86 register access as of Mac OS 10.5. See Access EIP and EBP via ucontext on OS X. This will require hacking the source until the maintainer can be convinced to support Mac OS X.
  2. The executable formats supported by tcc do not overlap with those that Mac OS X will run natively. However, XBinary may address this. (I didn't find either a fink package or a MacPorts package, however and don't have it installed yet. Not sure that I will--this is deep magic, and could in theory do very bad things indeed.) Ah... this was already on SO too: Possiblity of loading/executing ELF files on OSX.

这篇关于在OS X上编译TCC时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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