Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2024 - 2025 Khalil Estell and the libhal contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: 🏷️ Semantic Release
on:
push:
branches: [main]

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Version
id: version
uses: paulhatch/semantic-version@v5.4.0
with:
bump_each_commit: true
major_pattern: "(major)"
minor_pattern: "(minor)"
bump_each_commit_patch_pattern: "(patch)"
tag_prefix: ""
debug: true
- name: Release
if: steps.version.outputs.version_type != 'none'
run: |
gh release create ${{ steps.version.outputs.version_tag }} \
--generate-notes
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE }}
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,22 @@ Missing Architectures:
All binaries are downloaded from the official
[ARM GNU Toolchain Download Page](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads).

> [!WARNING]
>
> LTO is disabled for ARM GCC 14.x. From testing, it seems that LTO compression
> support for ZSTD is enabled for Linux (maybe Windows too), but not for Mac.
> This results in the following error when Linux built binaries are used on a
> mac build:
>
> ```plaintext
> lto1: fatal error: compiler does not support ZSTD LTO compression
> compilation terminated.
> lto-wrapper: fatal error: bin/arm-none-eabi-g++ returned 1 exit status
> compilation terminated. arm-none-eabi/bin/ld: error: lto-wrapper failed
> collect2: error: ld returned 1 exit status
> ninja: build stopped: subcommand failed.
> ```

## 🚀 Quick Start

To use the ARM GNU Toolchain for your application, you should install the
Expand Down
17 changes: 16 additions & 1 deletion all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from conan import ConanFile
from conan.tools.files import get, copy
from conan.errors import ConanInvalidConfiguration
from conan.tools.scm import Version


required_conan_version = ">=2.0.0"
Expand Down Expand Up @@ -38,7 +39,7 @@ class ArmGnuToolchain(ConanFile):
default_options = {
"local_path": "",
"default_arch": True,
"lto": True,
# "lto" default set in config_options()
"fat_lto": True,
"function_sections": True,
"data_sections": True,
Expand All @@ -65,6 +66,20 @@ class ArmGnuToolchain(ConanFile):
def _settings_build(self):
return getattr(self, "settings_build", self.settings)

def config_options(self):
"""Set LTO default based on compiler version"""
# Disable LTO for GCC 14 due to ZSTD compression incompatibilities
# between different build environments (Linux/macOS/Windows)
if self.settings_target:
COMPILER_VERSION = str(
self.settings_target.get_safe("compiler.version", ""))
if COMPILER_VERSION.startswith("14"):
self.output.debug("‼️ DISABLING LTO FOR GCC 14 ‼️")
self.options.lto = False
else:
self.output.debug("✅ USING LTO FOR GCC")
self.options.lto = True

def validate(self):
supported_build_operating_systems = ["Linux", "Macos", "Windows"]
if not self._settings_build.os in supported_build_operating_systems:
Expand Down