[lldb-dev] Xcode builds

Greg Clayton gclayton at apple.com
Fri May 2 12:00:06 PDT 2014


Looks like you are getting a conflict with the macros defined in:

<mach/machine.h>

and these are ruining the defines set in:

"llvm/Support/MachO.h"

So you aren't missing anything and I am not sure why things are different for us. I thought this was fixed by adding an underscore in front of all CPU_TYPE_XXX items in MachO.h that exactly matched macros in machine.h... It is really lame that a header file in LLVM is using macros that exactly match enums. 

You might be able to fix it by #including the "llvm/Support/MachO.h" first in the file before any other files.


On May 2, 2014, at 9:51 AM, Todd Fiala <todd.fiala at gmail.com> wrote:

> Hey guys,
> 
> I'm getting errors like this on lldb TOT building within Xcode:
> CompileC /Users/tfiala/Library/Developer/Xcode/DerivedData/lldb-fdedbkfqiftsgoaeqxdcrpiwguzs/Build/Intermediates/lldb.build/Debug/lldb-core.build/Objects-normal/x86_64/ArchSpec.o source/Core/ArchSpec.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
> 
>     cd /Users/tfiala/lldb/svn/llvm/tools/lldb
> 
>     export LANG=en_US.US-ASCII
> 
>     /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c++11 -stdlib=libc++ -Wno-trigraphs -fpascal-strings -O0 -Wmissing-field-initializers -Wno-missing-prototypes -Wnon-virtual-dtor -Woverloaded-virtual -Wno-exit-time-destructors -Wmissing-braces -Wparentheses -Wswitch -Wno-unused-function -Wunused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wno-bool-conversion -Wenum-conversion -Wno-shorten-64-to-32 -Wnewline-eof -Wno-c++11-extensions -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DLLDB_CONFIGURATION_DEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.7 -g -Wno-sign-conversion -iquote /Users/tfiala/Library/Developer/Xcode/DerivedData/lldb-fdedbkfqiftsgoaeqxdcrpiwguzs/Build/Intermediates/lldb.build/Debug/lldb-core.build/liblldb-core-generated-files.hmap -I/Users/tfiala/Library/Developer/Xcode/DerivedData/lldb-fdedbkfqiftsgoaeqxdcrpiwguzs/Build/Intermediates/lldb.build/Debug/lldb-core.build/liblldb-core-own-target-headers.hmap -I/Users/tfiala/Library/Developer/Xcode/DerivedData/lldb-fdedbkfqiftsgoaeqxdcrpiwguzs/Build/Intermediates/lldb.build/Debug/lldb-core.build/liblldb-core-all-target-headers.hmap -iquote /Users/tfiala/Library/Developer/Xcode/DerivedData/lldb-fdedbkfqiftsgoaeqxdcrpiwguzs/Build/Intermediates/lldb.build/Debug/lldb-core.build/liblldb-core-project-headers.hmap -iquote/Users/tfiala/lldb/svn/llvm/tools/lldb/include -iquote/Users/tfiala/lldb/svn/llvm/tools/lldb/source -iquote/Users/tfiala/lldb/svn/llvm/tools/lldb/llvm/include -iquote/Users/tfiala/lldb/svn/llvm/tools/lldb/llvm/tools/clang/include -iquote/Users/tfiala/lldb/svn/llvm/tools/lldb/llvm-build/Release+Asserts/x86_64/include -iquote/Users/tfiala/lldb/svn/llvm/tools/lldb/llvm-build/Release+Asserts/x86_64/tools/clang/include -I/Users/tfiala/Library/Developer/Xcode/DerivedData/lldb-fdedbkfqiftsgoaeqxdcrpiwguzs/Build/Products/Debug/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2 -I/Users/tfiala/Library/Developer/Xcode/DerivedData/lldb-fdedbkfqiftsgoaeqxdcrpiwguzs/Build/Intermediates/lldb.build/Debug/lldb-core.build/DerivedSources/x86_64 -I/Users/tfiala/Library/Developer/Xcode/DerivedData/lldb-fdedbkfqiftsgoaeqxdcrpiwguzs/Build/Intermediates/lldb.build/Debug/lldb-core.build/DerivedSources -Wreorder -F/Users/tfiala/Library/Developer/Xcode/DerivedData/lldb-fdedbkfqiftsgoaeqxdcrpiwguzs/Build/Products/Debug -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/PrivateFrameworks -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -fno-rtti -Wglobal-constructors -flimit-debug-info -Wparentheses -DLLDB_USE_BUILTIN_DEMANGLER -MMD -MT dependencies -MF /Users/tfiala/Library/Developer/Xcode/DerivedData/lldb-fdedbkfqiftsgoaeqxdcrpiwguzs/Build/Intermediates/lldb.build/Debug/lldb-core.build/Objects-normal/x86_64/ArchSpec.d --serialize-diagnostics /Users/tfiala/Library/Developer/Xcode/DerivedData/lldb-fdedbkfqiftsgoaeqxdcrpiwguzs/Build/Intermediates/lldb.build/Debug/lldb-core.build/Objects-normal/x86_64/ArchSpec.dia -c /Users/tfiala/lldb/svn/llvm/tools/lldb/source/Core/ArchSpec.cpp -o /Users/tfiala/Library/Developer/Xcode/DerivedData/lldb-fdedbkfqiftsgoaeqxdcrpiwguzs/Build/Intermediates/lldb.build/Debug/lldb-core.build/Objects-normal/x86_64/ArchSpec.o
> 
> 
> 
> /Users/tfiala/lldb/svn/llvm/tools/lldb/source/Core/ArchSpec.cpp:79:48: error: no member named 'arm64' in 'llvm::Triple'
> 
>     { eByteOrderLittle, 8, 4, 4, llvm::Triple::arm64  , ArchSpec::eCore_arm_arm64       , "arm64"     },
> 
>                                  ~~~~~~~~~~~~~~^
> 
> /Users/tfiala/lldb/svn/llvm/tools/lldb/source/Core/ArchSpec.cpp:184:54: error: no member named 'CPU_TYPE_ARM64' in namespace 'llvm::MachO'; did you mean 'CPU_TYPE_ARM'?
> 
>     { ArchSpec::eCore_arm_arm64       , llvm::MachO::CPU_TYPE_ARM64     , CPU_ANY, UINT32_MAX , SUBTYPE_MASK },
> 
>                                         ~~~~~~~~~~~~~^~~~~~~~~~~~~~
> 
>                                                      CPU_TYPE_ARM
> 
> In file included from /Users/tfiala/lldb/svn/llvm/tools/lldb/source/Core/ArchSpec.cpp:20:
> 
> In file included from /Users/tfiala/lldb/svn/llvm/tools/lldb/include/lldb/Utility/SafeMachO.h:111:
> 
> /Users/tfiala/lldb/svn/llvm/tools/lldb/llvm/include/llvm/Support/MachO.h:914:7: note: 'CPU_TYPE_ARM' declared here
> 
>       CPU_TYPE_ARM       = 12,
> 
>       ^
> 
> /Users/tfiala/lldb/svn/llvm/tools/lldb/source/Core/ArchSpec.cpp:185:54: error: no member named 'CPU_TYPE_ARM64' in namespace 'llvm::MachO'; did you mean 'CPU_TYPE_ARM'?
> 
>     { ArchSpec::eCore_arm_arm64       , llvm::MachO::CPU_TYPE_ARM64     , 0      , UINT32_MAX , SUBTYPE_MASK },
> 
>                                         ~~~~~~~~~~~~~^~~~~~~~~~~~~~
> 
>                                                      CPU_TYPE_ARM
> 
> In file included from /Users/tfiala/lldb/svn/llvm/tools/lldb/source/Core/ArchSpec.cpp:20:
> 
> In file included from /Users/tfiala/lldb/svn/llvm/tools/lldb/include/lldb/Utility/SafeMachO.h:111:
> 
> /Users/tfiala/lldb/svn/llvm/tools/lldb/llvm/include/llvm/Support/MachO.h:914:7: note: 'CPU_TYPE_ARM' declared here
> 
>       CPU_TYPE_ARM       = 12,
> 
>       ^
> 
> /Users/tfiala/lldb/svn/llvm/tools/lldb/source/Core/ArchSpec.cpp:186:54: error: no member named 'CPU_TYPE_ARM64' in namespace 'llvm::MachO'; did you mean 'CPU_TYPE_ARM'?
> 
>     { ArchSpec::eCore_arm_arm64       , llvm::MachO::CPU_TYPE_ARM64     , 1      , UINT32_MAX , SUBTYPE_MASK },
> 
>                                         ~~~~~~~~~~~~~^~~~~~~~~~~~~~
> 
>                                                      CPU_TYPE_ARM
> 
> In file included from /Users/tfiala/lldb/svn/llvm/tools/lldb/source/Core/ArchSpec.cpp:20:
> 
> In file included from /Users/tfiala/lldb/svn/llvm/tools/lldb/include/lldb/Utility/SafeMachO.h:111:
> 
> /Users/tfiala/lldb/svn/llvm/tools/lldb/llvm/include/llvm/Support/MachO.h:914:7: note: 'CPU_TYPE_ARM' declared here
> 
>       CPU_TYPE_ARM       = 12,
> 
>       ^
> 
> /Users/tfiala/lldb/svn/llvm/tools/lldb/source/Core/ArchSpec.cpp:187:54: error: no member named 'CPU_TYPE_ARM64' in namespace 'llvm::MachO'; did you mean 'CPU_TYPE_ARM'?
> 
>     { ArchSpec::eCore_arm_arm64       , llvm::MachO::CPU_TYPE_ARM64     , 13     , UINT32_MAX , SUBTYPE_MASK },
> 
>                                         ~~~~~~~~~~~~~^~~~~~~~~~~~~~
> 
>                                                      CPU_TYPE_ARM
> 
> In file included from /Users/tfiala/lldb/svn/llvm/tools/lldb/source/Core/ArchSpec.cpp:20:
> 
> In file included from /Users/tfiala/lldb/svn/llvm/tools/lldb/include/lldb/Utility/SafeMachO.h:111:
> 
> /Users/tfiala/lldb/svn/llvm/tools/lldb/llvm/include/llvm/Support/MachO.h:914:7: note: 'CPU_TYPE_ARM' declared here
> 
>       CPU_TYPE_ARM       = 12,
> 
>       ^
> 
> /Users/tfiala/lldb/svn/llvm/tools/lldb/source/Core/ArchSpec.cpp:738:44: error: no member named 'arm64' in 'llvm::Triple'
> 
>                         case llvm::Triple::arm64:
> 
>                              ~~~~~~~~~~~~~~^
> 
> 6 errors generated.
> 
> I've gone back to start of yesterday and still see it.  I've wiped my DerivedData directories.  Do I have something misconfigured in Xcode or is this a valid build break?  
> 
> 
> 
> From my end it looks like the arm64 part should be aarch64 (?), but the other failures around CPU_TYPE_ARM64 was less clear what to do.
> 
> Thanks!
> -- 
> -Todd
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev





More information about the lldb-dev mailing list