-
-
[求助]請問關於Xcode 編譯 xnu 問題
-
发表于: 2014-11-28 20:06 5552
-
使用新版的 xcode 6.1 編譯 OS X 10.10 的源碼 xnu-2782.1.97 出現 clang 錯誤信息
然後嘗試用 xcode 5.0.2 編譯也出現 lnker 錯誤問題
但 編譯 10.9.5 的 xnu 都正常
clang: error: linker command failed with exit code 1 這個該如何修復
我用的是 AMD 頻果
從 xcode 5.1 以後 clang 就都錯誤 無法編譯了
Last login: Tue Nov 11 16:24:01 on ttys000 djpvddeMac-Pro:~ djpvd$ cd /Volumes/DATA1/xnu-2782.1.97 djpvddeMac-Pro:xnu-2782.1.97 djpvd$ make ARCH_CONFIGS=X86_64 KERNEL_CONFIGS=RELEASE SDKROOT=macosx HOST_CC setsegname.o HOST_CC externs.o HOST_CC kextsymboltool.o HOST_BISON parser.c HOST_CC openp.o HOST_LD setsegname Stack dump: 0. Program arguments: /Volumes/MacAPP/Applications/Xcode6/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -cc1 -triple x86_64-apple-macosx10.10.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name openp.c -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 241.9 -gdwarf-2 -coverage-file /Volumes/DATA1/xnu-2782.1.97/BUILD/obj/SETUP/config/openp.o -resource-dir /Volumes/MacAPP/Applications/Xcode6/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0 -isysroot /Volumes/MacAPP/Applications/Xcode6/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -D YY_NO_INPUT -I /Volumes/DATA1/xnu-2782.1.97/SETUP/config/ -I . -O0 -Wall -fdebug-compilation-dir /Volumes/DATA1/xnu-2782.1.97/BUILD/obj/SETUP/config -ferror-limit 19 -fmessage-length 80 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.10.0 -fencode-extended-block-signature -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o openp.o -x c /Volumes/DATA1/xnu-2782.1.97/SETUP/config/openp.c 1. <eof> parser at end of file 2. Code generation 3. Running pass 'Function Pass Manager' on module '/Volumes/DATA1/xnu-2782.1.97/SETUP/config/openp.c'. 4. Running pass 'X86 DAG->DAG Instruction Selection' on function '@openp' HOST_LD kextsymboltool ld: warning: directory not found for option '-L//usr/local/lib/system' HOST_CODESIGN setsegname HOST_CODESIGN kextsymboltool HOST_CC decomment.o HOST_CC installfile.o Stack dump: 0. Program arguments: /Volumes/MacAPP/Applications/Xcode6/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -cc1 -triple x86_64-apple-macosx10.10.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name decomment.c -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 241.9 -gdwarf-2 -coverage-file /Volumes/DATA1/xnu-2782.1.97/BUILD/obj/SETUP/decomment/decomment.o -resource-dir /Volumes/MacAPP/Applications/Xcode6/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0 -isysroot /Volumes/MacAPP/Applications/Xcode6/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -I /Volumes/DATA1/xnu-2782.1.97/SETUP/decomment/ -I . -O0 -Wall -fdebug-compilation-dir /Volumes/DATA1/xnu-2782.1.97/BUILD/obj/SETUP/decomment -ferror-limit 19 -fmessage-length 80 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.10.0 -fencode-extended-block-signature -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o decomment.o -x c /Volumes/DATA1/xnu-2782.1.97/SETUP/decomment/decomment.c 1. <eof> parser at end of file 2. Code generation 3. Running pass 'Function Pass Manager' on module '/Volumes/DATA1/xnu-2782.1.97/SETUP/decomment/decomment.c'. 4. Running pass 'X86 DAG->DAG Instruction Selection' on function '@main' HOST_LD installfile HOST_CODESIGN installfile HOST_CC searchp.o Stack dump: 0. Program arguments: /Volumes/MacAPP/Applications/Xcode6/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -cc1 -triple x86_64-apple-macosx10.10.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name searchp.c -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 241.9 -gdwarf-2 -coverage-file /Volumes/DATA1/xnu-2782.1.97/BUILD/obj/SETUP/config/searchp.o -resource-dir /Volumes/MacAPP/Applications/Xcode6/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0 -isysroot /Volumes/MacAPP/Applications/Xcode6/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -D YY_NO_INPUT -I /Volumes/DATA1/xnu-2782.1.97/SETUP/config/ -I . -O0 -Wall -fdebug-compilation-dir /Volumes/DATA1/xnu-2782.1.97/BUILD/obj/SETUP/config -ferror-limit 19 -fmessage-length 80 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.10.0 -fencode-extended-block-signature -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o searchp.o -x c /Volumes/DATA1/xnu-2782.1.97/SETUP/config/searchp.c 1. <eof> parser at end of file 2. Code generation 3. Running pass 'Function Pass Manager' on module '/Volumes/DATA1/xnu-2782.1.97/SETUP/config/searchp.c'. 4. Running pass 'X86 DAG->DAG Instruction Selection' on function '@searchp' clang: error: unable to execute command: Segmentation fault: 11 clang: error: clang frontend command failed due to signal (use -v to see invocation) Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.0.0 Thread model: posix clang: note: diagnostic msg: PLEASE submit a bug report to http://developer.apple.com/bugreporter/ and include the crash backtrace, preprocessed source, and associated run script. clang: error: unable to execute command: Segmentation fault: 11 clang: error: clang frontend command failed due to signal (use -v to see invocation) Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.0.0 Thread model: posix clang: note: diagnostic msg: PLEASE submit a bug report to http://developer.apple.com/bugreporter/ and include the crash backtrace, preprocessed source, and associated run script. clang: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang: note: diagnostic msg: /var/folders/d8/r_8svvjd48d93d00bb1pkv_w0000gn/T/openp-0dfb5c.c clang: note: diagnostic msg: /var/folders/d8/r_8svvjd48d93d00bb1pkv_w0000gn/T/openp-0dfb5c.sh clang: note: diagnostic msg: ******************** make[5]: *** [openp.o] Error 254 make[5]: *** Waiting for unfinished jobs.... HOST_CC replacecontents.o HOST_LD replacecontents HOST_CODESIGN replacecontents clang: error: unable to execute command: Segmentation fault: 11 clang: error: clang frontend command failed due to signal (use -v to see invocation) Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.0.0 Thread model: posix clang: note: diagnostic msg: PLEASE submit a bug report to http://developer.apple.com/bugreporter/ and include the crash backtrace, preprocessed source, and associated run script. clang: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang: note: diagnostic msg: /var/folders/d8/r_8svvjd48d93d00bb1pkv_w0000gn/T/decomment-edf09f.c clang: note: diagnostic msg: /var/folders/d8/r_8svvjd48d93d00bb1pkv_w0000gn/T/decomment-edf09f.sh clang: note: diagnostic msg: ******************** make[5]: *** [decomment.o] Error 254 make[4]: *** [build_setup] Error 2 make[3]: *** [build_setup_recurse_into_decomment] Error 2 make[3]: *** Waiting for unfinished jobs.... clang: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang: note: diagnostic msg: /var/folders/d8/r_8svvjd48d93d00bb1pkv_w0000gn/T/searchp-ca046c.c clang: note: diagnostic msg: /var/folders/d8/r_8svvjd48d93d00bb1pkv_w0000gn/T/searchp-ca046c.sh clang: note: diagnostic msg: ******************** make[5]: *** [searchp.o] Error 254 make[4]: *** [build_setup] Error 2 make[3]: *** [build_setup_recurse_into_config] Error 2 make[2]: *** [build_setup_recurse_into_SETUP] Error 2 make[1]: *** [build_setup_bootstrap_RELEASE^X86_64^NONE] Error 2 make: *** [all] Error 2 djpvddeMac-Pro:xnu-2782.1.97 djpvd$ cc --version Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.0.0 Thread model: posix
然後嘗試用 xcode 5.0.2 編譯也出現 lnker 錯誤問題
LDFILELIST bsd CC lastkernelconstructor.o CC version.o LD kernel.unstripped undef: _putchar undef: _puts Undefined symbols for architecture x86_64: "_putchar", referenced from: _safe_gets in printf.o _netboot_mountroot in netboot.o _pf_insert_src_node in pf.o _pf_insert_state in pf.o _pf_print_state in pf.o _pf_print_flags in pf.o _pf_normalize_tcp_stateful in pf_norm.o ... "_puts", referenced from: _bs_no_paging_space in dp_backing_store.o _ps_vstruct_transfer_from_segment in dp_backing_store.o _ps_select_segment in dp_backing_store.o _ps_allocate_cluster in dp_backing_store.o _default_pager_add_file in dp_backing_store.o _default_pager_triggers in dp_backing_store.o _default_pager_backing_store_monitor in dp_backing_store.o ... ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[3]: *** [/Volumes/DATA1/xnu-2782.1.97-amd/BUILD/obj/RELEASE_X86_64//kernel.unstripped] Error 1 make[2]: *** [build_all] Error 2 make[1]: *** [build_all_bootstrap_RELEASE^X86_64^NONE] Error 2
但 編譯 10.9.5 的 xnu 都正常
clang: error: linker command failed with exit code 1 這個該如何修復
我用的是 AMD 頻果
從 xcode 5.1 以後 clang 就都錯誤 無法編譯了
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)
赞赏
他的文章
看原图
赞赏
雪币:
留言: