【问题标题】:Can't build .nexe file with libtomcrypt. Compile errors无法使用 libtomcrypt 构建 .nexe 文件。编译错误
【发布时间】:2014-08-25 12:51:19
【问题描述】:

我正在尝试使用 nacplots lib libtomcrypt 编译 nexe 文件。 构建 nexe 它返回一堆“未定义”的错误。我试过用不同的标志建造,但没有。也许有人可以指出我做错了什么或者我在当前设置中缺少什么。

  • Linux 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 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),))

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

    //...
}

//...

【问题讨论】:

标签: linux makefile google-nativeclient libtomcrypt


【解决方案1】:

看起来 naclports 中的 libtomcrypt 构建从未正常工作过。错误和修复在这里审查: https://code.google.com/p/naclports/issues/detail?id=134

【讨论】:

  • 酷!谢谢!就是它。我清理了端口并重新安装。手臂有一些问题,但现在这并不重要。感谢您指出这一点。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-04-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多