Skip to content

Xtensa patches (15.x) (Do not merge, PR created for easier review only) #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 150 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
87df1ee
[Xtensa] Recognize Xtensa in triple parsing code.
andreisfr Aug 31, 2022
0def3c2
[Xtensa] Add definitions and relocs for Xtensa ELF.
andreisfr Aug 31, 2022
41bfeb8
[Xtensa] Add initial version of the Xtensa backend.
andreisfr Aug 31, 2022
7029d28
[Xtensa] Add basic *td files with Xtensa architecture description.
andreisfr Aug 31, 2022
97bba5f
[Xtensa] Add Xtensa MCTargetDescr initial functionality.
andreisfr Aug 31, 2022
7c4adeb
[Xtensa] Add Xtensa basic assembler parser.
andreisfr Aug 31, 2022
780c83f
[Xtensa] Add basic Xtensa instruction printer.
andreisfr Aug 31, 2022
9fe2aa5
[Xtensa] Add shift/load/store instructions.
andreisfr Aug 31, 2022
1fabd10
[Xtensa] Add basic support of Xtensa disassembler.
andreisfr Aug 31, 2022
edd85c2
[Xtensa] Add support of the rest part of Xtensa Core Instructions.
andreisfr Aug 31, 2022
a4a95a0
[Xtensa] Initial support of the ALU operations.
andreisfr Aug 31, 2022
5af39bc
[Xtensa] Codegen support for memory operations
andreisfr Aug 31, 2022
795cad0
[Xtensa] Add Constant Pool
andreisfr Aug 31, 2022
8a353ec
[Xtensa] Implement assembler representation of the Constant Pool.
andreisfr Aug 31, 2022
9fa51df
[Xtensa] Implement lowering constants.
andreisfr Aug 31, 2022
074de8e
[Xtensa] Add support of the Xtensa function calls
andreisfr Aug 31, 2022
57e4efc
[Xtensa] Implement lowering ConstantPool and address operations.
andreisfr Aug 31, 2022
5d2d842
[Xtensa] Implement emitPrologue/emitEpilogue
andreisfr Aug 31, 2022
874d395
[Xtensa] Lower stack operations
andreisfr Aug 31, 2022
19d5a89
[Xtensa] Implement lowering SELECT_CC, SETCC
andreisfr Aug 31, 2022
623ab15
[Xtensa] Support for a variety of additional LLVM IR constructs.
andreisfr Aug 31, 2022
ffa7c6f
[Xtensa] Lower SHIFT PARTS and shift operations.
andreisfr Aug 31, 2022
a729ef2
[Xtensa] Implement load pseudo operations and patterns.
andreisfr Aug 31, 2022
f6ad2a7
[Xtensa] Support for variable arguments
andreisfr Aug 31, 2022
2d31297
[Xtensa] Implement lowering BR_JT operation
andreisfr Aug 31, 2022
18b9007
[Xtensa] Support for address intrinsics.
andreisfr Aug 31, 2022
dbe85b0
[Xtensa] Add basic support for inline asm constraints
andreisfr Aug 31, 2022
2d3fb99
[Xtensa] Implement volatile load/store.
andreisfr Aug 31, 2022
7152676
[Xtensa] Implement branch analysis
andreisfr Aug 31, 2022
e40c9a1
[Xtensa] Implement support for the BranchRelaxation
andreisfr Aug 31, 2022
e0cb2ab
[Xtensa] Implement code density feature operations
andreisfr Aug 31, 2022
c43de6e
[Xtensa] Add code size reduction pass.
andreisfr Aug 31, 2022
5a84826
[Xtensa] Implement Windowed feature operations
andreisfr Aug 31, 2022
839062e
[Xtensa] Implement Windowed Call ABI
andreisfr Aug 31, 2022
21fb40a
[Xtensa] Reserve an emergency spill slot for scavenger.
andreisfr Aug 31, 2022
456e445
[Xtensa] Implement Boolean feature operations
andreisfr Aug 31, 2022
ce861cf
[Xtensa] Implement Floating-Point feature operations.
andreisfr Aug 31, 2022
1a8ac61
[Xtensa] Lowering Floating-Point Operations SELECT_CC/SETCC/BR_CC.
andreisfr Aug 31, 2022
803642d
[Xtensa] Implement DAG Combine for FADD and FSUB operations.
andreisfr Aug 31, 2022
23611dc
[Xtensa] Implement Loop, SEXT and NSA features.
andreisfr Aug 31, 2022
81aced3
[Xtensa] Implement Mul32, Mul32High and Div32 features.
andreisfr Aug 31, 2022
3ad1b65
[Xtensa] Implement Mac16 feature and operations.
andreisfr Aug 31, 2022
e627138
[Xtensa] Implement Xtensa features and operations.
andreisfr Aug 31, 2022
a67a17b
[Xtensa] Implement Xtensa features and operations.
andreisfr Aug 31, 2022
3b363cd
[Xtensa] Add the Xtensa target.
andreisfr Aug 31, 2022
e49f602
[Xtensa] Implement Xtensa ABI lowering.
andreisfr Aug 31, 2022
2bb21f9
[Xtensa] Add subtargets ESP32. ESP8266 and ESP32-S2.
andreisfr Aug 31, 2022
970ba6e
[Xtensa] Add esp32, esp8266 and esp32-s2 to valid cpu names.
andreisfr Aug 31, 2022
8ca87b9
[Xtensa] Improve parsing of the SR and UR registers.
andreisfr Aug 31, 2022
6b07117
[Xtensa] Emit literals
andreisfr Aug 31, 2022
6ef8eb8
[Xtensa] Improve assembler parsing. Improve CFA support.
andreisfr Aug 31, 2022
ab2cfbb
[Xtensa] Lowering Exception Selector and Pointer Registers.
andreisfr Aug 31, 2022
438ad20
[Xtensa] Lowering GLobalTLSAddress operation.
andreisfr Aug 31, 2022
1e96c1e
[Xtensa] Lower ATOMIC_FENCE. Add Atomic Expand pass.
andreisfr Aug 31, 2022
01d4658
[Xtensa] Lower atomic_cmp_swap_(8/16/32) operations.
andreisfr Aug 31, 2022
1c1a40c
[Xtensa] Lower atomic_swap_(8/16/32) operations.
andreisfr Aug 31, 2022
48964cc
[Xtensa] Lower atomic operations.
andreisfr Aug 31, 2022
07d2d1f
[Xtensa] Implement Xtensa toolchain.
andreisfr Aug 31, 2022
c93b1e9
[Xtensa] Implement multilib support
andreisfr Aug 31, 2022
37f3ffe
[Xtensa] Implemented builtins for Xtensa MAC16 instructions.
andreisfr Aug 31, 2022
dd218f6
[Xtensa] Implement lowering llvm intrinsics fshr/fshl.
andreisfr Aug 31, 2022
8518565
[Xtensa] Correct visibility of the Xtensa backend initialize functions.
andreisfr Aug 31, 2022
e18ae02
[Xtensa][Not for upstream] Add functions needed to use as rust submod…
andreisfr Aug 31, 2022
7b04fb3
[Xtensa] Correct Call ABI for function return arguments.
andreisfr Aug 31, 2022
229b352
[Xtensa] Implement rest part of FP instructions.
andreisfr Aug 31, 2022
ffddcb8
[Xtensa] Correct lowering BR_CC with FP operands.
andreisfr Aug 31, 2022
3760cb9
[Xtensa] Use ctors for Xtensa target by default
andreisfr Aug 31, 2022
f93cbe8
[Xtensa] Implement Hardware Loop optimization pass
andreisfr Aug 31, 2022
f7ec847
[Xtensa] Change using of Frame Pointer.
andreisfr Aug 31, 2022
2bedc72
esp/maint: Adds Github workfows
andreisfr Aug 31, 2022
3a18ef7
[Xtensa] Implement esp32 psram cache fixes.
andreisfr Aug 31, 2022
38e38ed
[Xtensa] Fix Hardware Loop optimization
andreisfr Aug 31, 2022
901e26a
[Xtensa] Remove unnecessary MOVSP in epilogue.
andreisfr Aug 31, 2022
6f0c454
[Xtensa] Support 'f' Inline Assembly Constraint
andreisfr Aug 31, 2022
f85a0ae
[Xtensa] Correction of the PSRAM fix pass
andreisfr Aug 31, 2022
1f7f3ec
[Xtensa] Correction of the hardware loop instrinsics detection.
andreisfr Aug 31, 2022
bac7c45
[Xtensa] Correction of the ESP32-S2 target.
andreisfr Aug 31, 2022
b5c3753
[Xtensa] Implement ESP32-S3 target.
andreisfr Aug 31, 2022
3761fa7
[Xtensa] Define register type for CC
andreisfr Aug 31, 2022
50226ad
[Xtensa] Correcting FP instructions and intrinsics.
andreisfr Aug 31, 2022
fba1511
[Xtensa] Implement MUL16 feature.
andreisfr Aug 31, 2022
65cedc2
[Xtensa] Add a no-op -mlongcalls option for better compatibility
andreisfr Aug 31, 2022
2a178e0
[Xtensa] Initialize MCSubtargetInfo with esp32.
andreisfr Aug 31, 2022
9511ee0
[Xtensa] Correction of the Hardware Loop pass.
andreisfr Aug 31, 2022
cfe4f24
[Xtensa] Fix atomic swap for 8/16 bit operands.
andreisfr Aug 31, 2022
d5569e4
[Xtensa] Initial porting compiler-rt library for Xtensa.
andreisfr Aug 31, 2022
cda3a60
[Xtensa] Add support of "-mcpu" option.
andreisfr Aug 31, 2022
7f71720
[Xtensa] Improve Xtensa multilib support in clang.
andreisfr Aug 31, 2022
40266fb
[Xtensa]: Add '--rtlib' option support for ESP Xtensa toolchain
andreisfr Aug 31, 2022
921cc56
[Xtensa]: Add '-fuse-ld' option support to ESP Xtensa toolchain
andreisfr Aug 31, 2022
445da29
Xtensa] Use B0 register for FP cmp operations.
andreisfr Aug 31, 2022
141d20a
ci: add .gitlab-ci.yml to support CI/CD
andreisfr Aug 31, 2022
692a0ab
[Xtensa] Fix inline asm
andreisfr Aug 31, 2022
09fa576
[Xtensa]: Fix handling of empty '-fuse-ld' option for ESP toolchain
andreisfr Aug 31, 2022
d575002
esp: Adds support for vendor 'Espressif' to target triple
andreisfr Aug 31, 2022
ced3ce0
esp/riscv: Use GCC assembler for ESP RISCV chips
andreisfr Aug 31, 2022
f04f1c1
esp/riscv: Adds support for 'riscv32-esp-elf' target triple
andreisfr Aug 31, 2022
c62fa56
riscv: Add default multilib.
andreisfr Aug 31, 2022
b18e725
esp/riscv: Add multilib support for 'riscv32-esp-elf' GCC toolcahin
andreisfr Aug 31, 2022
fa0df18
esp/riscv: Add 'libnosys' to linker command line by default
andreisfr Aug 31, 2022
ab24392
esp/riscv: Exclude 'crt0.o' from linking in 'freestanding' mode
andreisfr Aug 31, 2022
3a1c604
riscv: Add ESP toolchain tests
andreisfr Aug 31, 2022
bad58a0
esp/ci: Adds Linux build
andreisfr Aug 31, 2022
9512846
esp/ci: Adds Mingw32 build
andreisfr Aug 31, 2022
a67842f
[Xtensa] Remove redundant target features
andreisfr Aug 31, 2022
5420992
esp/ci: Upgrade universal toolchain to 'gcc11_2_0-esp-2022r1-RC1' and…
andreisfr Aug 31, 2022
866465c
esp/ci: Allow failure for universal toolchain builds
andreisfr Aug 31, 2022
cebbe2d
[Xtensa] Implement support of the sysroot
andreisfr Aug 31, 2022
15d6665
[Xtensa] Fix crtbegin/crtend implementation.
andreisfr Aug 31, 2022
a0e6b8f
[Xtensa] Build compiler-rt libs.
andreisfr Aug 31, 2022
11a06e9
[Xtensa] Fix ill.n instruction econding
andreisfr Aug 31, 2022
31997a7
ci: add jobs for arm64 toolchains
andreisfr Aug 31, 2022
7415f50
[Xtensa] Fix asm parser include files.
andreisfr Sep 1, 2022
b65d8d1
ci/cd: fix clang version in gitlab-ci.yml
andreisfr Sep 1, 2022
6056558
[Xtensa] fix compiler-rt crt build script
andreisfr Sep 4, 2022
03bb3f8
[Xtensa] Implement asm macro for bbci/bbsi.
andreisfr Sep 9, 2022
192619b
[Xtensa] Implement support of literal and region asm directives in as…
andreisfr Sep 9, 2022
2c11321
[Xtensa] Corrected asm parser.
andreisfr Sep 9, 2022
648f076
riscv/gnu: Adds `no-rtti` multilib support
gerekon Aug 10, 2022
b8f05a3
[Xtensa] Guess GCC toolchain triplet from MCPU option
gerekon Aug 10, 2022
789d497
esp/ci: Adds MacOS x86_64/ARM64 universal toolchain builds
gerekon May 24, 2022
694867e
esp/ci: Adds minimal distro with libraries/headres only
gerekon Aug 17, 2022
986b71e
esp/ci: Upgrade GCC toolchain to `esp-2022r1`
gerekon Aug 10, 2022
63b6e44
esp/ci: Move newlib build to separate job
gerekon Aug 17, 2022
e95d783
esp/ci: Adds Linux ARM/ARM64 universal toolchain builds
gerekon Aug 17, 2022
d1b0c88
riscv/esp: Fixes riscv32-esp toolchain tests
gerekon Aug 18, 2022
d9ff0ed
esp/ci: Upgrade Clang ver to 15
gerekon Aug 24, 2022
ab29eaa
esp/ci: Adds support to switch between legacy and universal toolchain…
gerekon Aug 30, 2022
9840a97
esp/ci: Adds MacOS binaries signing stage
gerekon Sep 13, 2022
34236f6
[Xtensa] Xtensa ABI 128bit arg alignment
MabezDev Sep 12, 2022
a9754a1
[Xtensa] Fix Call ABI for 16 byte alignment.
andreisfr Aug 30, 2022
0af6dae
[Xtensa] Add IR test for 16byte alignment.
andreisfr Sep 16, 2022
28b26ff
esp/ci: Run LLD tests. Output test logs in lld-tests.log
sstefan1 Sep 29, 2022
4a51f8f
[Xtensa] Fix atomic rmw operation.
andreisfr Sep 30, 2022
32e6411
[Xtensa] Fix Hardware Loop pass.
andreisfr Sep 30, 2022
ce430fd
[Xtensa] Add LLD linker support
aykevl Oct 19, 2022
0e22873
[Xtensa][LLD] add more tests
sstefan1 Nov 1, 2022
1fa3906
[Xtensa][LLD] Fix J formula
sstefan1 Nov 1, 2022
e520bb1
[Xtensa] Adding new invalid tests and changing test structure as requ…
sstefan1 Oct 28, 2022
d8fe3d0
[Xtensa] Add emit constant pool option.
andreisfr Sep 8, 2022
9b553d7
[Xtensa] Add support of the mcmodel option.
andreisfr Nov 1, 2022
7c941f4
[Xtensa] Fix lowering funnel shift left.
andreisfr Nov 16, 2022
17496a8
[Xtensa] Make it possible to use -fuse-ld when GCC toolchain is detected
sstefan1 Nov 17, 2022
d4f9df6
esp/ci: Fixes Windows release archives
gerekon Nov 24, 2022
2378612
esp/ci: Check for OOM failures after build
gerekon Nov 29, 2022
a07cafd
[LLD][Xtensa] Cover DIFF{8, 16, 32} relocations.
sstefan1 Jan 23, 2023
f389074
[Xtensa] Fixup hwloop pass
andreisfr Mar 16, 2023
a3ce635
[Xtensa] Implement constant islands pass
andreisfr Feb 16, 2023
2989ff7
[Xtensa] Disable hardware loops by default.
andreisfr Feb 22, 2023
1e28f73
[Xtensa] Improve fixup error messages in asm backend.
andreisfr Mar 9, 2023
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
19 changes: 19 additions & 0 deletions .github/workflows/issue_comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Sync issue comments to JIRA

# This workflow will be triggered when new issue comment is created (including PR comments)
on: issue_comment

jobs:
sync_issue_comments_to_jira:
name: Sync Issue Comments to Jira
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Sync issue comments to JIRA
uses: espressif/github-actions/sync_issues_to_jira@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JIRA_PASS: ${{ secrets.JIRA_PASS }}
JIRA_PROJECT: LLVM
JIRA_URL: ${{ secrets.JIRA_URL }}
JIRA_USER: ${{ secrets.JIRA_USER }}
19 changes: 19 additions & 0 deletions .github/workflows/new_issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Sync issues to Jira

# This workflow will be triggered when a new issue is opened
on: issues

jobs:
sync_issues_to_jira:
name: Sync issues to Jira
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Sync GitHub issues to Jira project
uses: espressif/github-actions/sync_issues_to_jira@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JIRA_PASS: ${{ secrets.JIRA_PASS }}
JIRA_PROJECT: LLVM
JIRA_URL: ${{ secrets.JIRA_URL }}
JIRA_USER: ${{ secrets.JIRA_USER }}
24 changes: 24 additions & 0 deletions .github/workflows/new_prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Sync remain PRs to Jira

# This workflow will be triggered every hour, to sync remaining PRs (i.e. PRs with zero comment) to Jira project
# Note that, PRs can also get synced when new PR comment is created
on:
schedule:
- cron: "0 * * * *"

jobs:
sync_prs_to_jira:
name: Sync PRs to Jira
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Sync PRs to Jira project
uses: espressif/github-actions/sync_issues_to_jira@master
with:
cron_job: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JIRA_PASS: ${{ secrets.JIRA_PASS }}
JIRA_PROJECT: LLVM
JIRA_URL: ${{ secrets.JIRA_URL }}
JIRA_USER: ${{ secrets.JIRA_USER }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@

# Nested build directory
/build*
/*/build-*
/_build
/_dist

#==============================================================================#
# Explicit files to ignore (only matches one).
Expand Down
105 changes: 105 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
stages:
- build
- pack
- sign
- private_deploy
- test
- public_deploy

image: ${CI_DOCKER_REGISTRY}/llvm-build:4

variables:

# move all these to CI/CD settings
REL_SFX: "llvm"
CLANG_VER: "15.0.0"
GCC_REL_NAME: "esp-2022r1"
GCC_REL_VER: "gcc11_2_0"
NEWLIB_REF: "esp-2022r1"
BINUTILS_REF: "esp-2022r1-binutils"
XTENSA_OVERLAYS_REF: "master"
LLVM_GCC_TESTSUITE_REF: "esp-15.0.0-20221201"
XTENSA_CLANG_TOOLCHAIN_REF: "esp-15.0.0-20221201"

CROSS_ARM_IMAGE: $CI_DOCKER_REGISTRY/llvm-build-cross-arm:1
PLATFORM_NAME_LINUX: "linux-amd64"
PLATFORM_NAME_LINUX_ARMHF: "linux-armhf"
PLATFORM_NAME_LINUX_ARM64: "linux-arm64"
PLATFORM_NAME_WIN: "win64"
PLATFORM_NAME_MACOS: "macos"
PLATFORM_NAME_MACOS_ARM64: "macos-arm64"

ARCHIVE_TOOL_LINUX: "tar -cJf"
UNARCHIVE_TOOL_LINUX: "tar -xf"
ARCHIVE_EXT_LINUX: "tar.xz"

ARCHIVE_TOOL_WIN: "zip -9 -r"
UNARCHIVE_TOOL_WIN: "unzip"
ARCHIVE_EXT_WIN: "zip"

PACK_ARCHIVE_TOOL_WIN: "tar -h -cJf"
PACK_UNARCHIVE_TOOL_WIN: "${UNARCHIVE_TOOL_LINUX}"
PACK_ARCHIVE_EXT_WIN: "${ARCHIVE_EXT_LINUX}"

ARCHIVE_TOOL_MACOS: "tar -cJf"
UNARCHIVE_TOOL_MACOS: "tar -xf"
ARCHIVE_EXT_MACOS: "tar.xz"

ARCHIVE_TOOL_NEWLIB: ${ARCHIVE_TOOL_LINUX}
UNARCHIVE_TOOL_NEWLIB: ${UNARCHIVE_TOOL_LINUX}
ARCHIVE_EXT_NEWLIB: ${ARCHIVE_EXT_LINUX}

DIST_DIR: "dist"
BUILD_DIR: "build"
DOWNLOADS_DIR: "downloads"

###########################################################################
#################### START OF TEMPORARY LEGACY CODE #######################
# TODO: the code below is to be removed after migration to new build script
CONF_TARGET: "xtensa-esp32-elf"
XTENSA_CLANG_TOOLCHAIN: "${CONF_TARGET}-clang"
##################### END OF TEMPORARY LEGACY CODE ########################
###########################################################################

.use_ci_tools_snippet: &use_ci_tools_snippet |
curl -sSL ${CIT_LOADER_URL} -o cit_loader.sh && sh cit_loader.sh
source citools/import_functions

.use_ci_tools:
script:
- *use_ci_tools_snippet

.add_gitlab_key_snippet: &add_gitlab_key_snippet |
cit_add_ssh_key "${GITLAB_KEY}"

.add_gitlab_key:
script:
- *add_gitlab_key_snippet

# LLVM Build System used the remote address to show detailed version info, we'll change it to the public repository
.fix_origin_remote_for_public_snippet: &fix_origin_remote_for_public_snippet |
git remote set-url origin "${GH_REPO_HTTPS}"

.fix_origin_remote_for_public:
script:
- *fix_origin_remote_for_public_snippet

.get_clang_toolchain_build_scripts_snippet: &get_clang_toolchain_build_scripts_snippet |
git clone -b ${XTENSA_CLANG_TOOLCHAIN_REF} ${GITLAB_SSH_SERVER}/${XTENSA_CLANG_TOOLCHAIN_REPO}
cp -r xtensa-clang-toolchain/* .

.get_clang_toolchain_build_scripts:
script:
- *get_clang_toolchain_build_scripts_snippet

before_script:
- !reference [.use_ci_tools, script]
- !reference [.add_gitlab_key, script]

include:
- local: .universal-toolchain-release.yml
rules:
- if: $ESP_CLANG_LEGACY_RELEASE != "true"
- local: .legacy-release.yml
rules:
- if: $ESP_CLANG_LEGACY_RELEASE == "true"
164 changes: 164 additions & 0 deletions .legacy-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@

.get_release_name_legacy: &get_release_name_legacy |
# using annotated tags
REL_NUM=$(git describe --abbrev=7)
REL_SFX="llvm15_0_0"
REL_NAME=${CONF_TARGET}-${REL_SFX}-${REL_NUM}-${PLATFORM_NAME}
ARCHIVE_NAME=${REL_NAME}.${ARCHIVE_EXT}
echo "PLATFORM_NAME: $PLATFORM_NAME"
echo "REL_NUM: $REL_NUM"
echo "REL_NAME: $REL_NAME"
echo "ARCHIVE_NAME: $ARCHIVE_NAME"

.get_gcc_toolchain_legacy: &get_gcc_toolchain_legacy |
wget --no-verbose https://dl.espressif.com/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/${XTENSA_GCC_TOOLCHAIN}
${UNARCHIVE_TOOL} ${XTENSA_GCC_TOOLCHAIN}
if [[ "$XTENSA_GCC_TOOLCHAIN" == *"linux-amd64"* ]]; then
cp -r xtensa-esp32-elf ${XTENSA_CLANG_TOOLCHAIN}
else
mv xtensa-esp32-elf ${XTENSA_CLANG_TOOLCHAIN}
wget --no-verbose https://dl.espressif.com/github_assets/espressif/crosstool-NG/releases/download/esp-2021r2-patch3/xtensa-esp32-elf-${GCC_REL_NAME}-linux-amd64.tar.gz
tar -xf xtensa-esp32-elf-${GCC_REL_NAME}-linux-amd64.tar.gz
fi
export GCC_ESP32_LINUX_TOOLCHAIN="xtensa-esp32-elf"

.package_toolchain_legacy: &package_toolchain_legacy |
${ARCHIVE_TOOL} ${ARCHIVE_NAME} ${XTENSA_CLANG_TOOLCHAIN}/
mkdir -p ${DIST_DIR}
mv ${ARCHIVE_NAME} ${DIST_DIR}/
echo "${ARCHIVE_NAME}" > ${DIST_DIR}/file_${PLATFORM_NAME}_${CONF_TARGET}

.build_template_legacy:
stage: build
tags: [ "amd64", "build" ]
artifacts:
paths:
- ${DIST_DIR}/
when: always
expire_in: 10 day
variables:
XTENSA_CLANG_TOOLCHAIN_REF: "release_esp32_clang_15.0.0_gcc_8.4.0"
GCC_REL_NAME: "gcc8_4_0-esp-2021r2-patch3"
script:
- *get_release_name_legacy
- *get_gcc_toolchain_legacy
- !reference [.fix_origin_remote_for_public, script]
- !reference [.get_clang_toolchain_build_scripts, script]
- ${BUILD_TOOLCHAIN_CMD} "${XTENSA_CLANG_TOOLCHAIN}"
- *package_toolchain_legacy

linux_amd64_build:
extends: .build_template_legacy
variables:
PLATFORM_NAME: "${PLATFORM_NAME_LINUX}"
ARCHIVE_TOOL: "${ARCHIVE_TOOL_LINUX}"
UNARCHIVE_TOOL: "${UNARCHIVE_TOOL_LINUX}"
ARCHIVE_EXT: "${ARCHIVE_EXT_LINUX}"
XTENSA_GCC_TOOLCHAIN: "xtensa-esp32-elf-${GCC_REL_NAME}-linux-amd64.tar.gz"
BUILD_TOOLCHAIN_CMD: "./build-toolchain-linux.sh"

linux_arm64_build:
extends: .build_template_legacy
image: ${CROSS_ARM_IMAGE}
variables:
PLATFORM_NAME: "${PLATFORM_NAME_LINUX_ARM64}"
ARCHIVE_TOOL: "${ARCHIVE_TOOL_LINUX}"
UNARCHIVE_TOOL: "${UNARCHIVE_TOOL_LINUX}"
ARCHIVE_EXT: "${ARCHIVE_EXT_LINUX}"
XTENSA_GCC_TOOLCHAIN: "xtensa-esp32-elf-${GCC_REL_NAME}-linux-arm64.tar.gz"
BUILD_TOOLCHAIN_CMD: "./build-toolchain-linux-arm64.sh"

win64_build:
extends: .build_template_legacy
variables:
PLATFORM_NAME: "${PLATFORM_NAME_WIN}"
ARCHIVE_TOOL: "${ARCHIVE_TOOL_WIN}"
UNARCHIVE_TOOL: "${UNARCHIVE_TOOL_WIN}"
ARCHIVE_EXT: "${ARCHIVE_EXT_WIN}"
XTENSA_GCC_TOOLCHAIN: "xtensa-esp32-elf-${GCC_REL_NAME}-win64.zip"
BUILD_TOOLCHAIN_CMD: "./build-toolchain-win.sh"

macos_amd64_build:
extends: .build_template_legacy
variables:
PLATFORM_NAME: "${PLATFORM_NAME_MACOS}"
ARCHIVE_TOOL: "${ARCHIVE_TOOL_MACOS}"
UNARCHIVE_TOOL: "${UNARCHIVE_TOOL_MACOS}"
ARCHIVE_EXT: "${ARCHIVE_EXT_MACOS}"
XTENSA_GCC_TOOLCHAIN: "xtensa-esp32-elf-${GCC_REL_NAME}-macos.tar.gz"
BUILD_TOOLCHAIN_CMD: "./build-toolchain-macos.sh"

linux_amd64_testsuite:
stage: test
tags: [ "amd64", "build" ]
needs:
- job: linux_amd64_build
variables:
PLATFORM_NAME: "${PLATFORM_NAME_LINUX}"
ARCHIVE_TOOL: "${ARCHIVE_TOOL_LINUX}"
UNARCHIVE_TOOL: "${UNARCHIVE_TOOL_LINUX}"
ARCHIVE_EXT: "${ARCHIVE_EXT_LINUX}"
LLVM_GCC_TESTSUITE_REF: "feature/ci_llvm_multitarget_crt_tests"
script:
- *get_release_name_legacy
- ${UNARCHIVE_TOOL} ${DIST_DIR}/${ARCHIVE_NAME}

# getting testsuite
- git clone -b ${LLVM_GCC_TESTSUITE_REF} --depth 1 $GITLAB_SSH_SERVER/idf/${LLVM_TESTSUITE_REPO}.git

# preparing testsuite
- export PATH=${PWD}/${XTENSA_CLANG_TOOLCHAIN}/bin/:$PATH
- cd ${LLVM_TESTSUITE_REPO}

# qemu
- ./qemu_esp32_install.sh

# run testsuite for esp32
- ./run_esp32_tests.sh

# run testsuite for compiler_rt library
- ./run_esp32_crt_tests.sh ../$XTENSA_CLANG_TOOLCHAIN

upload_to_http_legacy:
stage: private_deploy
when: manual
allow_failure: true
tags: [ "deploy", "shiny" ]
variables:
# force the fetch strategy to clean old archives up in dist/ dir
GIT_STRATEGY: fetch
before_script:
- !reference [.use_ci_tools, script]
script:
- cit_add_ssh_key "${HTTP_UPLOAD_KEY}"
# List of archives
- FILES=$(find ${DIST_DIR} -name file_\* -exec cat {} \+)
- cd ${DIST_DIR}
- scp ${FILES} ${HTTP_UPLOAD_DIR}/ct-ng/llvm-builds
# Show info
- echo -e "\nArchives were published there:\n\n$(for n in ${FILES}; do echo "${HTTP_PUBLIC_DIR}/ct-ng/llvm-builds/${n}"; done)\n"

upload_to_github_legacy:
stage: public_deploy
when: manual
allow_failure: true
only:
- tags
tags: [ "amd64", "internet" ]
image: espressif/github-hub:2
variables:
GIT_STRATEGY: fetch
GITHUB_TOKEN: "${GH_TOKEN}"
GITHUB_REPO: "${GH_REPO_HTTPS}"
TAG: "${CI_COMMIT_TAG}"
before_script: []
script:
- ls -l dist*/
- git remote add github ${GH_REPO_HTTPS}
- hub release show ${TAG} || { echo "Please create a release on GitHub with ${TAG} tag at first"; exit 1; }
# List of archives
- FILES=$(find ${DIST_DIR} -name file_\* -exec cat {} \+)
- cd ${DIST_DIR}
- ls -l $FILES
# Upload archives
- for n in ${FILES}; do hub release edit -m "" -a "${n}" "${TAG}"; done
Loading