2016-09-16 50 views
0

我目前在使用pnacl-compiler-rt時遇到了一些嚴重問題,因爲我沒有成功找到任何有關構建它的信息(在Mac上,這可能與NaCl的情況相關或不相關)與儀器的東西(如包括GCDAProfiling)。我最近嘗試是修改make/options.mk構建和使用包含覆蓋功能的pnacl-compiler-rt

#Added this 
FUNCTIONS := GCDAProfiling 

我查庫,看看它是否在那裏使用ar -t libcompiler_rt.a

__.SYMDEF SORTED 
GCDAProfiling.o ------------- Here it is 
clzti2.o 
compilerrt_fmax.o 
compilerrt_fmaxf.o 
compilerrt_logb.o 
compilerrt_logbf.o 
ctzti2.o 
divdc3.o 
divdi3.o 
divmoddi4.o 
divmodsi4.o 
divsc3.o 
divsi3.o 
divti3.o 
fixdfdi.o 
fixdfsi.o 
fixdfti.o 
fixsfdi.o 
fixsfsi.o 
fixsfti.o 
fixunsdfdi.o 
fixunsdfsi.o 
fixunsdfti.o 
fixunssfdi.o 
fixunssfsi.o 
fixunssfti.o 
floatdidf.o 
floatdisf.o 
floatsidf.o 
floatsisf.o 
floattidf.o 
floattisf.o 
floatundidf.o 
floatundisf.o 
floatunsidf.o 
floatunsisf.o 
floatuntidf.o 
floatuntisf.o 
int_util.o 
moddi3.o 
modsi3.o 
modti3.o 
muldc3.o 
muloti4.o 
mulsc3.o 
multi3.o 
popcountdi2.o 
popcountsi2.o 
popcountti2.o 
powidf2.o 
powisf2.o 
udivdi3.o 
udivmoddi4.o 
udivmodsi4.o 
udivmodti4.o 
udivsi3.o 
udivti3.o 
umoddi3.o 
umodsi3.o 
umodti3.o 

我已經複製這個庫到pepper_49/lib/clang-newlib_x86_64/[Debug|Release]文件夾。

我還更新了pepper_49 earth例子的Makefile,以試圖得到一些代碼覆蓋率數據,只改變以下行:

VALID_TOOLCHAINS := clang-newlib 
... 
LIBS = ppapi_simple_cpp nacl_io sdk_util ppapi_cpp ppapi pthread compiler_rt 
... 
CFLAGS = --coverage -Wall 

當我試圖打造,我得到以下(請請注意,我也嘗試進行64位鏈接,但附加了錯誤的輸出,沒有電流的裝置與正確的輸出來取代它...):

CXX clang-newlib/Release/earth_x86_32.o 
    LINK clang-newlib/Release/earth_unstripped_x86_32.nexe 
clang-newlib/Release/earth_x86_32.o: In function `__llvm_gcov_writeout': 
earth.cc:(.text+0xb53c): undefined reference to `llvm_gcda_start_file' 
earth.cc:(.text+0xb57c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xb59c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xb5dc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xb5fc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xb63c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xb65c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xb69c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xb6bc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xb6fc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xb71c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xb75c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xb77c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xb7bc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xb7dc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xb81c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xb83c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xb87c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xb89c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xb8dc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xb8fc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xb93c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xb95c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xb99c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xb9bc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xb9fc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xba1c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xba5c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xba7c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xbabc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xbadc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xbb1c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xbb3c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xbb7c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xbb9c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xbbdc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xbbfc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xbc3c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xbc5c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xbc9c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xbcbc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xbcfc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xbd1c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xbd5c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xbd7c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xbdbc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xbddc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xbe1c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xbe3c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xbe7c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xbe9c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xbedc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xbefc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xbf3c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xbf5c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xbf9c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xbfbc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xbffc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc01c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc05c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc07c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc0bc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc0dc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc11c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc13c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc17c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc19c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc1dc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc1fc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc23c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc25c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc29c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc2bc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc2fc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc31c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc35c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc37c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc3bc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc3dc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc41c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc43c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc47c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc49c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc4dc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc4fc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc53c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc55c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc59c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc5bc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc5fc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc61c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc65c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc67c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc6bc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc6dc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc71c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc73c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc77c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc79c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc7dc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc7fc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc83c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc85c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc89c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc8bc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc8fc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc91c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc95c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc97c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xc9bc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xc9dc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xca1c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xca3c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xca7c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xca9c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xcadc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xcafc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xcb3c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xcb5c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xcb9c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xcbbc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xcbfc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xcc1c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xcc5c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xcc7c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xccbc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xccdc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xcd1c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xcd3c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xcd7c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xcd9c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xcddc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xcdfc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xce3c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xce5c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xce9c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xcebc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xcefc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xcf1c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xcf5c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xcf7c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xcfbc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xcfdc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xd01c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xd03c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xd07c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xd09c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xd0dc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xd0fc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xd13c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xd15c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xd19c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xd1bc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xd1fc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xd21c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xd25c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xd27c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xd2bc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xd2dc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xd31c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xd33c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xd37c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xd39c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xd3dc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xd3fc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xd43c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xd45c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xd49c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xd4bc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xd4fc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xd51c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xd55c): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xd57c): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xd5bc): undefined reference to `llvm_gcda_emit_function' 
earth.cc:(.text+0xd5dc): undefined reference to `llvm_gcda_emit_arcs' 
earth.cc:(.text+0xd5fc): undefined reference to `llvm_gcda_summary_info' 
clang-newlib/Release/earth_x86_32.o: In function `__llvm_gcov_init': 
earth.cc:(.text+0x1127c): undefined reference to `llvm_gcov_init' 
clang-newlib/Release/earth_x86_32.o: In function `__llvm_gcov_writeout': 
earth.cc:(.text+0xd605): undefined reference to `llvm_gcda_end_file' 
i686-nacl-clang++: error: linker command failed with exit code 1 (use -v to see invocation) 
make: *** [clang-newlib/Release/earth_unstripped_x86_32.nexe] Error 1

我做的東西(可能是幾個)令人難以置信的基本這裏錯了,但沒有任何文檔我在一個頭緒來:

  1. 構建pnacl編譯-RT正確
  2. 讓它如此鏈接,我可以儀器我.nexe文件,並得到一些覆蓋數據。

任何幫助,非常感謝。

回答

1
  1. 要建立正確的,你需要建立一個能與NaCl的工具鏈編譯
  2. 要鏈接,一旦與氯化鈉的工具鏈鏈接構建的應罰款(假設你只有跟你主持編譯器即蘋果內置)。儘管在你的例子中註釋了你已經把庫放在64位文件夾中,並且你正在嘗試構建一個32位的例子。
+0

謝謝。我將仔細檢查使用的編譯器,我可能是錯誤的,因爲我沒有觸及大部分make文件。重點2:這不是一個問題,我也試圖64位鏈接(使NACL_ARCH = x86_64),但附加了錯誤的輸出: - /我會改正它,但不會在一個星期附近的PC。 – splrs