在windows上编译superopt

时间:2016-07-03 08:12:09

标签: makefile compilation

我正在试图在windows上编译superoptimizer。 (https://github.com/bonzini/superopt) 不幸的是,我对制作的了解非常有限。我试过了:

make CPU=-D386 superopt

这给了我错误:

cc     superopt.c   -o superopt
process_begin: CreateProcess(NULL, cc superopt.c -o superopt, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [superopt] Fehler 2

使用以下命令手动将编译器设置为gcc

make CPU=-D386 superopt CC=gcc

我收到以下错误:

gcc     superopt.c   -o superopt
In file included from superopt.c:27:0:
superopt.h:104:2: error: #error You have to choose target CPU type (--with-arch).
 #error You have to choose target CPU type (--with-arch).
  ^
In file included from superopt.h:130:0,
                 from superopt.c:27:
longlong.h:1465:14: error: unknown type name 'UQItype'
 extern const UQItype __clz_tab[];
              ^
superopt.c:32:21: fatal error: version.h: No such file or directory
compilation terminated.
make: *** [superopt] Fehler 1

它似乎没有正确选择i386。 任何提示都将不胜感激。

1 个答案:

答案 0 :(得分:1)

That不是源代码 GNU superopt。它是某人项目的源代码 修补GNU superopt,最后更新2008,看似 放弃了安全帽领域。

This是源代码 GNU superopt。提取tarball并按照您的尝试进行构建 用:

make CC=gcc CPU=-DI386 superopt

注意I386,而不是386

你会看到警告:

warning: incompatible implicit declaration of built-in function 'foo'

因为20年前的C代码并没有孜孜不倦地包含标准