-
Notifications
You must be signed in to change notification settings - Fork 378
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
linux - cannot build libraries (error: 'src' is an unsafe pointer used for buffer access [-Werror,-Wunsafe-buffer-usage]) #277
Comments
I also tried building physx on linux today, via vcpkg, and got interestingly similar but slightly different build errors. I see in your errors the file DyFeatherstoneArticulation.h, whereas I'm seeing errors in DyFeatherstoneForwardDynamic.cpp The errors I get involve stringop-overread issues, such as:
I'm assuming our issues are somewhat related as we're both building on linux on the same day and both getting compile failures related to warnings treated as errors in DyFeatherstone stuff. For reference, my repro using vcpkg is simply:
Doing the above fails. It seems like debug build succeeds but release build fails? |
I also tried building with vcpckg but had totally different errors I was able to get past this error by editing the following file: and changed line 30 to the following:
basically disabling "warnings as errors" |
Thanks for reporting this. Yes for now just disable that warning using |
@PcChip - what version of clang are you using? We list supported compiler versions here: https://github.com/NVIDIA-Omniverse/PhysX/blob/main/physx/documentation/platformreadme/linux/README_LINUX.md#required-packages-to-generate-projects |
Hello, thanks for the link - I was viewing the documentation here: https://nvidia-omniverse.github.io/PhysX/physx/5.3.1/docs/BuildingWithPhysX.html#generating-projects-with-cmake and I did not see that mentioned so I didn't even know I needed clang installed I am using whatever version installs on Kubuntu 23.10 when typing "sudo apt install clang" , I can check and update this post when I get home I do appreciate the responses, thank you for your time! |
You are right, the platform readme here: https://github.com/NVIDIA-Omniverse/PhysX/blob/main/physx/documentation/platformreadme/linux/README_LINUX.md mentions gcc or clang which is not precise. We will fix that in the next release together with the warnings. |
Internal tracking: PX-5053 |
Hi, in the meantime, is there a workaround? I'm pretty blocked. If I'm unable to consume PhysX via package management systems, are there directions somewhere on how to manually integrate PhysX with a cmake-based project? I don't see any official directions other than for how to do a manual build of PhysX, which is a process that does not remotely integrate with a cross-platform cmake-based project. Are there any official examples of doing this? Thank you |
Can I suggest making a change such that the -Werror flag is not enabled by default in the source that's released to the public? Maybe just do that work as a one word quick fix, separate from fixing the warnings? Even if you put in the time to fix the warnings and get things building again, there's always going to be new compiler versions in the future that will cause new warnings and then the build will be broken again. Given that it's been many, many months that PhysX has not built successfully on Linux, it doesn't seem like there's the resources to keep on top of things and quickly support newer compiler versions, so in that case warnings=error should definitely be turned off by default so that it'll naturally at least just keep building going into the future without further work needed. You can have whatever internal setup you want for always building with -Werror , it just isn't ideal to have it enabled by default in source that's released and built by consumers. Also, I just wanted to clarify the scope of this problem:
(Assuming I don't want to use a 3+ year old compiler as my system compiler, which I don't). |
Library and Version
Example: PhysX v5.3.1
Operating System
Linux (Kubuntu 23.10)
Steps to Trigger Behavior
Expected Behavior
libraries are compiled
Actual Behavior
dozens of errors such as the following:
error: unsafe buffer access [-Werror,-Wunsafe-buffer-usage]
The text was updated successfully, but these errors were encountered: