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

Errors when building against iOS 15 #616

Closed
Foriger opened this issue Sep 21, 2021 · 13 comments
Closed

Errors when building against iOS 15 #616

Foriger opened this issue Sep 21, 2021 · 13 comments

Comments

@Foriger
Copy link

Foriger commented Sep 21, 2021

Issue Summary

A lot of errors like 'could not build module 'UIKit' or 'could not build module 'Foundation' after updating to Xcode 15

Environment

  • Operation system name and version: macOS Big Sur 11.5.2
  • OCLint version: 21.05
  • How OCLint is installed: Homebrew

Sample code

xcodebuild clean -scheme Sample

xcodebuild build -scheme Sample -destination 'platform=iOS Simulator,name=iPhone 11,OS=15.0' -allowProvisioningUpdates | tee xcodebuild.log | xcpretty -r json-compilation-database -o compile_commands.json 

 oclint-json-compilation-database -max-priority-3 0 -max-priority-2 0 -max-priority-1 0

Command to run OCLint with the code above.

Expected Behavior

Generated report.

Actual Behavior

A lot of compiler errors and no analysis

I found one issue from 2015 and version 0.9, which is basically the same:
#240

Is this possible to be the case?

@Foriger
Copy link
Author

Foriger commented Sep 21, 2021

Update: tried to build oclint from source and still doesn't work.

@Foriger
Copy link
Author

Foriger commented Sep 21, 2021

Another update: Created empty Xcode 13. Here is the result of oclint-json-compilation-database:

oclint: error: compilation contains multiple jobs:
 "/usr/local/Cellar/oclint/20.11/bin/oclint-20.11" "-cc1" "-triple" "x86_64-apple-ios15.0.0-simulator" "-Wundef-prefix=TARGET_OS_" "-Werror=undef-prefix" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-Werror=implicit-function-declaration" "-fsyntax-only" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "DataStore" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=all" "-fno-rounding-math" "-munwind-tables" "-target-sdk-version=15.0" "-fcompatibility-qualified-id-block-type-checking" "-target-cpu" "core2" "-debug-info-kind=standalone" "-dwarf-version=4" "-debugger-tuning=lldb" "-target-linker-version" "609" "-resource-dir" "/usr/local/Cellar/oclint/20.11/lib/clang/11.0.0" "-dependency-file" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/Objects-normal/x86_64/main.d" "-MT" "dependencies" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk" "-iquote" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/HelloWorld2-generated-files.hmap" "-iquote" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/HelloWorld2-project-headers.hmap" "-D" "DEBUG=1" "-D" "OBJC_OLD_DISPATCH_PROTOTYPES=0" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/HelloWorld2-own-target-headers.hmap" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/HelloWorld2-all-target-headers.hmap" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Products/Debug-iphonesimulator/include" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/DerivedSources-normal/x86_64" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/DerivedSources/x86_64" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/DerivedSources" "-F/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Products/Debug-iphonesimulator" "-D" "__OCLINT__" "-internal-isystem" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/local/include" "-internal-isystem" "/usr/local/Cellar/oclint/20.11/lib/clang/11.0.0/include" "-internal-externc-isystem" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include" "-O0" "-Wnon-modular-include-in-framework-module" "-Werror=non-modular-include-in-framework-module" "-Wno-trigraphs" "-Wno-missing-field-initializers" "-Wno-missing-prototypes" "-Werror=return-type" "-Wdocumentation" "-Wunreachable-code" "-Wquoted-include-in-framework-header" "-Wno-implicit-atomic-properties" "-Werror=deprecated-objc-isa-usage" "-Wno-objc-interface-ivars" "-Werror=objc-root-class" "-Wno-arc-repeated-use-of-weak" "-Wimplicit-retain-self" "-Wduplicate-method-match" "-Wno-missing-braces" "-Wparentheses" "-Wswitch" "-Wunused-function" "-Wno-unused-label" "-Wno-unused-parameter" "-Wunused-variable" "-Wunused-value" "-Wempty-body" "-Wuninitialized" "-Wconditional-uninitialized" "-Wno-unknown-pragmas" "-Wno-shadow" "-Wno-four-char-constants" "-Wno-conversion" "-Wconstant-conversion" "-Wint-conversion" "-Wbool-conversion" "-Wenum-conversion" "-Wno-float-conversion" "-Wnon-literal-null-conversion" "-Wobjc-literal-conversion" "-Wshorten-64-to-32" "-Wpointer-sign" "-Wno-newline-eof" "-Wno-selector" "-Wno-strict-selector-match" "-Wundeclared-selector" "-Wdeprecated-implementations" "-Wprotocol" "-Wdeprecated-declarations" "-Wno-sign-conversion" "-Winfinite-recursion" "-Wcomma" "-Wblock-capture-autoreleasing" "-Wstrict-prototypes" "-Wno-semicolon-before-method-body" "-Wunguarded-availability" "-std=gnu11" "-fdebug-compilation-dir" "/" "-ferror-limit" "19" "-fmacro-backtrace-limit" "0" "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fmodules" "-fimplicit-module-maps" "-fmodules-cache-path=/Users/user/Library/Developer/Xcode/DerivedData/ModuleCache.noindex" "-fmodules-prune-interval=86400" "-fmodules-prune-after=345600" "-fbuild-session-timestamp=1632233906569556285" "-fmodules-validate-once-per-build-session" "-fmodules-validate-system-headers" "-fobjc-runtime=ios-15.0.0" "-fobjc-arc" "-fobjc-weak" "-fobjc-exceptions" "-fexceptions" "-fpascal-strings" "-fmax-type-align=16" "-fdiagnostics-show-note-include-stack" "-fasm-blocks" "-serialize-diagnostic-file" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/Objects-normal/x86_64/main.dia" "-x" "objective-c" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Index/DataStore";  "/usr/local/Cellar/oclint/20.11/bin/oclint-20.11" "-cc1" "-triple" "x86_64-apple-ios15.0.0-simulator" "-Wundef-prefix=TARGET_OS_" "-Werror=undef-prefix" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-Werror=implicit-function-declaration" "-fsyntax-only" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "main.m" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=all" "-fno-rounding-math" "-munwind-tables" "-target-sdk-version=15.0" "-fcompatibility-qualified-id-block-type-checking" "-target-cpu" "core2" "-debug-info-kind=standalone" "-dwarf-version=4" "-debugger-tuning=lldb" "-target-linker-version" "609" "-resource-dir" "/usr/local/Cellar/oclint/20.11/lib/clang/11.0.0" "-dependency-file" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/Objects-normal/x86_64/main.d" "-MT" "dependencies" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk" "-iquote" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/HelloWorld2-generated-files.hmap" "-iquote" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/HelloWorld2-project-headers.hmap" "-D" "DEBUG=1" "-D" "OBJC_OLD_DISPATCH_PROTOTYPES=0" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/HelloWorld2-own-target-headers.hmap" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/HelloWorld2-all-target-headers.hmap" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Products/Debug-iphonesimulator/include" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/DerivedSources-normal/x86_64" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/DerivedSources/x86_64" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/DerivedSources" "-F/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Products/Debug-iphonesimulator" "-D" "__OCLINT__" "-internal-isystem" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/local/include" "-internal-isystem" "/usr/local/Cellar/oclint/20.11/lib/clang/11.0.0/include" "-internal-externc-isystem" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include" "-O0" "-Wnon-modular-include-in-framework-module" "-Werror=non-modular-include-in-framework-module" "-Wno-trigraphs" "-Wno-missing-field-initializers" "-Wno-missing-prototypes" "-Werror=return-type" "-Wdocumentation" "-Wunreachable-code" "-Wquoted-include-in-framework-header" "-Wno-implicit-atomic-properties" "-Werror=deprecated-objc-isa-usage" "-Wno-objc-interface-ivars" "-Werror=objc-root-class" "-Wno-arc-repeated-use-of-weak" "-Wimplicit-retain-self" "-Wduplicate-method-match" "-Wno-missing-braces" "-Wparentheses" "-Wswitch" "-Wunused-function" "-Wno-unused-label" "-Wno-unused-parameter" "-Wunused-variable" "-Wunused-value" "-Wempty-body" "-Wuninitialized" "-Wconditional-uninitialized" "-Wno-unknown-pragmas" "-Wno-shadow" "-Wno-four-char-constants" "-Wno-conversion" "-Wconstant-conversion" "-Wint-conversion" "-Wbool-conversion" "-Wenum-conversion" "-Wno-float-conversion" "-Wnon-literal-null-conversion" "-Wobjc-literal-conversion" "-Wshorten-64-to-32" "-Wpointer-sign" "-Wno-newline-eof" "-Wno-selector" "-Wno-strict-selector-match" "-Wundeclared-selector" "-Wdeprecated-implementations" "-Wprotocol" "-Wdeprecated-declarations" "-Wno-sign-conversion" "-Winfinite-recursion" "-Wcomma" "-Wblock-capture-autoreleasing" "-Wstrict-prototypes" "-Wno-semicolon-before-method-body" "-Wunguarded-availability" "-std=gnu11" "-fdebug-compilation-dir" "/" "-ferror-limit" "19" "-fmacro-backtrace-limit" "0" "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fmodules" "-fimplicit-module-maps" "-fmodules-cache-path=/Users/user/Library/Developer/Xcode/DerivedData/ModuleCache.noindex" "-fmodules-prune-interval=86400" "-fmodules-prune-after=345600" "-fbuild-session-timestamp=1632233906569556285" "-fmodules-validate-once-per-build-session" "-fmodules-validate-system-headers" "-fobjc-runtime=ios-15.0.0" "-fobjc-arc" "-fobjc-weak" "-fobjc-exceptions" "-fexceptions" "-fpascal-strings" "-fmax-type-align=16" "-fdiagnostics-show-note-include-stack" "-fasm-blocks" "-serialize-diagnostic-file" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/Objects-normal/x86_64/main.dia" "-x" "objective-c" "/Users/user/Development/HelloWorld2/HelloWorld2/main.m"; 

@ryuichis
Copy link
Contributor

We usually have this type of error during Xcode major releases. To solve it, OCLint needs to be built with the same LLVM version as the Xcode. This year, Xcode 13 requires LLVM 13.0.0, which is not officially released to date. We'll have to wait until that happens first.

@Davidxiaoshuo
Copy link

We usually have this type of error during Xcode major releases. To solve it, OCLint needs to be built with the same LLVM version as the Xcode. This year, Xcode 13 requires LLVM 13.0.0, which is not officially released to date. We'll have to wait until that happens first.

When is it expected to be resolved?

@ryuichis
Copy link
Contributor

@Davidxiaoshuo I can't control when LLVM releases 13.0.0, their website https://llvm.org/ says two days ago, but I am not seeing it happening now. If you can't wait, please manually change the llvm path to their 13.0.0-rc3 version, and build it locally yourself.

@pancho-romero-dexcom
Copy link

Another update: Created empty Xcode 13. Here is the result of oclint-json-compilation-database:

oclint: error: compilation contains multiple jobs:
 "/usr/local/Cellar/oclint/20.11/bin/oclint-20.11" "-cc1" "-triple" "x86_64-apple-ios15.0.0-simulator" "-Wundef-prefix=TARGET_OS_" "-Werror=undef-prefix" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-Werror=implicit-function-declaration" "-fsyntax-only" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "DataStore" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=all" "-fno-rounding-math" "-munwind-tables" "-target-sdk-version=15.0" "-fcompatibility-qualified-id-block-type-checking" "-target-cpu" "core2" "-debug-info-kind=standalone" "-dwarf-version=4" "-debugger-tuning=lldb" "-target-linker-version" "609" "-resource-dir" "/usr/local/Cellar/oclint/20.11/lib/clang/11.0.0" "-dependency-file" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/Objects-normal/x86_64/main.d" "-MT" "dependencies" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk" "-iquote" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/HelloWorld2-generated-files.hmap" "-iquote" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/HelloWorld2-project-headers.hmap" "-D" "DEBUG=1" "-D" "OBJC_OLD_DISPATCH_PROTOTYPES=0" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/HelloWorld2-own-target-headers.hmap" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/HelloWorld2-all-target-headers.hmap" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Products/Debug-iphonesimulator/include" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/DerivedSources-normal/x86_64" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/DerivedSources/x86_64" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/DerivedSources" "-F/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Products/Debug-iphonesimulator" "-D" "__OCLINT__" "-internal-isystem" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/local/include" "-internal-isystem" "/usr/local/Cellar/oclint/20.11/lib/clang/11.0.0/include" "-internal-externc-isystem" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include" "-O0" "-Wnon-modular-include-in-framework-module" "-Werror=non-modular-include-in-framework-module" "-Wno-trigraphs" "-Wno-missing-field-initializers" "-Wno-missing-prototypes" "-Werror=return-type" "-Wdocumentation" "-Wunreachable-code" "-Wquoted-include-in-framework-header" "-Wno-implicit-atomic-properties" "-Werror=deprecated-objc-isa-usage" "-Wno-objc-interface-ivars" "-Werror=objc-root-class" "-Wno-arc-repeated-use-of-weak" "-Wimplicit-retain-self" "-Wduplicate-method-match" "-Wno-missing-braces" "-Wparentheses" "-Wswitch" "-Wunused-function" "-Wno-unused-label" "-Wno-unused-parameter" "-Wunused-variable" "-Wunused-value" "-Wempty-body" "-Wuninitialized" "-Wconditional-uninitialized" "-Wno-unknown-pragmas" "-Wno-shadow" "-Wno-four-char-constants" "-Wno-conversion" "-Wconstant-conversion" "-Wint-conversion" "-Wbool-conversion" "-Wenum-conversion" "-Wno-float-conversion" "-Wnon-literal-null-conversion" "-Wobjc-literal-conversion" "-Wshorten-64-to-32" "-Wpointer-sign" "-Wno-newline-eof" "-Wno-selector" "-Wno-strict-selector-match" "-Wundeclared-selector" "-Wdeprecated-implementations" "-Wprotocol" "-Wdeprecated-declarations" "-Wno-sign-conversion" "-Winfinite-recursion" "-Wcomma" "-Wblock-capture-autoreleasing" "-Wstrict-prototypes" "-Wno-semicolon-before-method-body" "-Wunguarded-availability" "-std=gnu11" "-fdebug-compilation-dir" "/" "-ferror-limit" "19" "-fmacro-backtrace-limit" "0" "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fmodules" "-fimplicit-module-maps" "-fmodules-cache-path=/Users/user/Library/Developer/Xcode/DerivedData/ModuleCache.noindex" "-fmodules-prune-interval=86400" "-fmodules-prune-after=345600" "-fbuild-session-timestamp=1632233906569556285" "-fmodules-validate-once-per-build-session" "-fmodules-validate-system-headers" "-fobjc-runtime=ios-15.0.0" "-fobjc-arc" "-fobjc-weak" "-fobjc-exceptions" "-fexceptions" "-fpascal-strings" "-fmax-type-align=16" "-fdiagnostics-show-note-include-stack" "-fasm-blocks" "-serialize-diagnostic-file" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/Objects-normal/x86_64/main.dia" "-x" "objective-c" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Index/DataStore";  "/usr/local/Cellar/oclint/20.11/bin/oclint-20.11" "-cc1" "-triple" "x86_64-apple-ios15.0.0-simulator" "-Wundef-prefix=TARGET_OS_" "-Werror=undef-prefix" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-Werror=implicit-function-declaration" "-fsyntax-only" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "main.m" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=all" "-fno-rounding-math" "-munwind-tables" "-target-sdk-version=15.0" "-fcompatibility-qualified-id-block-type-checking" "-target-cpu" "core2" "-debug-info-kind=standalone" "-dwarf-version=4" "-debugger-tuning=lldb" "-target-linker-version" "609" "-resource-dir" "/usr/local/Cellar/oclint/20.11/lib/clang/11.0.0" "-dependency-file" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/Objects-normal/x86_64/main.d" "-MT" "dependencies" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk" "-iquote" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/HelloWorld2-generated-files.hmap" "-iquote" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/HelloWorld2-project-headers.hmap" "-D" "DEBUG=1" "-D" "OBJC_OLD_DISPATCH_PROTOTYPES=0" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/HelloWorld2-own-target-headers.hmap" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/HelloWorld2-all-target-headers.hmap" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Products/Debug-iphonesimulator/include" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/DerivedSources-normal/x86_64" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/DerivedSources/x86_64" "-I" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/DerivedSources" "-F/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Products/Debug-iphonesimulator" "-D" "__OCLINT__" "-internal-isystem" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/local/include" "-internal-isystem" "/usr/local/Cellar/oclint/20.11/lib/clang/11.0.0/include" "-internal-externc-isystem" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/include" "-O0" "-Wnon-modular-include-in-framework-module" "-Werror=non-modular-include-in-framework-module" "-Wno-trigraphs" "-Wno-missing-field-initializers" "-Wno-missing-prototypes" "-Werror=return-type" "-Wdocumentation" "-Wunreachable-code" "-Wquoted-include-in-framework-header" "-Wno-implicit-atomic-properties" "-Werror=deprecated-objc-isa-usage" "-Wno-objc-interface-ivars" "-Werror=objc-root-class" "-Wno-arc-repeated-use-of-weak" "-Wimplicit-retain-self" "-Wduplicate-method-match" "-Wno-missing-braces" "-Wparentheses" "-Wswitch" "-Wunused-function" "-Wno-unused-label" "-Wno-unused-parameter" "-Wunused-variable" "-Wunused-value" "-Wempty-body" "-Wuninitialized" "-Wconditional-uninitialized" "-Wno-unknown-pragmas" "-Wno-shadow" "-Wno-four-char-constants" "-Wno-conversion" "-Wconstant-conversion" "-Wint-conversion" "-Wbool-conversion" "-Wenum-conversion" "-Wno-float-conversion" "-Wnon-literal-null-conversion" "-Wobjc-literal-conversion" "-Wshorten-64-to-32" "-Wpointer-sign" "-Wno-newline-eof" "-Wno-selector" "-Wno-strict-selector-match" "-Wundeclared-selector" "-Wdeprecated-implementations" "-Wprotocol" "-Wdeprecated-declarations" "-Wno-sign-conversion" "-Winfinite-recursion" "-Wcomma" "-Wblock-capture-autoreleasing" "-Wstrict-prototypes" "-Wno-semicolon-before-method-body" "-Wunguarded-availability" "-std=gnu11" "-fdebug-compilation-dir" "/" "-ferror-limit" "19" "-fmacro-backtrace-limit" "0" "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fmodules" "-fimplicit-module-maps" "-fmodules-cache-path=/Users/user/Library/Developer/Xcode/DerivedData/ModuleCache.noindex" "-fmodules-prune-interval=86400" "-fmodules-prune-after=345600" "-fbuild-session-timestamp=1632233906569556285" "-fmodules-validate-once-per-build-session" "-fmodules-validate-system-headers" "-fobjc-runtime=ios-15.0.0" "-fobjc-arc" "-fobjc-weak" "-fobjc-exceptions" "-fexceptions" "-fpascal-strings" "-fmax-type-align=16" "-fdiagnostics-show-note-include-stack" "-fasm-blocks" "-serialize-diagnostic-file" "/Users/user/Library/Developer/Xcode/DerivedData/HelloWorld2-diagmuiuklzxjndwcdjxrvvpjzzn/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphonesimulator/HelloWorld2.build/Objects-normal/x86_64/main.dia" "-x" "objective-c" "/Users/user/Development/HelloWorld2/HelloWorld2/main.m"; 

use something like this :

xcodebuild -workspace "XXXX.xcworkspace" -scheme "YYYY-scheme" COMPILER_INDEX_STORE_ENABLE=NO

@ryuichis
Copy link
Contributor

ryuichis commented Oct 4, 2021

Just an update: while LLVM 13.0.0 is tagged, I am not seeing the artifacts available for macOS and Linux just yet. Will pay attention to its updates. In the meanwhile, 1) please try the COMPILER_INDEX_STORE_ENABLE=NO approach, or 2) you could build LLVM 13.0.0 locally and point to it when building oclint locally.

@Foriger
Copy link
Author

Foriger commented Oct 7, 2021

COMPILER_INDEX_STORE_ENABLE=NO setting doesn't work for me.

@ryuichis
Copy link
Contributor

I believe the master branch should have this addressed. But you need to make sure 1) you have an Intel mac; 2) you are running macOS Monterey; and 3) you have Xcode 13.1.

If you meet all requirements, download the latest release binary, clean your archived folder, delete and re-generate the compile_commands file, and you should be good to go.

If you don't meet the above requirement, you need to manually build oclint locally, so that it is correctly compiled using your arch/os/xcode. Once you have a local build, then clean your archived folder, re-generate the compile_commands file for your project.

I am not sure the status of building oclint on an M1 based mac yet, my order of the new macbook pro is expected to ship in early December, so I can only verify it probably for the next release, not this one.

@guzuqing
Copy link

ios15.0.0

i find this oclint source code in oclint-driver/lib/driver.cpp at line 156

if (jobSize > 1 && !offloadCompilation)
{
    throw oclint::GenericException("compilation contains multiple jobs:\n" +
        compilationJobsToString(jobList) + "\n");
}

which shows the reson is
"
const clang::driver::JobList &jobList = compilation->getJobs();
auto jobSize = jobList.size();
"
jobsize >1 and offloadCompilation flag == No

in my case
my complile_command.json set "g -gline-tables-only -g -gline-tables-only -arch i386 -arch x86_64" tow -arch in one item , i delete one of the -archs so error wis fixed, but i don not know why @ryuichis do you konw why?

@guzuqing
Copy link

the file "oclint-driver/lib/Driver.cpp" checkout commit to 2d1ee18
image

""
for (auto job : jobList) {
const clang::driver::Command &cmd = clang::castclang::driver::Command(job);
if (llvm::StringRef(cmd.getCreator().getName()) != "clang")

    {
        throw oclint::GenericException("expected a clang compiler command");
    }
    invocations.push_back(newInvocation(&diagnosticsEngine, cmd.getArguments()));
}

""
recompile and fixed my case

@ryuichis
Copy link
Contributor

ryuichis commented Jan 9, 2022

@guzuqing could you please elaborate your use case a little more? The commit you found was a temporary workaround to support checking CUDA code for GPU offloading, where multiple architectures are supported. However, your initial compilation builds your target in both i386 and x86_64 architectures. Allowing multiple invocation would, from my understanding, just run the same static analysis twice, as they are all CPU targets.

I have been thinking if it makes sense to introduce a flag that allows multiple jobs. But I seem not to find a good justification to allow this.

@CodeSnowMonkey
Copy link

CodeSnowMonkey commented Dec 26, 2023

COMPILER_INDEX_STORE_ENABLE=NO setting doesn't work for me.

Is this problem solved? I had the same problem
Xcode 15.1, macOS 14.1.1
OCLint version: 22.02

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

6 participants