我正在尝试使用 nacplorts lib libtomcrypt
编译 nexe
文件。
构建 nexe 它返回一堆“未定义”错误。我试过用不同的标志 build 但没有。也许有人可以指出我做错了什么或我在当前设置中遗漏了什么。
- Linux 3.13.0-32-generic#57-Ubuntu SMP 2014 年 7 月 15 日星期二 03:51:08 UTC x86_64 x86_64 x86_64 GNU/Linux
~/nacl/pepper_35/
~/nacl/naclports
结果。错误。
$ make
LINK newlib/Release/myproj_unstripped_x86_32.nexe
/home/ME/nacl/pepper_35/toolchain/linux_x86_newlib/i686-nacl/usr/lib/libtomcrypt.a(aes.o): In function `rijndael_test':
aes.c:(.text+0x1271): undefined reference to `__stack_chk_fail'
/home/ME/nacl/pepper_35/toolchain/linux_x86_newlib/i686-nacl/usr/lib/libtomcrypt.a(crypt_argchk.o): In function `crypt_argchk':
crypt_argchk.c:(.text+0x1c): undefined reference to `stderr'
crypt_argchk.c:(.text+0x34): undefined reference to `__fprintf_chk'
collect2: ld returned 1 exit status
make: *** [newlib/Release/myproj_unstripped_x86_32.nexe] Error 1
生成文件
VALID_TOOLCHAINS := newlib glibc pnacl linux
NACL_SDK_ROOT ?= $(abspath $(CURDIR)/../..)
include $(NACL_SDK_ROOT)/tools/common.mk
TARGET = myproj
LIBS = ppapi_cpp ppapi pthread tomcrypt
CFLAGS = -Wall
SOURCES = myproj.cc
# Build rules generated by macros from common.mk:
$(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS))))
ifeq ($(CONFIG),Release)
$(eval $(call LINK_RULE,$(TARGET)_unstripped,$(SOURCES),$(LIBS),$(DEPS)))
$(eval $(call STRIP_RULE,$(TARGET),$(TARGET)_unstripped))
else
$(eval $(call LINK_RULE,$(TARGET),$(SOURCES),$(LIBS),$(DEPS)))
endif
$(eval $(call NMF_RULE,$(TARGET),))
我的项目.cc
代码仅包含一行,会触发所有错误。也许我没有添加更多内容。 我是 tomcrypt 的新手,不太擅长 C 代码,但愿意学习。如果这段代码不应该编译,你能给我一个使用 tomcrypt 但不做任何复杂事情的简单“最少行数”代码的例子吗?确保我可以走得更远。
#include <tomcrypt.h>
//...
virtual void HandleMessage(const pp::Var& var) {
register_cipher(&aes_desc); // <----------- without this line build is successful
//...
}
//...
最佳答案
看起来 naclports 中的 libtomcrypt 构建从未正常工作。错误和修复在此处审查: https://code.google.com/p/naclports/issues/detail?id=134
关于linux - 无法使用 libtomcrypt 构建 .nexe 文件。编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25486391/