]> git.ipfire.org Git - thirdparty/ccache.git/commit
fix: Fix binary patching of sysconfdir for Linux prebuilt binary
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 28 Sep 2024 19:16:05 +0000 (21:16 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 17 Oct 2024 19:56:57 +0000 (21:56 +0200)
commite24e82fb73174dbca45cbf5b53d266d156114845
treeb7acedb99612543ca87ddba08e86492dde29ce6c
parentd7c94f782637cd439c90f7518e73b7c100c5ffe1
fix: Fix binary patching of sysconfdir for Linux prebuilt binary

After fs::path-ification it no longer works to binary patch sysconfdir
at install time since the compiler apparently makes a note of the actual
length of SYSCONFDIR in

    const char k_sysconfdir[4096 + 1] = SYSCONFDIR;

and uses the length in the

    fs::path sysconfdir(k_sysconfdir);

call. When patching the SYSCONFDIR string the length of the original
string is used so that only the first strlen(SYSCONFDIR) part of the new
sysconfdir will be used.

Fix this by adding a pointer indirection which makes binary patching
work again.
src/ccache/config.cpp