Skip to content

Commit

Permalink
Add xtensa-esp32-elf builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabien-Chouteau committed Aug 21, 2024
1 parent 51e82ef commit a5581b8
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
gnat_cross:
strategy:
matrix:
target: ["arm-elf", "riscv64-elf", "avr-elf"]
target: ["arm-elf", "riscv64-elf", "avr-elf", "xtensa-esp32-elf"]
name: GNAT ${{ matrix.target }}-linux
needs: gnat
runs-on: ubuntu-20.04
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
gnat_cross:
strategy:
matrix:
target: ["arm-elf", "riscv64-elf", "avr-elf"]
target: ["arm-elf", "riscv64-elf", "avr-elf", "xtensa-esp32-elf"]
name: GNAT ${{ matrix.target }}-darwin
needs: gnat
runs-on: macos-12
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/macos_arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ jobs:
gnat_cross:
strategy:
matrix:
target: ["arm-elf", "riscv64-elf", "avr-elf"]
target: ["arm-elf", "riscv64-elf", "xtensa-esp32-elf"]
# We don't enable avr on aarch64 macOS as libc-avr doesn't recognize
# aarch64-apple machine https://github.com/avrdudes/avr-libc/issues/978

name: GNAT ${{ matrix.target }}-darwin
needs: gnat
runs-on: macos-14
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
gnat_cross:
strategy:
matrix:
target: ["arm-elf", "riscv64-elf", "avr-elf"]
target: ["arm-elf", "riscv64-elf", "avr-elf", "xtensa-esp32-elf"]
name: GNAT ${{ matrix.target }}-windows
needs: gnat
runs-on: windows-2019
Expand Down
3 changes: 3 additions & 0 deletions lib/platform_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class PlatDB(PlatformDBPlugin):
def update_db(self) -> None:
self.cpu_info.update(
{
"xtensa": {"endian": "little", "bits": 32},
"riscv32": {"endian": "little", "bits": 32},
"riscv64": {"endian": "little", "bits": 64},
}
Expand Down Expand Up @@ -34,6 +35,7 @@ def update_db(self) -> None:
self.platform_info.update(
{
"aarch64-darwin": {"cpu": "aarch64", "os": "darwin", "is_hie": False},
"xtensa-esp32-elf": {"cpu": "xtensa", "os": "none", "is_hie": True},
"riscv32-elf": {"cpu": "riscv32", "os": "none", "is_hie": True},
"riscv64-elf": {"cpu": "riscv64", "os": "none", "is_hie": True},
"riscv32-unknown-elf": {"cpu": "riscv32", "os": "none", "is_hie": True},
Expand All @@ -44,6 +46,7 @@ def update_db(self) -> None:
self.build_targets.update(
{
"aarch64-darwin": {"name": "aarch64-apple-darwin%(os_version)s"},
"xtensa-esp32-elf": {"name": "xtensa-esp32-elf"},
"riscv32-elf": {"name": "riscv32-elf"},
"riscv64-elf": {"name": "riscv64-elf"},
"riscv32-unknown-elf": {"name": "riscv32-unknown-elf"},
Expand Down
6 changes: 6 additions & 0 deletions sanity-checking/drivers/platform_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class PlatDB(PlatformDBPlugin):
def update_db(self) -> None:
self.cpu_info.update(
{
"xtensa": {"endian": "little", "bits": 32},
"riscv32": {"endian": "little", "bits": 32},
"riscv64": {"endian": "little", "bits": 64},
}
Expand All @@ -23,6 +24,7 @@ def update_db(self) -> None:
self.host_guess.pop("x86-windows")
self.host_guess.update(
{
"aarch64-darwin": {"os": "Darwin", "cpu": "arm64"},
"x86_64-windows64": {
"os": "Windows",
"cpu": "AMD64",
Expand All @@ -32,6 +34,8 @@ def update_db(self) -> None:

self.platform_info.update(
{
"aarch64-darwin": {"cpu": "aarch64", "os": "darwin", "is_hie": False},
"xtensa-esp32-elf": {"cpu": "xtensa", "os": "none", "is_hie": True},
"riscv32-elf": {"cpu": "riscv32", "os": "none", "is_hie": True},
"riscv64-elf": {"cpu": "riscv64", "os": "none", "is_hie": True},
"riscv32-unknown-elf": {"cpu": "riscv32", "os": "none", "is_hie": True},
Expand All @@ -41,6 +45,8 @@ def update_db(self) -> None:

self.build_targets.update(
{
"aarch64-darwin": {"name": "aarch64-apple-darwin%(os_version)s"},
"xtensa-esp32-elf": {"name": "xtensa-esp32-elf"},
"riscv32-elf": {"name": "riscv32-elf"},
"riscv64-elf": {"name": "riscv64-elf"},
"riscv32-unknown-elf": {"name": "riscv32-unknown-elf"},
Expand Down
5 changes: 5 additions & 0 deletions specs/gcc.anod
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ class GCC(spec("gh-artifact")):
args += cross_commons
args.append("--enable-multilib")

if self.env.target.triplet == "extensa-esp32-elf":
args += cross_commons
args.append("--enable-multilib")


return args

def artifact_build(self):
Expand Down
6 changes: 6 additions & 0 deletions specs/release_package.anod
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ class ReleasePackage(spec("common")):
Anod.Dependency("avrlibc", track=True),
]

elif self.env.target.triplet == "xtensa-esp32-elf":
return [
Anod.Dependency("gcc", track=True),
Anod.Dependency("gdb", track=True),
]

elif self.env.host.triplet == self.env.target.triplet:
# Native
return [
Expand Down

0 comments on commit a5581b8

Please sign in to comment.