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

Bug Report: 新版本Clang编译JoltPhysics库报错导致项目编译失败 #448

Closed
Mlekow opened this issue May 5, 2023 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@Mlekow
Copy link
Contributor

Mlekow commented May 5, 2023

Describe the bug | Bug描述
项目无法在最新的Clang和Xcode中编译通过。

Steps to reproduce | 如何复现
使用LLVM>=15或最新版Xcode,运行编译脚本即可观察到报错。

Expected behavior | 预期行为
第三方库JoltPhysics正常编译。

Actual behavior | 实际行为
编译JoltPhysics时产生大量报错导致编译失败。

Screenshots/Logs | 截图/日志

CompileC /Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/Objects-normal/arm64/VehicleCollisionTester.o /Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics/Jolt/Physics/Vehicle/VehicleCollisionTester.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'Jolt' from project 'Piccolo')
    cd /Users/mlekow/Documents/repos/Piccolo
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -ivfsstatcache /var/folders/1w/x1psvkys0t3djz6hfk0217j40000gp/C/com.apple.DeveloperTools/14.3-14E222b/Xcode/SDKStatCaches.noindex/macosx13.3-22E245-.sdkstatcache -target arm64-apple-macos13.3 -fmessage-length\=193 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fcolor-diagnostics -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -Wno-implicit-fallthrough -DCMAKE_INTDIR\=\"Debug\" -D_DEBUG -DJPH_PROFILE_ENABLED -DJPH_DEBUG_RENDERER -DPICCOLO_VK_LAYER_PATH\=/Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/VulkanSDK/bin/MacOS -DPICCOLO_VK_ICD_FILENAMES\=/Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/VulkanSDK/bin/MacOS/MoltenVK_icd.json -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -g -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-range-loop-analysis -Wno-semicolon-before-method-body -I/Users/mlekow/Documents/repos/Piccolo/build/engine/3rdparty/JoltPhysics/Build/Debug/include -I/Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics -I/Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/DerivedSources-normal/arm64 -I/Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/DerivedSources/arm64 -I/Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/DerivedSources -F/Users/mlekow/Documents/repos/Piccolo/build/engine/3rdparty/JoltPhysics/Build/Debug -std\=c++17 -I. -Wall -Werror -std\=gnu++17 -MMD -MT dependencies -MF /Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/Objects-normal/arm64/VehicleCollisionTester.d --serialize-diagnostics /Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/Objects-normal/arm64/VehicleCollisionTester.dia -c /Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics/Jolt/Physics/Vehicle/VehicleCollisionTester.cpp -o /Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/Objects-normal/arm64/VehicleCollisionTester.o
In file included from /Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics/Jolt/Physics/Vehicle/VehicleCollisionTester.cpp:6:
In file included from /Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics/Jolt/Physics/Vehicle/VehicleCollisionTester.h:6:
In file included from /Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics/Jolt/Physics/Body/Body.h:8:
In file included from /Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics/Jolt/Physics/Collision/Shape/Shape.h:12:
/Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics/Jolt/Core/Result.h:153:73: error: unqualified call to 'std::move' [-Werror,-Wunqualified-std-cast-call]
        void                            SetError(string &&inError)                                      { Clear(); new (&mError) string(move(inError)); mState = EState::Error; }
                                                                                                                                        ^
                                                                                                                                        std::
In file included from /Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics/Jolt/Physics/Vehicle/VehicleCollisionTester.cpp:12:
In file included from /Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics/Jolt/Physics/PhysicsSystem.h:12:
In file included from /Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics/Jolt/Physics/PhysicsUpdateContext.h:10:
/Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics/Jolt/Core/JobSystem.h:58:65: error: unqualified call to 'std::move' [-Werror,-Wunqualified-std-cast-call]
                inline                          JobHandle(JobHandle &&inHandle) noexcept        : Ref<Job>(move(inHandle)) { }
                                                                                                           ^
                                                                                                           std::
/Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics/Jolt/Core/JobSystem.h:65:89: error: unqualified call to 'std::move' [-Werror,-Wunqualified-std-cast-call]
                inline JobHandle &      operator = (JobHandle &&inHandle) noexcept      { Ref<Job>::operator = (move(inHandle)); return *this; }
                                                                                                                ^
                                                                                                                std::


CompileC /Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/Objects-normal/arm64/VehicleAntiRollBar.o /Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics/Jolt/Physics/Vehicle/VehicleAntiRollBar.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'Jolt' from project 'Piccolo')
    cd /Users/mlekow/Documents/repos/Piccolo
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -ivfsstatcache /var/folders/1w/x1psvkys0t3djz6hfk0217j40000gp/C/com.apple.DeveloperTools/14.3-14E222b/Xcode/SDKStatCaches.noindex/macosx13.3-22E245-.sdkstatcache -target arm64-apple-macos13.3 -fmessage-length\=193 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fcolor-diagnostics -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -Wno-implicit-fallthrough -DCMAKE_INTDIR\=\"Debug\" -D_DEBUG -DJPH_PROFILE_ENABLED -DJPH_DEBUG_RENDERER -DPICCOLO_VK_LAYER_PATH\=/Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/VulkanSDK/bin/MacOS -DPICCOLO_VK_ICD_FILENAMES\=/Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/VulkanSDK/bin/MacOS/MoltenVK_icd.json -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -g -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-range-loop-analysis -Wno-semicolon-before-method-body -I/Users/mlekow/Documents/repos/Piccolo/build/engine/3rdparty/JoltPhysics/Build/Debug/include -I/Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics -I/Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/DerivedSources-normal/arm64 -I/Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/DerivedSources/arm64 -I/Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/DerivedSources -F/Users/mlekow/Documents/repos/Piccolo/build/engine/3rdparty/JoltPhysics/Build/Debug -std\=c++17 -I. -Wall -Werror -std\=gnu++17 -MMD -MT dependencies -MF /Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/Objects-normal/arm64/VehicleAntiRollBar.d --serialize-diagnostics /Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/Objects-normal/arm64/VehicleAntiRollBar.dia -c /Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics/Jolt/Physics/Vehicle/VehicleAntiRollBar.cpp -o /Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/Objects-normal/arm64/VehicleAntiRollBar.o

CompileC /Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/Objects-normal/arm64/Vec3.o /Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics/Jolt/Math/Vec3.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'Jolt' from project 'Piccolo')
    cd /Users/mlekow/Documents/repos/Piccolo
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -ivfsstatcache /var/folders/1w/x1psvkys0t3djz6hfk0217j40000gp/C/com.apple.DeveloperTools/14.3-14E222b/Xcode/SDKStatCaches.noindex/macosx13.3-22E245-.sdkstatcache -target arm64-apple-macos13.3 -fmessage-length\=193 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fcolor-diagnostics -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -Wno-implicit-fallthrough -DCMAKE_INTDIR\=\"Debug\" -D_DEBUG -DJPH_PROFILE_ENABLED -DJPH_DEBUG_RENDERER -DPICCOLO_VK_LAYER_PATH\=/Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/VulkanSDK/bin/MacOS -DPICCOLO_VK_ICD_FILENAMES\=/Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/VulkanSDK/bin/MacOS/MoltenVK_icd.json -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -g -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-range-loop-analysis -Wno-semicolon-before-method-body -I/Users/mlekow/Documents/repos/Piccolo/build/engine/3rdparty/JoltPhysics/Build/Debug/include -I/Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics -I/Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/DerivedSources-normal/arm64 -I/Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/DerivedSources/arm64 -I/Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/DerivedSources -F/Users/mlekow/Documents/repos/Piccolo/build/engine/3rdparty/JoltPhysics/Build/Debug -std\=c++17 -I. -Wall -Werror -std\=gnu++17 -MMD -MT dependencies -MF /Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/Objects-normal/arm64/Vec3.d --serialize-diagnostics /Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/Objects-normal/arm64/Vec3.dia -c /Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics/Jolt/Math/Vec3.cpp -o /Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/Objects-normal/arm64/Vec3.o

CompileC /Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/Objects-normal/arm64/UVec4.o /Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics/Jolt/Math/UVec4.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'Jolt' from project 'Piccolo')
    cd /Users/mlekow/Documents/repos/Piccolo
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -ivfsstatcache /var/folders/1w/x1psvkys0t3djz6hfk0217j40000gp/C/com.apple.DeveloperTools/14.3-14E222b/Xcode/SDKStatCaches.noindex/macosx13.3-22E245-.sdkstatcache -target arm64-apple-macos13.3 -fmessage-length\=193 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fcolor-diagnostics -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -Wno-implicit-fallthrough -DCMAKE_INTDIR\=\"Debug\" -D_DEBUG -DJPH_PROFILE_ENABLED -DJPH_DEBUG_RENDERER -DPICCOLO_VK_LAYER_PATH\=/Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/VulkanSDK/bin/MacOS -DPICCOLO_VK_ICD_FILENAMES\=/Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/VulkanSDK/bin/MacOS/MoltenVK_icd.json -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -g -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-range-loop-analysis -Wno-semicolon-before-method-body -I/Users/mlekow/Documents/repos/Piccolo/build/engine/3rdparty/JoltPhysics/Build/Debug/include -I/Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics -I/Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/DerivedSources-normal/arm64 -I/Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/DerivedSources/arm64 -I/Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/DerivedSources -F/Users/mlekow/Documents/repos/Piccolo/build/engine/3rdparty/JoltPhysics/Build/Debug -std\=c++17 -I. -Wall -Werror -std\=gnu++17 -MMD -MT dependencies -MF /Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/Objects-normal/arm64/UVec4.d --serialize-diagnostics /Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/Objects-normal/arm64/UVec4.dia -c /Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics/Jolt/Math/UVec4.cpp -o /Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/Objects-normal/arm64/UVec4.o

note: Run script build phase 'Generate CMakeFiles/ALL_BUILD' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'ALL_BUILD' from project 'Piccolo')
note: Run script build phase 'CMake PostBuild Rules' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'PiccoloEditor' from project 'Piccolo')
note: Run script build phase 'Generate engine/CMakeFiles/PiccoloPreCompile' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'PiccoloPreCompile' from project 'Piccolo')
note: Run script build phase 'Generate CMakeFiles/ZERO_CHECK' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'ZERO_CHECK' from project 'Piccolo')
note: Run script build phase 'Generate engine/shader/CMakeFiles/PiccoloShaderCompile' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'PiccoloShaderCompile' from project 'Piccolo')
note: Run script build phase 'CMake PostBuild Rules' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'PiccoloParser' from project 'Piccolo')
** BUILD FAILED **


The following build commands failed:
	CompileC /Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/Objects-normal/arm64/Wheel.o /Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics/Jolt/Physics/Vehicle/Wheel.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'Jolt' from project 'Piccolo')
	CompileC /Users/mlekow/Documents/repos/Piccolo/build/build/Jolt.build/Debug/Objects-normal/arm64/VehicleController.o /Users/mlekow/Documents/repos/Piccolo/engine/3rdparty/JoltPhysics/Jolt/Physics/Vehicle/VehicleController.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'Jolt' from project 'Piccolo')
(2 failures)

Desktop | 桌面环境

  • OS: macOS
  • Version: Ventura 13.3.1 (a) (22E772610a)
  • CPU: Apple M1 Pro
  • GPU: Apple M1 Pro
  • Memory: 32 GB
  • Compiler: AppleClang 14.0.3 (Xcode 14.3)

Additional context | 补充信息
问题看起来与未做限定的move操作有关。

@Mlekow Mlekow added the bug Something isn't working label May 5, 2023
@ShenMian
Copy link
Contributor

ShenMian commented May 5, 2023

该问题与 #390 相似.

@Mlekow
Copy link
Contributor Author

Mlekow commented May 5, 2023

#449 给Clang编译器加了一个屏蔽警告的选项,目前测试可以编译通过了。

@Mlekow Mlekow closed this as completed May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants