Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated xcode 7,got "error generated" #245

Closed
RogerGan opened this issue Sep 21, 2015 · 32 comments
Closed

updated xcode 7,got "error generated" #245

RogerGan opened this issue Sep 21, 2015 · 32 comments

Comments

@RogerGan
Copy link

image

@mdsb100
Copy link

mdsb100 commented Sep 21, 2015

I got the same issuse

@RogerGan
Copy link
Author

@lqi hi, how to resolve the problem

@garrettmoon
Copy link

Also seeing this. Any ideas?

@mdsb100
Copy link

mdsb100 commented Sep 22, 2015

Mac, OCLint version 0.8.1

@thelvis4
Copy link

I have the same issue.

Also, i've tried the latest ( 0.9.dev.8553ad2) build, and i got "LLVM ERROR: unknown module format"

@ryuichis
Copy link
Contributor

@thelvis4 I am working on a fix for it. And could you help me verify one thing: open your compile_commands.json file, search texts for -fmodules and -gmodules, and delete all matches. Let me know if it works for you?

@garrettmoon
Copy link

@ryuichisaito6 that got rid of the errors generated at the top, however, it may be a separate issue, but I still see errors after:

Compiler Errors:
      (please be aware that these errors will prevent OCLint from analyzing this source code)

      /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:19:21: expected a type
      /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:25:28: expected a type
      /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:32:4: expected a type
      /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:53:4: expected a type
      /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:54:4: expected a type
      /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:7:15: expected ';' after @class
      /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:7:16: cannot find protocol declaration for 'ObjectType'
      /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:34:25: cannot find protocol declaration for 'ObjectType'
      /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:34:37: expected identifier or '('
      /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:36:4: expected a type
      /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:25: cannot find protocol declaration for 'ObjectType'
      /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:1: duplicate interface definition for class 'NSEnumerator'
      /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:37: method type specifier must start with '-' or '+'
      /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:38: expected a type
      /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:42:1: expected selector for Objective-C method
      /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:42:28: unknown type name 'NSArray'
      /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:42:35: expected member name or ';' after declaration specifiers
      /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:42:1: property requires fields to be named
      /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:42:35: expected ';' at end of declaration list
      :0:0: too many errors emitted, stopping now

@RogerGan
Copy link
Author

@ryuichisaito6 when i build oclint 0.9, I got the python error message
image

@ryuichis
Copy link
Contributor

@RogerGan Building oclint requires you to clone the git repo, instead of downloading it as a zip/tar archive.

@thelvis4
Copy link

@ryuichisaito6 It was enough to just delete all -gmodules occurrences and 0.9.dev.8553ad2 worked perfectly. There was no need to remove -fmodules.

@ryuichis
Copy link
Contributor

@thelvis4 I tried to understand this better, do you by any chance know what -fmodules and -gmodules do respectively?

@thelvis4
Copy link

@ryuichisaito6 I googled for them a little and i found nothing. The only thing I found was in clang's help:

-fmodules Enable the 'modules' language feature

-gmodules Generate debug info that directly references modules or pch

@thelvis4
Copy link

@ryuichisaito6 -gmodules flag is added when Enable Clang Module Debugging in Build Settings is YES.

This option is part of the Apple LLVM 7.0 - Language - Modules settings.

@RogerGan
Copy link
Author

@ryuichisaito6 If i build 0.9dev,can i solve the "updated xcode 7 problem"?

@thelvis4
Copy link

@RogerGan Yes, you can bypass the problem by adding CLANG_ENABLE_MODULE_DEBUGGING=NO to xcodebuild(or xctool) parameters.

@RogerGan
Copy link
Author

@thelvis4 error msg:
image

@mdsb100
Copy link

mdsb100 commented Sep 24, 2015

坑爹啊

@RogerGan
Copy link
Author

@thelvis4 i can't find "CLANG_ENABLE_MODULE_DEBUGGING=NO" in xcodebuild parameters,but in xcode project config;
Although I set to no in xcode config, but the error meg still exists.
but the static code anaylysis result is right.
ow!!!!!

@thelvis4
Copy link

@RogerGan If you make the build using xcodebuild CLI, you have to call it like this xcodebuild CLANG_ENABLE_MODULE_DEBUGGING=NO build [other parameters].

You said that after setting Enable Clang Module Debugging to NO you still got the errors. Does your compile_commands.json file contain -gmodules or -fmodules options? (If you set CLANG_ENABLE_MODULE_DEBUGGING to NO, it should not contain -gmodules. For -fmodules I don't know the setting name because i've never met -fmodules in my compile_commands.json files).

@arturocandela
Copy link

Hi! xctool with the CLANG_ENABLE_MODULE_DEBUGGING=NO build has worked

@telmopmota
Copy link

Same issue here.

$ oclint -version
LLVM (http://llvm.org/):
  LLVM version 3.5.0svn
  Optimized build.
  Built Oct 19 2014 (09:55:19).
  Default target: x86_64-apple-darwin14.5.0
  Host CPU: core-avx2
OCLint (http://oclint.org/):
  OCLint version 0.8.1.
  Built Oct 19 2014 (10:24:44)
$ xcodebuild -version
Xcode 7.0
Build version 7A220

$ xcodebuild -scheme MyScheme -sdk iphoneos CLANG_ENABLE_MODULE_DEBUGGING=NO ONLY_ACTIVE_ARCH=NO ARCHS=armv7 CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO > xcodebuild.log
$ oclint-xcodebuild

No gmodules parameters in compile_commands.json, but fmodules are found and error happens.
Disabling fmodules with CLANG_ENABLE_MODULES=NO gives compile error as we use @import and remove them is not an option. :(

@thelvis4
Copy link

thelvis4 commented Oct 1, 2015

@telmopmota It only works if you build OCLint from master branch by yourself. (as there is no official OCLint 9.0 yet)

@telmopmota
Copy link

Hi @thelvis4,
I'm trying to build it, but...

$ git clone https://github.com/oclint/oclint.git
$ cd oclint-scripts
$ ./make
...
[ 61%] Generating ../../../../lib/clang/3.8.0/lib/macho_embedded/libclang_rt.soft_static.a
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't create temporary output file: /Users/telmomota/git/oclint/build/llvm/./lib/clang/3.8.0/lib/macho_embedded/libclang_rt.soft_static.a.lipo (No such file or directory)

I did not figure out the reason for the error yet. :(
I'm using Xcode 7.0 and cmake-3.3.2-Darwin-x86_64

@telmopmota
Copy link

@thelvis4, I did not use sudo, but we managed to get it working.
In a second terminal window, while make is running, we did

$ mkdir -p /Users/telmomota/git/oclint/build/llvm/lib/clang/3.8.0/lib/macho_embedded

@ryuichis
Copy link
Contributor

ryuichis commented Oct 1, 2015

@telmopmota guess this is not an issue related to OCLint code, but it happens while building LLVM/Clang. Probably need to wait Clang community to apply a patch.

@ryuichis
Copy link
Contributor

ryuichis commented Oct 1, 2015

An update on this: -gmodules is the only flag that needs to be removed. It can be done by either deleting occurrences from compile_commands.json file, or add CLANG_ENABLE_MODULE_DEBUGGING=NO to xcodebuild.

I am currently wondering if there is a way to ignore this flag at the tool level.

@telmopmota
Copy link

Thought so @ryuichisaito6. Is it the case to change anything on oclint make scripts to address this for the time being?

@pauljonescodes
Copy link

Just to add, I'm also getting this issue and I can't install oclint myself due to:

screen shot 2015-10-01 at 2 40 39 pm

@ryuichis
Copy link
Contributor

ryuichis commented Oct 1, 2015

@telmopmota nothing on oclint side that we can do to address llvm/clang broken changes. However, I have been wondering to change to semantic versioning model. Once that happens, will keep the master branch goes with the most recent llvm/clang release, and let the working-in-progress code in a separate branch.

@PLJNS thinking this is also the broken code from llvm/clang.

@mdsb100
Copy link

mdsb100 commented Oct 13, 2015

xcode7.0 osx10.10.5
Use oclint-0.9.dev.d18b401
"oclint-xcodebuild xcodebuild.log" work well.

  oclint-json-compilation-database -e Tween.m \
  -e Pods \
  -e Chart/core/jsoncpp \
  -e RKNotificationHub.m \
  -e TTMessage.mm \
  -e SSNetworkInfo.m \
  -e Tween.mm \
  -- -o=report.json \
  -report-type json \
  -rc LONG_LINE=200 \
  -rc SHORT_VARIABLE_NAME=1 \
  -rc LONG_VARIABLE_NAME=50 \
  -rc NCSS_METHOD=80 \
  -rc LONG_METHOD=100 \
  -rc MINIMUM_CASES_IN_SWITCH=1 \
  -disable-rule=HighCyclomaticComplexity \
  -disable-rule=UnusedMethodParameter \
  -disable-rule=LongLine \
  -disable-rule=IvarAssignmentOutsideAccessorsOrInit \
  -disable-rule=UseEarlyExitsAndContinue \
  -disable-rule=TooManyMethods \
  -disable-rule=HighNpathComplexity \
  -disable-rule=TooManyParameters \
  -disable-rule=ParameterReassignment

Assertion failed: (!isAnnotation() && "getIdentifierInfo() on an annotation token!"), function getIdentifierInfo, file /Users/ryuichis/Projects/L/oclint-ci/oclint/llvm/tools/clang/include/clang/Lex/Token.h, line 181.

@ryuichis
Copy link
Contributor

I think this is fixed in the latest dev build. Closing this one.

@erictamlam
Copy link

@RogerGan Has this issue been fixed for you? I have encountered the same problem, and no solutions found yet;(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants