I would try to stop <mach/machine.h> from being included.

On May 2, 2014, at 12:27 PM, Todd Fiala <[email protected]> wrote:

> I tried adjusting the ArchSpec.cpp headers like so:
> 
> //===-- ArchSpec.cpp --------------------------------------------*- C++ 
> -*-===//
> //
> //                     The LLVM Compiler Infrastructure
> //
> // This file is distributed under the University of Illinois Open Source
> // License. See LICENSE.TXT for details.
> //
> //===----------------------------------------------------------------------===//
> 
> // 1. *tfiala* added this one here
> #include "llvm/Support/MachO.h"
> #include "lldb/Core/ArchSpec.h"
> 
> #include <stdio.h>
> #include <errno.h>
> 
> #include <string>
> 
> #include "llvm/Support/COFF.h"
> #include "llvm/Support/ELF.h"
> #include "llvm/Support/Host.h"
> // 3. *tfiala* also tried commenting out below
> #include "lldb/Utility/SafeMachO.h"
> // 2. *tfiala* added this one here
> #include "llvm/Support/MachO.h"
> #include "lldb/Core/RegularExpression.h"
> #include "lldb/Host/Endian.h"
> #include "lldb/Host/Host.h"
> #include "lldb/Target/Platform.h"
> 
> At first I just added the element at (1.) above.  That gave me the same error 
> as before.  I then added it after the SafeMachO.h include at (2.) above while 
> keeping (1.) in, just in case SafeMachO.h was pulling in something that 
> wasn't .  That didn't work either.  Finally I tried commenting out (3.) just 
> in case that was doing something that failed.  That gave me different errors 
> and was clearly wrong.
> 
> Any other ideas?
> 
> -Todd  
> 
> 
> On Fri, May 2, 2014 at 12:03 PM, Todd Fiala <[email protected]> wrote:
> Thanks, Greg.  I'll give that a shot!
> 
> 
> On Fri, May 2, 2014 at 12:00 PM, Greg Clayton <[email protected]> wrote:
> 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 <[email protected]> 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-declar!
 at!
>  ions -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/t!
 oo!
>  ls/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
> > [email protected]
> > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
> 
> 
> _______________________________________________
> lldb-dev mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
> 
> 
> 
> -- 
> Todd Fiala |   Software Engineer |     [email protected] |     650-943-3180
> 
> 
> 
> 
> -- 
> -Todd


_______________________________________________
lldb-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev

Reply via email to