10.13.1上编译10.13的xnu内核


#1

就差编译libdispatch就可以编译内核了,但是通过命令:
sudo xcodebuild install -project libdispatch.xcodeproj -target libfirehose_kernel -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk ARCHS="x86_64" SRCROOT=$PWD OBJROOT=$PWD/obj SYMROOT=$PWD/sym DSTROOT=$PWD/dst编译的时候报错,在这之前已经把需要的头文件用ditto命令弄好了,报错信息如下:

Build settings from command line:
ARCHS = x86_64
DSTROOT = /Users/peterpan/Downloads/libdispatch-913.1.6/dst
OBJROOT = /Users/peterpan/Downloads/libdispatch-913.1.6/obj
SDKROOT = macosx10.13
SRCROOT = /Users/peterpan/Downloads/libdispatch-913.1.6
SYMROOT = /Users/peterpan/Downloads/libdispatch-913.1.6/sym

=== BUILD TARGET libfirehose_kernel OF PROJECT libdispatch WITH THE DEFAULT CONFIGURATION (Release) ===

Check dependencies
libdispatch.xcconfig line 20: Unable to find included file “<DEVELOPER_DIR>/Makefiles/CoreOS/Xcode/BSD.xcconfig”
libdispatch.xcconfig line 21: Unable to find included file “<DEVELOPER_DIR>/AppleInternal/XcodeConfig/PlatformSupport.xcconfig”

CompileC obj/libdispatch.build/Release/libfirehose_kernel.build/Objects-profile/x86_64/firehose_buffer.o src/firehose/firehose_buffer.c profile x86_64 c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/peterpan/Downloads/libdispatch-913.1.6
export LANG=en_US.US-ASCII
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c -arch x86_64 -fmessage-length=204 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fcolor-diagnostics -std=gnu11 -Wno-trigraphs -Os -fno-common -Werror -Wmissing-field-initializers -Wmissing-prototypes -Wdocumentation -Wunreachable-code -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wunused-label -Wunused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wunknown-pragmas -Wshadow -Wno-four-char-constants -Wconversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wfloat-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wassign-enum -Wsign-compare -Wshorten-64-to-32 -Wpointer-sign -Wnewline-eof -D__DARWIN_NON_CANCELABLE=1 -DKERNEL=1 -DDISPATCH_USE_DTRACE=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -mmacosx-version-min=10.13 -g -fvisibility=hidden -Wsign-conversion -Winfinite-recursion -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -I/Users/peterpan/Downloads/libdispatch-913.1.6/sym/Release/include -I/Users/peterpan/Downloads/libdispatch-913.1.6 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Kernel.framework/PrivateHeaders -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Kernel.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/local/include/os -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/local/include/firehose -I/Users/peterpan/Downloads/libdispatch-913.1.6/obj/libdispatch.build/Release/libfirehose_kernel.build/DerivedSources/x86_64 -I/Users/peterpan/Downloads/libdispatch-913.1.6/obj/libdispatch.build/Release/libfirehose_kernel.build/DerivedSources -Wall -Wextra -Warray-bounds-pointer-arithmetic -Watomic-properties -Wcomma -Wconditional-uninitialized -Wcovered-switch-default -Wdate-time -Wdeprecated -Wdouble-promotion -Wduplicate-enum -Wexpansion-to-defined -Wfloat-equal -Widiomatic-parentheses -Wignored-qualifiers -Wimplicit-fallthrough -Wnullable-to-nonnull-conversion -Wobjc-interface-ivars -Wover-aligned -Wpacked -Wpointer-arith -Wselector -Wstatic-in-inline -Wsuper-class-method-mismatch -Wswitch-enum -Wtautological-compare -Wunguarded-availability -Wunused -Wno-unknown-warning-option -Wno-pedantic -Wno-bad-function-cast -Wno-c+±compat -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-cast-align -Wno-cast-qual -Wno-disabled-macro-expansion -Wno-documentation-unknown-command -Wno-format-nonliteral -Wno-missing-variable-declarations -Wno-old-style-cast -Wno-padded -Wno-reserved-id-macro -Wno-shift-sign-overflow -Wno-undef -Wno-unreachable-code-aggressive -Wno-unused-macros -Wno-used-but-marked-unused -Wno-vla -F/Users/peterpan/Downloads/libdispatch-913.1.6/sym/Release -mkernel -nostdinc -Wno-packed -momit-leaf-frame-pointer -DDISPATCH_PROFILE=1 -DDISPATCH_PERF_MON=1 -MMD -MT dependencies -MF /Users/peterpan/Downloads/libdispatch-913.1.6/obj/libdispatch.build/Release/libfirehose_kernel.build/Objects-profile/x86_64/firehose_buffer.d --serialize-diagnostics /Users/peterpan/Downloads/libdispatch-913.1.6/obj/libdispatch.build/Release/libfirehose_kernel.build/Objects-profile/x86_64/firehose_buffer.dia -c /Users/peterpan/Downloads/libdispatch-913.1.6/src/firehose/firehose_buffer.c -o /Users/peterpan/Downloads/libdispatch-913.1.6/obj/libdispatch.build/Release/libfirehose_kernel.build/Objects-profile/x86_64/firehose_buffer.o
/Users/peterpan/Downloads/libdispatch-913.1.6/src/firehose/firehose_buffer.c:83:10: fatal error: ‘internal/atomic.h’ file not found
#include <internal/atomic.h> // os/internal/atomic.h
^~~~~~~~~~~~~~~~~~~

CompileC obj/libdispatch.build/Release/libfirehose_kernel.build/Objects-normal/x86_64/firehose_buffer.o src/firehose/firehose_buffer.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/peterpan/Downloads/libdispatch-913.1.6
export LANG=en_US.US-ASCII
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c -arch x86_64 -fmessage-length=204 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fcolor-diagnostics -std=gnu11 -Wno-trigraphs -Os -fno-common -Werror -Wmissing-field-initializers -Wmissing-prototypes -Wdocumentation -Wunreachable-code -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wunused-label -Wunused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wunknown-pragmas -Wshadow -Wno-four-char-constants -Wconversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wfloat-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wassign-enum -Wsign-compare -Wshorten-64-to-32 -Wpointer-sign -Wnewline-eof -D__DARWIN_NON_CANCELABLE=1 -DKERNEL=1 -DDISPATCH_USE_DTRACE=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -mmacosx-version-min=10.13 -g -fvisibility=hidden -Wsign-conversion -Winfinite-recursion -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -I/Users/peterpan/Downloads/libdispatch-913.1.6/sym/Release/include -I/Users/peterpan/Downloads/libdispatch-913.1.6 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Kernel.framework/PrivateHeaders -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Kernel.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/local/include/os -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/local/include/firehose -I/Users/peterpan/Downloads/libdispatch-913.1.6/obj/libdispatch.build/Release/libfirehose_kernel.build/DerivedSources/x86_64 -I/Users/peterpan/Downloads/libdispatch-913.1.6/obj/libdispatch.build/Release/libfirehose_kernel.build/DerivedSources -Wall -Wextra -Warray-bounds-pointer-arithmetic -Watomic-properties -Wcomma -Wconditional-uninitialized -Wcovered-switch-default -Wdate-time -Wdeprecated -Wdouble-promotion -Wduplicate-enum -Wexpansion-to-defined -Wfloat-equal -Widiomatic-parentheses -Wignored-qualifiers -Wimplicit-fallthrough -Wnullable-to-nonnull-conversion -Wobjc-interface-ivars -Wover-aligned -Wpacked -Wpointer-arith -Wselector -Wstatic-in-inline -Wsuper-class-method-mismatch -Wswitch-enum -Wtautological-compare -Wunguarded-availability -Wunused -Wno-unknown-warning-option -Wno-pedantic -Wno-bad-function-cast -Wno-c+±compat -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-cast-align -Wno-cast-qual -Wno-disabled-macro-expansion -Wno-documentation-unknown-command -Wno-format-nonliteral -Wno-missing-variable-declarations -Wno-old-style-cast -Wno-padded -Wno-reserved-id-macro -Wno-shift-sign-overflow -Wno-undef -Wno-unreachable-code-aggressive -Wno-unused-macros -Wno-used-but-marked-unused -Wno-vla -F/Users/peterpan/Downloads/libdispatch-913.1.6/sym/Release -mkernel -nostdinc -Wno-packed -momit-leaf-frame-pointer -MMD -MT dependencies -MF /Users/peterpan/Downloads/libdispatch-913.1.6/obj/libdispatch.build/Release/libfirehose_kernel.build/Objects-normal/x86_64/firehose_buffer.d --serialize-diagnostics /Users/peterpan/Downloads/libdispatch-913.1.6/obj/libdispatch.build/Release/libfirehose_kernel.build/Objects-normal/x86_64/firehose_buffer.dia -c /Users/peterpan/Downloads/libdispatch-913.1.6/src/firehose/firehose_buffer.c -o /Users/peterpan/Downloads/libdispatch-913.1.6/obj/libdispatch.build/Release/libfirehose_kernel.build/Objects-normal/x86_64/firehose_buffer.o
/Users/peterpan/Downloads/libdispatch-913.1.6/src/firehose/firehose_buffer.c:83:10: fatal error: ‘internal/atomic.h’ file not found
#include <internal/atomic.h> // os/internal/atomic.h
^~~~~~~~~~~~~~~~~~~
1 error generated.

CompileC obj/libdispatch.build/Release/libfirehose_kernel.build/Objects-debug/x86_64/firehose_buffer.o src/firehose/firehose_buffer.c debug x86_64 c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/peterpan/Downloads/libdispatch-913.1.6
export LANG=en_US.US-ASCII
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c -arch x86_64 -fmessage-length=204 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fcolor-diagnostics -std=gnu11 -Wno-trigraphs -Os -fno-common -Werror -Wmissing-field-initializers -Wmissing-prototypes -Wdocumentation -Wunreachable-code -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wunused-label -Wunused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wunknown-pragmas -Wshadow -Wno-four-char-constants -Wconversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wfloat-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wassign-enum -Wsign-compare -Wshorten-64-to-32 -Wpointer-sign -Wnewline-eof -D__DARWIN_NON_CANCELABLE=1 -DKERNEL=1 -DDISPATCH_USE_DTRACE=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -mmacosx-version-min=10.13 -g -fvisibility=hidden -Wsign-conversion -Winfinite-recursion -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -I/Users/peterpan/Downloads/libdispatch-913.1.6/sym/Release/include -I/Users/peterpan/Downloads/libdispatch-913.1.6 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Kernel.framework/PrivateHeaders -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Kernel.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/local/include/os -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/local/include/firehose -I/Users/peterpan/Downloads/libdispatch-913.1.6/obj/libdispatch.build/Release/libfirehose_kernel.build/DerivedSources/x86_64 -I/Users/peterpan/Downloads/libdispatch-913.1.6/obj/libdispatch.build/Release/libfirehose_kernel.build/DerivedSources -Wall -Wextra -Warray-bounds-pointer-arithmetic -Watomic-properties -Wcomma -Wconditional-uninitialized -Wcovered-switch-default -Wdate-time -Wdeprecated -Wdouble-promotion -Wduplicate-enum -Wexpansion-to-defined -Wfloat-equal -Widiomatic-parentheses -Wignored-qualifiers -Wimplicit-fallthrough -Wnullable-to-nonnull-conversion -Wobjc-interface-ivars -Wover-aligned -Wpacked -Wpointer-arith -Wselector -Wstatic-in-inline -Wsuper-class-method-mismatch -Wswitch-enum -Wtautological-compare -Wunguarded-availability -Wunused -Wno-unknown-warning-option -Wno-pedantic -Wno-bad-function-cast -Wno-c+±compat -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-cast-align -Wno-cast-qual -Wno-disabled-macro-expansion -Wno-documentation-unknown-command -Wno-format-nonliteral -Wno-missing-variable-declarations -Wno-old-style-cast -Wno-padded -Wno-reserved-id-macro -Wno-shift-sign-overflow -Wno-undef -Wno-unreachable-code-aggressive -Wno-unused-macros -Wno-used-but-marked-unused -Wno-vla -F/Users/peterpan/Downloads/libdispatch-913.1.6/sym/Release -mkernel -nostdinc -Wno-packed -fstack-protector -fno-inline -O0 -DDISPATCH_DEBUG=1 -DOS_DEBUG=1 -MMD -MT dependencies -MF /Users/peterpan/Downloads/libdispatch-913.1.6/obj/libdispatch.build/Release/libfirehose_kernel.build/Objects-debug/x86_64/firehose_buffer.d --serialize-diagnostics /Users/peterpan/Downloads/libdispatch-913.1.6/obj/libdispatch.build/Release/libfirehose_kernel.build/Objects-debug/x86_64/firehose_buffer.dia -c /Users/peterpan/Downloads/libdispatch-913.1.6/src/firehose/firehose_buffer.c -o /Users/peterpan/Downloads/libdispatch-913.1.6/obj/libdispatch.build/Release/libfirehose_kernel.build/Objects-debug/x86_64/firehose_buffer.o
/Users/peterpan/Downloads/libdispatch-913.1.6/src/firehose/firehose_buffer.c:83:10: fatal error: ‘internal/atomic.h’ file not found
#include <internal/atomic.h> // os/internal/atomic.h
^~~~~~~~~~~~~~~~~~~
1 error generated.

** INSTALL FAILED **

The following build commands failed:
CompileC obj/libdispatch.build/Release/libfirehose_kernel.build/Objects-normal/x86_64/firehose_buffer.o src/firehose/firehose_buffer.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler
CompileC obj/libdispatch.build/Release/libfirehose_kernel.build/Objects-debug/x86_64/firehose_buffer.o src/firehose/firehose_buffer.c debug x86_64 c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)

不知道这个问题接下来怎么解决了,有没有大牛可以帮忙解决一下问题呀 :sweat_smile:

根据我的查阅,这个头文件应该是在libplatform-125中的:


#2


问题解决了…

有人想知道吗,有人想知道吗,好吗没人我溜了