linux - 无法使用 libtomcrypt 构建 .nexe 文件。编译错误

标签 linux makefile google-nativeclient libtomcrypt

我正在尝试使用 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/

相关文章:

android - 我无法在 Linux mint 17.1 上安装 Android Studio

linux - 使/dev/pts/XX 在客户端重新连接时持久化

android - 无法在android系统应用程序中导入(导入com.android.internal.statusbar)语句

c - 修复 "undefined reference to"ft. makefile.txt 和 pthreads

compiler-errors - native 客户端-如何使用GetTime?

linux - 尝试安装 HGL,X11 错误

linux - Debian 中收到的电子邮件的位置

linux - Caffe编译失败: make: *** [. build_release/src/caffe/data_transformer.o] 错误1

opencv - 谷歌本地客户端(NaCl、PNaCl)中的英特尔线程构建 block (TBB)

c++ - 什么 JSON 解析库适用于 Google NaCl (c++)?