Skip to content

Commit

Permalink
Add "used" attribute to XML data symbol when creating compressed config
Browse files Browse the repository at this point in the history
The __attribute__((used)) tells the compiler not to make the symbol
local when optimizing. This happens when LTO is used when building a
VESC package.
  • Loading branch information
lukash committed Jan 15, 2024
1 parent 10f36a1 commit 566b084
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,7 @@ bool Utility::createCompressedConfigC(ConfigParams *params, QString configName,

outSource << "// This file is autogenerated by VESC Tool\n\n";
outSource << "#include \"" << headerInfo.fileName() << "\"\n\n";
outSource << "uint8_t data_" << configNameStr << "[" << compressed.size() << "] = {\n\t";
outSource << "__attribute__((used)) uint8_t data_" << configNameStr << "[" << compressed.size() << "] = {\n\t";

int posCnt = 0;
for (auto b: compressed) {
Expand Down

0 comments on commit 566b084

Please sign in to comment.