diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2020-06-16 16:55:05 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2020-06-16 17:01:05 +0000 |
commit | e9f213d30d436641509de7cbb0941dc6a26ea2a1 (patch) | |
tree | f931928cc34e15a1a82121d53b9700da6587bbcf /share/qbs/modules/cpp/iar.js | |
parent | 53c8000f034b68fae41d3f071be9ab5fe875827b (diff) |
baremetal: Fix generation of static libraries using IAR toolchain
A problem was in that we use wrong 'xlib' utility to create
the static libraries; we need to use the 'xar' utility instead.
This utility delivered only for the following architectures:
mcs51, avr, avr32, msp430, v850, 78k, m68k, m32c, r32c, m16c, cr16
in other cases we need to use the 'iarchive' utility.
Change-Id: I69660d22842e2011aa02187021f491f270491144
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'share/qbs/modules/cpp/iar.js')
-rw-r--r-- | share/qbs/modules/cpp/iar.js | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/share/qbs/modules/cpp/iar.js b/share/qbs/modules/cpp/iar.js index 5b9888c55..f67b6297b 100644 --- a/share/qbs/modules/cpp/iar.js +++ b/share/qbs/modules/cpp/iar.js @@ -53,6 +53,22 @@ function supportILinker(architecture) { || architecture === "sh" || architecture === "riscv"; } +function supportXArchiver(architecture) { + return architecture === "mcs51" || architecture === "avr" + || architecture === "msp430" || architecture === "v850" + || architecture === "78k" || architecture === "avr32" + || architecture === "m68k" || architecture === "m32c" + || architecture === "r32c" || architecture === "m16c" + || architecture === "cr16"; +} + +function supportIArchiver(architecture) { + return architecture.startsWith("arm") + || architecture === "stm8" || architecture === "rl78" + || architecture === "rx" || architecture === "rh850" + || architecture === "sh" || architecture === "riscv"; +} + // It is a 'magic' IAR-specific target architecture code. function architectureCode(architecture) { switch (architecture) { @@ -179,19 +195,10 @@ function linkerName(qbs) { function archiverName(qbs) { var architecture = qbs.architecture; - if (architecture.startsWith("arm") - || architecture === "stm8" || architecture === "rl78" - || architecture === "rx" || architecture === "rh850" - || architecture === "sh" || architecture === "riscv") { + if (supportXArchiver(architecture)) + return "xar"; + else if (supportIArchiver(architecture)) return "iarchive"; - } else if (architecture === "mcs51" || architecture === "avr" - || architecture === "msp430" || architecture === "v850" - || architecture === "78k" || architecture === "avr32" - || architecture === "m68k" || architecture === "m32c" - || architecture === "r32c" || architecture === "m16c" - || architecture === "cr16") { - return "xlib"; - } throw "Unable to deduce archiver name for unsupported architecture: '" + architecture + "'"; } @@ -785,7 +792,9 @@ function archiverFlags(project, product, input, outputs) { args = args.concat(inputs.obj.map(function(obj) { return obj.filePath })); // Output. - args.push("--create"); + var architecture = product.qbs.architecture; + if (supportIArchiver(architecture)) + args.push("--create"); args.push("-o", outputs.staticlibrary[0].filePath); return args; |