我希望演示挡泥板如何在此程序上工作,
int
main()
{
int tab[10];
int i;
for (i = 1; i <= 10; i++)
tab[i] = 0;
return 0;
}
但我收到错误,
$ gcc -fmudflap -lmudflap bounds-violation.c
In file included from <command-line>:0:0:
/usr/include/stdc-predef.h:59:1: fatal error: mf-runtime.h: No such file or directory
#endif
^
compilation terminated.
所以我需要 mudflap 库。但似乎没有适合我的 x86_64 平台的库:
$ uname -a
Linux orca 3.13.0-29-generic #53-Ubuntu SMP Wed Jun 4 21:00:20 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
$ apt-cache search mudflap
lib64mudflap0-dbg-powerpc-cross - GCC mudflap shared support libraries (64 bit debug symbols)
lib64mudflap0-powerpc-cross - GCC mudflap shared support libraries (64bit)
libhfmudflap0-armel-cross - GCC mudflap shared support libraries (hard float)
libhfmudflap0-dbg-armel-cross - GCC mudflap shared support libraries (hard float debug symbols)
libmudflap0-4.7-dev-armel-cross - GCC mudflap support libraries (development files)
libmudflap0-4.7-dev-armhf-cross - GCC mudflap support libraries (development files)
libmudflap0-4.8-dev-armhf-cross - GCC mudflap support libraries (development files)
libmudflap0-4.8-dev-powerpc-cross - GCC mudflap support libraries (development files)
libmudflap0-armel-cross - GCC mudflap shared support libraries
libmudflap0-armhf-cross - GCC mudflap shared support libraries
libmudflap0-dbg-armel-cross - GCC mudflap shared support libraries (debug symbols)
libmudflap0-dbg-armhf-cross - GCC mudflap shared support libraries (debug symbols)
libmudflap0-dbg-powerpc-cross - GCC mudflap shared support libraries (debug symbols)
libmudflap0-powerpc-cross - GCC mudflap shared support libraries
libsfmudflap0-armhf-cross - GCC mudflap shared support libraries (soft float)
libsfmudflap0-dbg-armhf-cross - GCC mudflap shared support libraries (soft float debug symbols)
为什么全是 ARM 和 Armel 的东西?在网上搜索建议应该有一个名为的包libmudflap0-4.8-dev
,对应于 Trusty 中预装的 GCC 版本,但它不存在。
这是一个错误吗?如果不是,我该如何安装 libmudflap?
谢谢。
答案1
我没有意识到 mudflap 在 GCC 4.9 版中已被弃用。尽管 Ubuntu 14.04 附带 4.8,但我猜他们已经停止使用该软件包。查找地址消毒剂反而。