build: disable control-flow architecture protection

fix: building since last commit
This commit is contained in:
jeefo 2023-04-13 03:23:59 +03:00
commit 77c39812f8
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
4 changed files with 17 additions and 15 deletions

View file

@ -489,7 +489,7 @@ template <typename ...Args> bool BotGraph::raiseLoadingError (bool isGraph, MemF
auto result = strings.format (fmt, cr::forward <Args> (args)...); auto result = strings.format (fmt, cr::forward <Args> (args)...);
// display error only for graph file // display error only for graph file
if (isGraph || cv_debug.bool_ ()) { if (isGraph) {
logger.error (result); logger.error (result);
} }

View file

@ -112,7 +112,8 @@ if cxx == 'clang' or cxx == 'gcc'
if os != 'darwin' and os != 'windows' and cpu != 'aarch64' if os != 'darwin' and os != 'windows' and cpu != 'aarch64'
cxxflags += [ cxxflags += [
'-fdata-sections', '-fdata-sections',
'-ffunction-sections' '-ffunction-sections',
'-fcf-protection=none'
] ]
ldflags += [ ldflags += [
@ -254,7 +255,8 @@ shared_library(
sources, sources,
include_directories: includes, include_directories: includes,
gnu_symbol_visibility: 'hidden', gnu_symbol_visibility: 'hidden',
name_prefix: '') name_prefix: ''
)
run_target('package', run_target('package',
command: ['python3', meson.project_source_root() + '/package.py', '@0@.@1@'.format(bot_version, count)]) command: ['python3', meson.project_source_root() + '/package.py', '@0@.@1@'.format(bot_version, count)])

View file

@ -761,8 +761,6 @@ int BotControl::cmdNodeUpload () {
String uploadUrl = cv_graph_url_upload.str (); String uploadUrl = cv_graph_url_upload.str ();
game.print ("%s", uploadUrl);
// try to upload the file // try to upload the file
if (http.uploadFile (uploadUrl, util.buildPath (BotFile::Graph))) { if (http.uploadFile (uploadUrl, util.buildPath (BotFile::Graph))) {
msg ("Graph file was successfully validated and uploaded to the YaPB Graph DB (%s).", product.download); msg ("Graph file was successfully validated and uploaded to the YaPB Graph DB (%s).", product.download);

View file

@ -1683,6 +1683,8 @@ template <typename U> bool BotGraph::loadStorage (StringRef name, StorageOption
// graphs can be downloaded... // graphs can be downloaded...
bool isGraph = !!(options & StorageOption::Graph); bool isGraph = !!(options & StorageOption::Graph);
bool isGraphOrDebug = isGraph || cv_debug.bool_ ();
MemFile file (filename); // open the file MemFile file (filename); // open the file
data.clear (); data.clear ();
@ -1705,7 +1707,7 @@ template <typename U> bool BotGraph::loadStorage (StringRef name, StorageOption
// if graph & attempted to load multiple times, bail out, we're failed // if graph & attempted to load multiple times, bail out, we're failed
if (isGraph && ++m_loadAttempts > 2) { if (isGraph && ++m_loadAttempts > 2) {
m_loadAttempts = 0; m_loadAttempts = 0;
return raiseLoadingError (isGraph, file, "Unable to load %s (filename: '%s'). Download process has failed as well. No nodes has been found.", name, filename); return raiseLoadingError (isGraphOrDebug, file, "Unable to load %s (filename: '%s'). Download process has failed as well. No nodes has been found.", name, filename);
} }
// downloader for graph // downloader for graph
@ -1752,7 +1754,7 @@ template <typename U> bool BotGraph::loadStorage (StringRef name, StorageOption
if (tryReload ()) { if (tryReload ()) {
return true; return true;
} }
return raiseLoadingError (isGraph, file, "Unable to open %s file for reading (filename: '%s').", name, filename); return raiseLoadingError (isGraphOrDebug, file, "Unable to open %s file for reading (filename: '%s').", name, filename);
} }
// read the header // read the header
@ -1764,12 +1766,12 @@ template <typename U> bool BotGraph::loadStorage (StringRef name, StorageOption
if (tryReload ()) { if (tryReload ()) {
return true; return true;
} }
return raiseLoadingError (isGraph, file, "Unable to read magic of %s (filename: '%s').", name, filename); return raiseLoadingError (isGraphOrDebug, file, "Unable to read magic of %s (filename: '%s').", name, filename);
} }
// check the path-numbers // check the path-numbers
if (!isGraph && hdr.length != length ()) { if (!isGraph && hdr.length != length ()) {
return raiseLoadingError (isGraph, file, "Damaged %s (filename: '%s'). Mismatch number of nodes (got: '%d', need: '%d').", name, filename, hdr.length, m_paths.length ()); return raiseLoadingError (isGraphOrDebug, file, "Damaged %s (filename: '%s'). Mismatch number of nodes (got: '%d', need: '%d').", name, filename, hdr.length, m_paths.length ());
} }
// check the count // check the count
@ -1777,7 +1779,7 @@ template <typename U> bool BotGraph::loadStorage (StringRef name, StorageOption
if (tryReload ()) { if (tryReload ()) {
return true; return true;
} }
return raiseLoadingError (isGraph, file, "Damaged %s (filename: '%s'). Paths length is overflowed (got: '%d').", name, filename, hdr.length); return raiseLoadingError (isGraphOrDebug, file, "Damaged %s (filename: '%s'). Paths length is overflowed (got: '%d').", name, filename, hdr.length);
} }
// check the version // check the version
@ -1785,7 +1787,7 @@ template <typename U> bool BotGraph::loadStorage (StringRef name, StorageOption
ctrl.msg ("Graph version mismatch %s (filename: '%s'). Version number differs (got: '%d', need: '%d') Please, upgrade %s.", name, filename, hdr.version, version, product.name); ctrl.msg ("Graph version mismatch %s (filename: '%s'). Version number differs (got: '%d', need: '%d') Please, upgrade %s.", name, filename, hdr.version, version, product.name);
} }
else if (hdr.version > version && !isGraph) { else if (hdr.version > version && !isGraph) {
return raiseLoadingError (isGraph, file, "Damaged %s (filename: '%s'). Version number differs (got: '%d', need: '%d').", name, filename, hdr.version, version); return raiseLoadingError (isGraphOrDebug, file, "Damaged %s (filename: '%s'). Version number differs (got: '%d', need: '%d').", name, filename, hdr.version, version);
} }
// temporary solution to kill version 1 vistables, which has a bugs // temporary solution to kill version 1 vistables, which has a bugs
@ -1795,7 +1797,7 @@ template <typename U> bool BotGraph::loadStorage (StringRef name, StorageOption
if (File::exists (vistablePath)) { if (File::exists (vistablePath)) {
plat.removeFile (vistablePath.chars ()); plat.removeFile (vistablePath.chars ());
} }
return raiseLoadingError (isGraph, file, "Bugged vistable %s (filename: '%s'). Version 1 has a bugs, vistable will be recreated.", name, filename); return raiseLoadingError (isGraphOrDebug, file, "Bugged vistable %s (filename: '%s'). Version 1 has a bugs, vistable will be recreated.", name, filename);
} }
// save graph version // save graph version
@ -1805,7 +1807,7 @@ template <typename U> bool BotGraph::loadStorage (StringRef name, StorageOption
// check the storage type // check the storage type
if ((hdr.options & options) != options) { if ((hdr.options & options) != options) {
return raiseLoadingError (isGraph, file, "Incorrect storage format for %s (filename: '%s').", name, filename); return raiseLoadingError (isGraphOrDebug, file, "Incorrect storage format for %s (filename: '%s').", name, filename);
} }
auto compressedSize = static_cast <size_t> (hdr.compressed); auto compressedSize = static_cast <size_t> (hdr.compressed);
auto numberNodes = static_cast <size_t> (hdr.length); auto numberNodes = static_cast <size_t> (hdr.length);
@ -1822,7 +1824,7 @@ template <typename U> bool BotGraph::loadStorage (StringRef name, StorageOption
// try to uncompress // try to uncompress
if (ulz.uncompress (compressed.data (), hdr.compressed, reinterpret_cast <uint8_t *> (data.data ()), hdr.uncompressed) == ULZ::UncompressFailure) { if (ulz.uncompress (compressed.data (), hdr.compressed, reinterpret_cast <uint8_t *> (data.data ()), hdr.uncompressed) == ULZ::UncompressFailure) {
return raiseLoadingError (isGraph, file, "Unable to decompress ULZ data for %s (filename: '%s').", name, filename); return raiseLoadingError (isGraphOrDebug, file, "Unable to decompress ULZ data for %s (filename: '%s').", name, filename);
} }
else { else {
@ -1857,7 +1859,7 @@ template <typename U> bool BotGraph::loadStorage (StringRef name, StorageOption
} }
} }
else { else {
return raiseLoadingError (isGraph, file, "Unable to read ULZ data for %s (filename: '%s').", name, filename); return raiseLoadingError (isGraphOrDebug, file, "Unable to read ULZ data for %s (filename: '%s').", name, filename);
} }
return false; return false;
} }