我试图用nacplorts libtomcrypt编译libtomcrypt文件。构建nexe它返回一堆“未定义”的错误。我试过用不同的旗子建造房子,但什么也没有。也许有人可以指出我做错了什么,或者我在当前的设置中遗漏了什么。
~/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 1Makefile
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),))myproj.cc
代码只包含一行,这将触发所有错误。也许我没有补充更多的东西。我对tomcrypt很陌生,对C代码不是很好,但我愿意学习。如果这段代码不应该编译,你能给我举一个简单的“最小行”代码的例子,它使用tomcrypt,但不做任何复杂的事情?我肯定还能更进一步。
#include <tomcrypt.h>
//...
virtual void HandleMessage(const pp::Var& var) {
register_cipher(&aes_desc); // <----------- without this line build is successful
//...
}
//...发布于 2014-08-26 09:52:20
看起来,naclports中的libtomcrypt构建是无法正常工作的。本文中的Bug和修复:https://code.google.com/p/naclports/issues/detail?id=134
https://stackoverflow.com/questions/25486391
复制相似问题