Skip to content

Commit

Permalink
Rename esp32-elf to xtensa-elf. Drop e3-core patch
Browse files Browse the repository at this point in the history
and change `lib/platform_db.py` instead.
  • Loading branch information
reznikmm committed Aug 18, 2024
1 parent 3956b1a commit 4a97b23
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 41 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: ["arm-elf", "esp32-elf", "riscv64-elf", "avr-elf"]
target: ["arm-elf", "riscv64-elf", "avr-elf", "xtensa-elf"]
name: GNAT ${{ matrix.target }}-linux
needs: gnat
runs-on: ubuntu-20.04
Expand All @@ -119,8 +119,6 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install e3-core==22.1.0
FILE=$(python -c "import e3.platform_db.knowledge_base;print (e3.platform_db.knowledge_base.__file__)")
patch "$FILE" ./esp32-e3.patch
- name: Build GNAT ${{ matrix.target }}
run: ./anod build gcc -v --loglevel DEBUG --target=${{ matrix.target }} --enable-cleanup
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: ["arm-elf", "esp32-elf", "riscv64-elf", "avr-elf"]
target: ["arm-elf", "riscv64-elf", "avr-elf", "xtensa-elf"]
name: GNAT ${{ matrix.target }}-darwin
needs: gnat
runs-on: macos-12
Expand All @@ -116,8 +116,6 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install e3-core==22.1.0
FILE=$(python -c "import e3.platform_db.knowledge_base;print (e3.platform_db.knowledge_base.__file__)")
patch "$FILE" ./esp32-e3.patch
- name: Build GNAT ${{ matrix.target }}
run: ./anod build gcc -v --loglevel DEBUG --target=${{ matrix.target }} --enable-cleanup
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/macos_arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: ["arm-elf", "esp32-elf", "riscv64-elf"] # , "avr-elf"]
target: ["arm-elf", "riscv64-elf", "xtensa-elf"] # , "avr-elf"]
# libc-avr doesn't recognize aarch64-apple machine
# https://github.com/avrdudes/avr-libc/issues/978
name: GNAT ${{ matrix.target }}-darwin
Expand Down Expand Up @@ -84,8 +84,6 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install e3-core==22.1.0
FILE=$(python -c "import e3.platform_db.knowledge_base;print (e3.platform_db.knowledge_base.__file__)")
patch "$FILE" ./esp32-e3.patch
- name: Build GNAT ${{ matrix.target }}
run: ./anod build gcc -v --loglevel DEBUG --target=${{ matrix.target }} --enable-cleanup
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: ["arm-elf", "esp32-elf", "riscv64-elf", "avr-elf"]
target: ["arm-elf", "riscv64-elf", "avr-elf", "xtensa-elf"]
name: GNAT ${{ matrix.target }}-windows
needs: gnat
runs-on: windows-2019
Expand Down Expand Up @@ -156,8 +156,6 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install e3-core==22.1.0
FILE=$(python -c "import e3.platform_db.knowledge_base;print (e3.platform_db.knowledge_base.__file__)")
patch "$FILE" ./esp32-e3.patch
- name: Prepare msys2 build setup
# We need a path that is compatible between Windows and Unix world
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ This can be done in a virtual env, e.g.:
$ python3 -m venv my-virtual-env
$ source my-virtual-env/bin/activate
$ pip install e3-core==22.1.0
# For esp32 only:
$ patch -p1 < esp32-e3.patch
```

To build a spec, for example `mpc`, run the `anod` script:
Expand Down
26 changes: 0 additions & 26 deletions esp32-e3.patch

This file was deleted.

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-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-elf": {"name": "xtensa-esp32-elf"},
"riscv32-elf": {"name": "riscv32-elf"},
"riscv64-elf": {"name": "riscv64-elf"},
"riscv32-unknown-elf": {"name": "riscv32-unknown-elf"},
Expand Down
3 changes: 3 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 Down Expand Up @@ -32,6 +33,7 @@ def update_db(self) -> None:

self.platform_info.update(
{
"xtensa-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 +43,7 @@ def update_db(self) -> None:

self.build_targets.update(
{
"xtensa-elf": {"name": "xtensa-esp32-elf"},
"riscv32-elf": {"name": "riscv32-elf"},
"riscv64-elf": {"name": "riscv64-elf"},
"riscv32-unknown-elf": {"name": "riscv32-unknown-elf"},
Expand Down
2 changes: 1 addition & 1 deletion specs/gcc.anod
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class GCC(spec("gh-artifact")):
self.env.target.triplet == "arm-eabi"
or self.env.target.triplet == "riscv64-elf"
or self.env.target.triplet == "avr-elf"
or self.env.target.triplet.endswith("esp32-elf")
or self.env.target.triplet == "xtensa-esp32-elf"
)

@property
Expand Down
1 change: 1 addition & 0 deletions utils/gen_gnat_manifests.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"x86_64": {"crate": "gnat_native", "description": "Native"},
"arm-elf": {"crate": "gnat_arm_elf", "description": "ARM cross-compiler"},
"avr-elf": {"crate": "gnat_avr_elf", "description": "RISC-V cross-compiler"},
"xtensa-elf": {"crate": "gnat_xtensa_elf", "description": "Xtensa LX7 cross-compiler"},
"riscv64-elf": {"crate": "gnat_riscv64_elf", "description": "AVR cross-compiler"},
}

Expand Down

0 comments on commit 4a97b23

Please sign in to comment.