I recently got interested into RenderDoc since it is a good frame debugging tool for single frames, and I need it to debug things like vertex explosions.
First of all I would like to get it to build with cmake.
Most of the errors were luckily enough straightforward to solve, but I got stuck at the ld linking stage with two kind of errors.
The first kind of linking errors is:
These kind of errors occur if I let this command:
The second kind of linking errors is:
These kind of errors occur if I change the previous command in renderdoc/CMakeLists.txt to:
If I understand it correctly linux for example provides its one form of threading for RenderDoc ?
Because I cannot see it in the project, but there is a bsd_threading.cpp file with the following content:
If I set the CMakeLists.txt command to the second one which fails to retrieve function definitions, I guess I must implement them myself ?
Or is there a way I can directly somehow link to FreeBSDs threading approaches like it is done with RenderDocs Linux approach ?
EDIT: Solved that part.
Now I get another error:
EDIT:
Although it was quite a challenge, I succeeded to port over RenderDoc to FreeBSD.
First of all I would like to get it to build with cmake.
Most of the errors were luckily enough straightforward to solve, but I got stuck at the ld linking stage with two kind of errors.
The first kind of linking errors is:
Code:
ld: error: version script assignment of 'global' to symbol 'dlsym' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'execlp' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'execlpe' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'execvp' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol '_exit' failed: symbol not defined
set(RDOC_LINK_FLAGS "-Wl,--undefined,force_include_libentry -Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/${RDOC_BASE_NAME}.version") in renderdoc/CMakeLists.txt unchanged.The second kind of linking errors is:
Code:
ld: error: undefined symbol: Threading::Semaphore::Wake(unsigned int)
>>> referenced by jobsystem.cpp
>>> CMakeFiles/rdoc.dir/common/jobsystem.cpp.o:(Threading::TryWakeFirstSleepingWorker(unsigned long))
>>> referenced by jobsystem.cpp
>>> CMakeFiles/rdoc.dir/common/jobsystem.cpp.o:(Threading::JobSystem::Shutdown())
ld: error: undefined symbol: Threading::Semaphore::WaitForWake()
>>> referenced by jobsystem.cpp
>>> CMakeFiles/rdoc.dir/common/jobsystem.cpp.o:(Threading::WorkerThread(Threading::JobWorker&))
ld: error: undefined symbol: Threading::NumberOfCores()
>>> referenced by jobsystem.cpp
>>> CMakeFiles/rdoc.dir/common/jobsystem.cpp.o:(Threading::JobSystem::Init(unsigned int))
ld: error: undefined symbol: Threading::Semaphore::Create()
>>> referenced by jobsystem.cpp
>>> CMakeFiles/rdoc.dir/common/jobsystem.cpp.o:(Threading::JobSystem::Init(unsigned int))
ld: error: undefined symbol: Threading::Semaphore::Destroy()
>>> referenced by jobsystem.cpp
>>> CMakeFiles/rdoc.dir/common/jobsystem.cpp.o:(Threading::JobSystem::Shutdown())
c++: error: linker command failed with exit code 1 (use -v to see invocation)
set(RDOC_LINK_FLAGS "-Wl,--undefined,force_include_libentry")If I understand it correctly linux for example provides its one form of threading for RenderDoc ?
Because I cannot see it in the project, but there is a bsd_threading.cpp file with the following content:
Code:
/******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2019-2025 Baldur Karlsson
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
******************************************************************************/
#include "os/os_specific.h"
#include <time.h>
#include <unistd.h>
double Timing::GetTickFrequency()
{
return 1000000.0;
}
uint64_t Timing::GetTick()
{
timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return uint64_t(ts.tv_sec) * 1000000000ULL + uint32_t(ts.tv_nsec & 0xffffffff);
}
void Threading::SetCurrentThreadName(const rdcstr &name)
{
}
If I set the CMakeLists.txt command to the second one which fails to retrieve function definitions, I guess I must implement them myself ?
Or is there a way I can directly somehow link to FreeBSDs threading approaches like it is done with RenderDocs Linux approach ?
EDIT: Solved that part.
Now I get another error:
Code:
-- extracting...
src='/home/sdkchan/playground/renderdoc/build/qrenderdoc/local_pcre-prefix/src/pcre-8.45.tar.gz'
dst='/home/sdkchan/playground/renderdoc/build/qrenderdoc/local_pcre-prefix/src/local_pcre'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 93%] No update step for 'local_pcre'
[ 93%] No patch step for 'local_pcre'
[ 94%] Performing configure step for 'local_pcre'
[ 94%] Performing build step for 'local_pcre'
gmake[2]: *** [qrenderdoc/CMakeFiles/local_pcre.dir/build.make:86: qrenderdoc/local_pcre-prefix/src/local_pcre-stamp/local_pcre-build] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:753: qrenderdoc/CMakeFiles/local_pcre.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
EDIT:
Although it was quite a challenge, I succeeded to port over RenderDoc to FreeBSD.