我尝试使用nacplorts lib nexe
编译libtomcrypt
个文件。
建立nexe它会返回错误的#34; undefined"。我尝试用不同的旗帜建造但没有。也许有人可以指出我做错了什么或我在当前设置中缺少什么。
~/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),))
代码只包含一行,触发所有错误。也许我没有添加更多东西。 我是tomcrypt的新手,对C代码不太满意,但愿意学习。如果这段代码不应该编译,你可以给我一些简单的"最小行"使用tomcrypt的代码但不做任何复杂的事情?为了确保我能走得更远。
#include <tomcrypt.h>
//...
virtual void HandleMessage(const pp::Var& var) {
register_cipher(&aes_desc); // <----------- without this line build is successful
//...
}
//...
答案 0 :(得分:1)
看起来naclports中的libtomcrypt构建从未正常工作。错误并修复此处的评论: https://code.google.com/p/naclports/issues/detail?id=134