Skip to content

Commit 10394a8

Browse files
authored
🎉 Initial launch of project (#1)
* 🎉 Initial launch of project All of this was copied and modified from the LLVM-toolchain. * Fixup CI * More cleanup and fixes from LLVM to GCC * simplify version to just 14 * more fixups * Upgrade demos to latest in llvm * More CI fixes pulled from LLVM * Fix macosx pkg extraction * Remove intel mac from the CI list * remove windows arm from 14.yml * Add homebrew binaries for mac arm + intel * cut down CI workloads for now * Add code to extract and modify binaries for mac builds * accept that mac just won't be supported * add can-run to native builds * Replace host profile env variable with action variable * Remove system name causing native apps to look cross built to cmake * Workaround Windows x86_64 packaging
1 parent 73e3531 commit 10394a8

40 files changed

Lines changed: 1199 additions & 0 deletions

.github/workflows/14.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Copyright 2024 - 2025 Khalil Estell and the libhal contributors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: 🚀 Deploy 🔧 GCC 14
16+
17+
on:
18+
workflow_dispatch:
19+
workflow_call:
20+
inputs:
21+
upload:
22+
type: boolean
23+
default: true
24+
version:
25+
type: string
26+
default: "14"
27+
28+
jobs:
29+
# Native compilation tests
30+
verify-linux-x86_64:
31+
uses: ./.github/workflows/verify.yml
32+
with:
33+
display_name: Linux x86_64
34+
version: ${{ inputs.version }}
35+
os: ubuntu-24.04
36+
37+
verify-linux-arm:
38+
uses: ./.github/workflows/verify.yml
39+
with:
40+
display_name: Linux ARM
41+
version: ${{ inputs.version }}
42+
os: ubuntu-24.04-arm
43+
44+
verify-windows-x86_64:
45+
uses: ./.github/workflows/verify.yml
46+
with:
47+
display_name: Windows x86_64
48+
version: ${{ inputs.version }}
49+
os: windows-latest
50+
51+
# ARM Cortex-M cross-compilation tests
52+
verify-linux-x86_64-cortex-m4f:
53+
uses: ./.github/workflows/verify.yml
54+
with:
55+
display_name: Linux x86_64 → Cortex-M4F
56+
version: ${{ inputs.version }}
57+
os: ubuntu-24.04
58+
host_profile: -pr:h cortex-m4f
59+
60+
verify-linux-arm-cortex-m4:
61+
uses: ./.github/workflows/verify.yml
62+
with:
63+
display_name: Linux ARM → Cortex-M4
64+
version: ${{ inputs.version }}
65+
os: ubuntu-24.04-arm
66+
host_profile: -pr:h cortex-m4
67+
68+
verify-windows-x86_64-cortex-m33f:
69+
uses: ./.github/workflows/verify.yml
70+
with:
71+
display_name: Windows x86_64 → Cortex-M33F
72+
version: ${{ inputs.version }}
73+
os: windows-latest
74+
host_profile: -pr:h cortex-m33f
75+
76+
upload-package:
77+
needs:
78+
- verify-linux-x86_64
79+
- verify-linux-arm
80+
- verify-windows-x86_64
81+
- verify-linux-x86_64-cortex-m4f
82+
- verify-linux-arm-cortex-m4
83+
- verify-windows-x86_64-cortex-m33f
84+
if: ${{ startsWith(github.ref, 'refs/tags/') && inputs.upload == true }}
85+
uses: ./.github/workflows/upload.yml
86+
secrets: inherit
87+
with:
88+
version: ${{ inputs.version }}

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright 2024 - 2025 Khalil Estell and the libhal contributors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: ✅ CI
16+
17+
on:
18+
workflow_dispatch:
19+
pull_request:
20+
push:
21+
branches:
22+
- main
23+
24+
jobs:
25+
ci_14:
26+
uses: ./.github/workflows/14.yml
27+
with:
28+
upload: false

.github/workflows/deploy.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright 2024 - 2025 Khalil Estell and the libhal contributors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: 🚀 Deploy
16+
17+
on:
18+
workflow_dispatch:
19+
release:
20+
types: [published]
21+
22+
jobs:
23+
ci_14:
24+
uses: ./.github/workflows/14.yml
25+
with:
26+
upload: true
27+
secrets: inherit

.github/workflows/upload.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Copyright 2024 - 2025 Khalil Estell and the libhal contributors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: 🚀 Upload
16+
17+
on:
18+
workflow_call:
19+
inputs:
20+
version:
21+
type: string
22+
required: true
23+
24+
jobs:
25+
upload-package:
26+
runs-on: ubuntu-24.04
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- name: 📥 Install Conan
31+
run: pipx install conan>=2.22.0
32+
33+
- name: 📡 Add `libhal` conan remote
34+
run: |
35+
conan remote add libhal https://libhal.jfrog.io/artifactory/api/conan/trunk-conan
36+
37+
- name: 📡 Create and setup default profile
38+
run: conan profile detect --force
39+
40+
- name: 📦 Export Conan Recipe (no build)
41+
working-directory: all
42+
run: conan export . --version=${{ inputs.version }}
43+
44+
- name: 📡 Sign into JFrog Artifactory
45+
env:
46+
PASSWORD: ${{ secrets.JFROG_LIBHAL_TRUNK_ID_TOKEN }}
47+
JFROG_USER: ${{ secrets.JFROG_LIBHAL_TRUNK_ID_TOKEN_USER }}
48+
run: conan remote login -p $PASSWORD libhal $JFROG_USER
49+
50+
- name: 🆙 Upload package to Conan Package Repo
51+
run: |
52+
conan upload "multiarch-gnu-toolchain/*" --only-recipe --confirm -r=libhal

.github/workflows/verify.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Copyright 2024 - 2025 Khalil Estell and the libhal contributors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: 🔍 Verify
16+
17+
on:
18+
workflow_call:
19+
inputs:
20+
display_name:
21+
type: string
22+
required: true
23+
version:
24+
type: string
25+
required: true
26+
os:
27+
type: string
28+
required: true
29+
host_profile:
30+
type: string
31+
default: ""
32+
33+
env:
34+
VERBOSE: "1"
35+
36+
jobs:
37+
verify:
38+
name: ${{ inputs.display_name }}
39+
strategy:
40+
fail-fast: false
41+
42+
runs-on: ${{ inputs.os }}
43+
steps:
44+
- uses: actions/checkout@v4
45+
with:
46+
submodules: true
47+
fetch-depth: 0
48+
49+
- name: 📥 Install CMake & Conan
50+
run: pipx install conan>=2.22.0
51+
52+
- name: 📡 Add `libhal` conan remote
53+
run: |
54+
conan remote add libhal https://libhal.jfrog.io/artifactory/api/conan/trunk-conan
55+
56+
- name: 📡 Create and setup default profile
57+
run: conan profile detect --force
58+
59+
- name: 👁️‍🗨️ Show conan profile
60+
run: conan profile show
61+
62+
- name: 📡 Install libhal conan configurations
63+
run: conan config install https://github.com/libhal/conan-config2.git
64+
65+
- name: 📡 Install local toolchain profiles
66+
run: conan config install -tf profiles/ -sf conan/profiles/v1/ .
67+
68+
- name: 📦 Create gcc Toolchain Package (native build)
69+
if: ${{ inputs.host_profile == '' }}
70+
run: conan create all --version=${{ inputs.version }} --build-require --build=cmake --build=missing:cmake/* --build=make --build=missing:make/*
71+
72+
- name: 📦 Create gcc Toolchain Package (cross build)
73+
if: ${{ inputs.host_profile != '' }}
74+
run: conan create all --version=${{ inputs.version }} --build-require --build=cmake --build=missing:cmake/* -pr:h gcc-${{ inputs.version }} ${{ inputs.host_profile }} --build=make --build=missing:make/*
75+
76+
- name: ⚙️ Build/Install ninja from scratch using gcc for build platform
77+
run: >
78+
conan install --tool-requires="ninja/1.13.2" --build="ninja/*" -pr:a gcc-${{ inputs.version }} --build=cmake --build=missing:cmake/*
79+
80+
- name: 📦 Build C++ demo using GCC toolchain
81+
run: conan build demos/cpp -pr:a gcc-${{ inputs.version }} ${{ inputs.host_profile }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
**/build/*
2+
**/CMakeUserPresets.json
3+
.DS_Store
4+
compile_commands.json
5+
delete-later/*

MODIFICATIONS

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Modifications File for arm-gnu-toolchain
2+
3+
This file documents the modifications made to the original `arm-gnu-toolchain` repository,
4+
originally forked from `libhal-google`, which is under the Apache 2.0 license.
5+
6+
## Contributor
7+
8+
- Khalil Estell
9+
10+
## List of Modifications
11+
12+
### Copyright Change
13+
14+
- **Date of Modification**: Wed Jan 17 16:39:17 2024 -0800
15+
- **Description of the Change**: The copyright notice in the repository has
16+
been updated to reflect Khalil Estell as the copyright owner of the
17+
modifications. This change was made to signify ownership over the new
18+
contributions and modifications made to the fork. The change is intended to
19+
apply only to modifications and contributions made by Khalil Estell and does
20+
not alter the copyright of the original work, which remains under the
21+
ownership of Google LLC and other previous contributors, as applicable.
22+
- **Files Affected**: All files in repository not under any directories labeled
23+
`/third_party/`.
24+
25+
## Compliance with Apache 2.0 License
26+
27+
This modification has been made in compliance with the Apache 2.0 license under
28+
which the original repository was licensed. It is intended to respect the terms
29+
and conditions of the original license, including, but not limited to,
30+
retaining the original Apache 2.0 license file unaltered, providing notices of
31+
the original copyright and license in unmodified portions of the work, and
32+
documenting significant changes made to the software.
33+
34+
## Purpose
35+
36+
The purpose of this modification is to attribute the new work and contributions
37+
made by Khalil Estell within the fork of the original `arm-gnu-toolchain`
38+
project. It reflects the personal or organizational ownership over these
39+
specific contributions and modifications, in alignment with open source
40+
collaboration practices and the Apache 2.0 license requirements.
41+
42+
For more information on the Apache 2.0 license, please see the LICENSE file in
43+
this repository or visit
44+
[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0).

all/conandata.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/python
2+
#
3+
# Copyright 2024 - 2025 Khalil Estell and the libhal contributors
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
sources:
18+
"14":
19+
"native": # Native GCC (compiles for the same platform it runs on)
20+
"Linux":
21+
"x86_64":
22+
url: "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v14.2.0-1/xpack-gcc-14.2.0-1-linux-x64.tar.gz"
23+
sha256: "f1a5db554874b27812e6286d242200430d9c5fb62bc04f4e59d6fe47d498af5a"
24+
"armv8":
25+
url: "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v14.2.0-1/xpack-gcc-14.2.0-1-linux-arm64.tar.gz"
26+
sha256: "4c3b546a98293c09b16762a8c55e040e6d0198b5ced1cc0c5c60c22758da6e88"
27+
"Windows":
28+
"x86_64":
29+
url: "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v14.2.0-1/xpack-gcc-14.2.0-1-win32-x64.zip"
30+
sha256: "5c94de916ff50447f74f8d2bf13dd98b92f079f73ae064a02c47598c0109d5c8"
31+
"arm-none-eabi": # ARM embedded cross-compiler
32+
"Linux":
33+
"x86_64":
34+
url: "https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/14.2.rel1/binrel/arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi.tar.xz"
35+
sha256: "62a63b981fe391a9cbad7ef51b17e49aeaa3e7b0d029b36ca1e9c3b2a9b78823"
36+
"armv8":
37+
url: "https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/14.2.rel1/binrel/arm-gnu-toolchain-14.2.rel1-aarch64-arm-none-eabi.tar.xz"
38+
sha256: "87330bab085dd8749d4ed0ad633674b9dc48b237b61069e3b481abd364d0a684"
39+
"Macos":
40+
"armv8":
41+
url: "https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/14.2.rel1/binrel/arm-gnu-toolchain-14.2.rel1-darwin-arm64-arm-none-eabi.tar.xz"
42+
sha256: "c7c78ffab9bebfce91d99d3c24da6bf4b81c01e16cf551eb2ff9f25b9e0a3818"
43+
"Windows":
44+
"x86_64":
45+
url: "https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/14.2.rel1/binrel/arm-gnu-toolchain-14.2.rel1-mingw-w64-i686-arm-none-eabi.zip"
46+
sha256: "6facb152ce431ba9a4517e939ea46f057380f8f1e56b62e8712b3f3b87d994e1"

0 commit comments

Comments
 (0)