aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2019-07-26 23:16:08 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2019-07-29 13:17:12 +0000
commit8d8a0bcfeeabc784f9582a9cedfed234336a9654 (patch)
tree55b67c8ab5e73446962d031d8b192eafc4636b79
parentd46b40d27ebc9bcbdb4430893396f066e1f2d758 (diff)
bare-metal: Fix SDCC toolchain module
* SDCC support only the '.lib' library suffix. * SDCC support only the '.rel' object suffix. * SDCC produce the 'ihx' default image format. Besides, SDCC expect same target flag for both compiler and linker. We automatically take this flag from the cpp.architecture property. Change-Id: If7eac1d5ddc0c571d3c6a870f46f78d61d699f12 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--share/qbs/modules/cpp/sdcc.js8
-rw-r--r--share/qbs/modules/cpp/sdcc.qbs27
2 files changed, 11 insertions, 24 deletions
diff --git a/share/qbs/modules/cpp/sdcc.js b/share/qbs/modules/cpp/sdcc.js
index 38783aa1a..4ce380d16 100644
--- a/share/qbs/modules/cpp/sdcc.js
+++ b/share/qbs/modules/cpp/sdcc.js
@@ -192,6 +192,10 @@ function compilerFlags(project, product, input, output, explicitlyDependsOn) {
args.push("-c");
args.push("-o", output.filePath);
+ var targetFlag = targetArchitectureFlag(input.cpp.architecture);
+ if (targetFlag)
+ args.push(targetFlag);
+
switch (input.cpp.optimization) {
case "small":
args.push("--opt-code-size");
@@ -277,6 +281,10 @@ function assemblerFlags(project, product, input, output, explicitlyDependsOn) {
function linkerFlags(project, product, input, outputs) {
var args = [];
+ var targetFlag = targetArchitectureFlag(product.cpp.architecture);
+ if (targetFlag)
+ args.push(targetFlag);
+
var allLibraryPaths = [];
var libraryPaths = product.cpp.libraryPaths;
if (libraryPaths)
diff --git a/share/qbs/modules/cpp/sdcc.qbs b/share/qbs/modules/cpp/sdcc.qbs
index 3349e9158..0be9d22c4 100644
--- a/share/qbs/modules/cpp/sdcc.qbs
+++ b/share/qbs/modules/cpp/sdcc.qbs
@@ -108,33 +108,12 @@ CppModule {
runtimeLibrary: "static"
- staticLibrarySuffix: {
- switch (qbs.architecture) {
- case "mcs51":
- return ".lib";
- case "stm8":
- return ".a";
- }
- }
+ staticLibrarySuffix: ".lib"
executableSuffix: ".ihx"
- property string objectSuffix: {
- switch (qbs.architecture) {
- case "mcs51":
- return ".rel";
- case "stm8":
- return ".o";
- }
- }
+ property string objectSuffix: ".rel"
- imageFormat: {
- switch (qbs.architecture) {
- case "mcs51":
- return "ihx";
- case "stm8":
- return "elf";
- }
- }
+ imageFormat: "ihx"
enableExceptions: false
enableRtti: false