diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2021-05-29 20:50:11 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2021-05-30 13:01:24 +0000 |
commit | e375ff5608101ba447670316a57fc5940ed4df4b (patch) | |
tree | f3c7f4ec1718f6a8ddbbab71126b0bc7a3091a61 | |
parent | 63f245dc0e1442b7daade525dfa53e8f515230fc (diff) |
baremetal: Long live COSMIC toolchain for HCS12 architecture
This patch adds support for Cosmic Software compiler for the
bare metal platforms:
* https://www.cosmicsoftware.com/download.php
Note that this compiler only works on Windows host platforms.
Also the COSMIC toolchain has been added to the Github CI.
Fixes: QBS-1640
Change-Id: I7ab0c8099437fce962632ff87177e37fd04f82d2
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
5 files changed, 39 insertions, 7 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2bd575d82..72827d81e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -541,6 +541,9 @@ jobs: - name: cosmic-4_6_3-hcs8 run: QBS_AUTOTEST_PROFILE=cosmic-4_6_3-hcs8 scripts/test-baremetal.sh release/install-root/bin shell: bash + - name: cosmic-4_8_11-hcs12 + run: QBS_AUTOTEST_PROFILE=cosmic-4_8_11-hcs12 scripts/test-baremetal.sh release/install-root/bin + shell: bash test-macos: name: ${{ matrix.config.name }} diff --git a/share/qbs/modules/cpp/cosmic.js b/share/qbs/modules/cpp/cosmic.js index cfb581579..acb3e4d5d 100644 --- a/share/qbs/modules/cpp/cosmic.js +++ b/share/qbs/modules/cpp/cosmic.js @@ -45,6 +45,8 @@ function compilerName(qbs) { return "cxstm8"; else if (architecture === "hcs8") return "cx6808"; + else if (architecture === "hcs12") + return "cx6812"; throw "Unable to deduce compiler name for unsupported architecture: '" + architecture + "'"; } @@ -57,6 +59,8 @@ function assemblerName(qbs) { return "castm8"; else if (architecture === "hcs8") return "ca6808"; + else if (architecture === "hcs12") + return "ca6812"; throw "Unable to deduce assembler name for unsupported architecture: '" + architecture + "'"; } @@ -65,7 +69,8 @@ function linkerName(qbs) { var architecture = qbs.architecture; if (architecture.startsWith("arm") || architecture === "stm8" - || architecture === "hcs8") { + || architecture === "hcs8" + || architecture === "hcs12") { return "clnk"; } throw "Unable to deduce linker name for unsupported architecture: '" @@ -76,7 +81,8 @@ function listerName(qbs) { var architecture = qbs.architecture; if (architecture.startsWith("arm") || architecture === "stm8" - || architecture === "hcs8") { + || architecture === "hcs8" + || architecture === "hcs12") { return "clabs"; } throw "Unable to deduce lister name for unsupported architecture: '" @@ -87,7 +93,8 @@ function archiverName(qbs) { var architecture = qbs.architecture; if (architecture.startsWith("arm") || architecture === "stm8" - || architecture === "hcs8") { + || architecture === "hcs8" + || architecture === "hcs12") { return "clib"; } throw "Unable to deduce archiver name for unsupported architecture: '" @@ -102,6 +109,8 @@ function staticLibrarySuffix(qbs) { return ".sm8"; else if (architecture === "hcs8") return ".h08"; + else if (architecture === "hcs12") + return ".h12"; throw "Unable to deduce static library suffix for unsupported architecture: '" + architecture + "'"; } @@ -114,6 +123,8 @@ function executableSuffix(qbs) { return ".sm8"; else if (architecture === "hcs8") return ".h08"; + else if (architecture === "hcs12") + return ".h12"; throw "Unable to deduce executable suffix for unsupported architecture: '" + architecture + "'"; } @@ -122,7 +133,8 @@ function objectSuffix(qbs) { var architecture = qbs.architecture; if (architecture.startsWith("arm") || architecture === "stm8" - || architecture === "hcs8") { + || architecture === "hcs8" + || architecture === "hcs12") { return ".o"; } throw "Unable to deduce object file suffix for unsupported architecture: '" @@ -133,7 +145,8 @@ function imageFormat(qbs) { var architecture = qbs.architecture; if (architecture.startsWith("arm") || architecture === "stm8" - || architecture === "hcs8") { + || architecture === "hcs8" + || architecture === "hcs12") { return "cosmic"; } throw "Unable to deduce image format for unsupported architecture: '" @@ -148,6 +161,8 @@ function guessArchitecture(compilerFilePath) { return "stm8"; else if (baseName === "cx6808") return "hcs8"; + else if (baseName === "cx6812") + return "hcs12"; throw "Unable to deduce architecture for unsupported compiler: '" + baseName + "'"; } @@ -208,7 +223,8 @@ function guessEndianness(architecture) { // There is no mention of supported endianness in the cosmic compiler. if (architecture.startsWith("arm") || architecture === "stm8" - || architecture === "hcs8") { + || architecture === "hcs8" + || architecture === "hcs12") { return "big"; } throw "Unable to deduce endianness for unsupported architecture: '" @@ -231,6 +247,10 @@ function dumpDefaultPaths(compilerFilePath, architecture) { includePath = FileInfo.joinPaths(rootPath, "h6808"); if (File.exists(includePath)) includePaths.push(includePath); + } else if (architecture === "hcs12") { + includePath = FileInfo.joinPaths(rootPath, "h6812"); + if (File.exists(includePath)) + includePaths.push(includePath); } var libraryPaths = []; diff --git a/src/app/qbs-setup-toolchains/cosmicprobe.cpp b/src/app/qbs-setup-toolchains/cosmicprobe.cpp index 5813ab0d8..9e7621245 100644 --- a/src/app/qbs-setup-toolchains/cosmicprobe.cpp +++ b/src/app/qbs-setup-toolchains/cosmicprobe.cpp @@ -59,7 +59,7 @@ using Internal::HostOsInfo; static QStringList knownCosmicCompilerNames() { return {QStringLiteral("cxcorm"), QStringLiteral("cxstm8"), - QStringLiteral("cx6808")}; + QStringLiteral("cx6808"), QStringLiteral("cx6812")}; } static QString guessCosmicArchitecture(const QFileInfo &compiler) @@ -71,6 +71,8 @@ static QString guessCosmicArchitecture(const QFileInfo &compiler) return QStringLiteral("stm8"); if (baseName == QLatin1String("cx6808")) return QStringLiteral("hcs8"); + if (baseName == QLatin1String("cx6812")) + return QStringLiteral("hcs12"); return {}; } diff --git a/tests/auto/blackbox/testdata-baremetal/one-object-asm-application/hcs12-cosmic.s b/tests/auto/blackbox/testdata-baremetal/one-object-asm-application/hcs12-cosmic.s new file mode 100644 index 000000000..c33c2b32d --- /dev/null +++ b/tests/auto/blackbox/testdata-baremetal/one-object-asm-application/hcs12-cosmic.s @@ -0,0 +1,5 @@ +_main: + .dcall "2,0,_main" + rts + xdef _main + end diff --git a/tests/auto/blackbox/testdata-baremetal/one-object-asm-application/one-object-asm-application.qbs b/tests/auto/blackbox/testdata-baremetal/one-object-asm-application/one-object-asm-application.qbs index 37eac0a4d..d88f9e44e 100644 --- a/tests/auto/blackbox/testdata-baremetal/one-object-asm-application/one-object-asm-application.qbs +++ b/tests/auto/blackbox/testdata-baremetal/one-object-asm-application/one-object-asm-application.qbs @@ -9,6 +9,8 @@ BareMetalApplication { return true; if (qbs.architecture === "hcs8") return true; + if (qbs.architecture === "hcs12") + return true; } else if (qbs.toolchainType === "keil") { if (qbs.architecture.startsWith("arm")) return true; |