ci: initialize gitlab-ci

This commit is contained in:
Alexey Lapshin
2021-10-19 13:27:28 +03:00
parent 5a8e207ccc
commit 38fdafc3e4
37 changed files with 3811 additions and 4 deletions

20
.github/workflows/issue_comment.yml vendored Normal file
View File

@ -0,0 +1,20 @@
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: GCC
JIRA_COMPONENT: binutils-gdb
JIRA_URL: ${{ secrets.JIRA_URL }}
JIRA_USER: ${{ secrets.JIRA_USER }}

20
.github/workflows/new_issues.yml vendored Normal file
View File

@ -0,0 +1,20 @@
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: GCC
JIRA_COMPONENT: binutils-gdb
JIRA_URL: ${{ secrets.JIRA_URL }}
JIRA_USER: ${{ secrets.JIRA_USER }}

25
.github/workflows/new_prs.yml vendored Normal file
View File

@ -0,0 +1,25 @@
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: GCC
JIRA_COMPONENT: binutils-gdb
JIRA_URL: ${{ secrets.JIRA_URL }}
JIRA_USER: ${{ secrets.JIRA_USER }}

376
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,376 @@
include:
- template: 'Workflows/Branch-Pipelines.gitlab-ci.yml'
- '.gitlab/ci/jobs.yml'
- '.gitlab/docker/images_build.yml'
stages:
- images
- build
- sign
- pack
- macos_codesign
- private_deploy
- test
- release_submit
- update_idf_tools
image: $CI_REGISTRY_IMAGE/gdb-build-linux-x86_64:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
GDB_DIST_DIR: ${CI_PROJECT_DIR}/dist
GITHUB_IMAGE_TAG: 2
# GitHub Tool options
GITHUB_USER: "${GH_USER}"
GITHUB_REPO: "${GH_REPO}"
GITHUB_TOKEN: "${GH_TOKEN}"
LINUX_ARCHIVE_TOOL: "tar czvf"
LINUX_ARCHIVE_EXT: "tar.gz"
.get_release_version: &get_release_version |
ESP_GDB_VERSION=${CI_COMMIT_TAG:-""}
ESP_GDB_VERSION=${ESP_GDB_VERSION#"esp-gdb-v"}
ESP_GDB_VERSION=${ESP_GDB_VERSION:-${CI_COMMIT_SHORT_SHA}}
.gen_sha256_file: &gen_sha256_file |
FILES_LIST=$(find * -type f -name "*esp-elf-gdb-${ESP_GDB_VERSION}*")
SHA256_FILE="esp-gdb-${ESP_GDB_VERSION}-checksum.sha256"
for n in $FILES_LIST; do
sz=$(stat -c%s "${n}") >> ${SHA256_FILE};
printf "# %s: %s bytes\n" "${n}" "${sz}" >> ${SHA256_FILE};
sha256sum -b "${n}" >> ${SHA256_FILE};
done
.release_submit_action: &release_submit_action
image: espressif/github-hub:${GITHUB_IMAGE_TAG}
when: manual
allow_failure: true
before_script:
- set -o errexit; set -o pipefail; set -o nounset
- test "${DEBUG_SHELL:-''}" = "1" && set -x
- git remote remove github || true
- git remote add github ${GH_REPO_HTTPS}
variables:
GIT_STRATEGY: fetch
GH_REL_TAG: ${CI_COMMIT_TAG}
before_script:
- set -o errexit; set -o pipefail; set -o nounset
- test "${DEBUG_SHELL:-''}" = "1" && set -x
.release_tag_filter: &release_tag_filter
only:
- /^esp-gdb-v.*$/
.needs_all_distros: &needs_all_distros
needs:
- pack-xtensa-x86_64-linux-gnu
- pack-riscv32-x86_64-linux-gnu
- pack-xtensa-i586-linux-gnu
- pack-riscv32-i586-linux-gnu
- pack-xtensa-arm-linux-gnueabi
- pack-riscv32-arm-linux-gnueabi
- pack-xtensa-arm-linux-gnueabihf
- pack-riscv32-arm-linux-gnueabihf
- pack-xtensa-aarch64-linux-gnu
- pack-riscv32-aarch64-linux-gnu
- pack-xtensa-i686-w64-mingw32
- pack-riscv32-i686-w64-mingw32
- pack-xtensa-x86_64-w64-mingw32
- pack-riscv32-x86_64-w64-mingw32
- macos_codesign_xtensa_esp_macos_arm64
- macos_codesign_riscv32_esp_macos_arm64
- macos_codesign_xtensa_esp_macos
- macos_codesign_riscv32_esp_macos
.use_ci_tools: &use_ci_tools |
curl -sSL ${CIT_LOADER_URL} -o cit_loader.sh && sh cit_loader.sh
source citools/import_functions
.gen_platformio_package_json: &gen_platformio_package_json |
cat | jq -M . >${GDB_DIST_DIR}/package.json <<EOL
{
"name": "${ESP_CHIP_ARCH}-esp-elf-gdb",
"version": "${ESP_GDB_VERSION}",
"description": "GNU Debugger for Espressif ${ESP_CHIP_ARCH} MCUs",
"keywords": [
"debugger",
"espressif"
],
"license": "GPL-2.0-or-later",
"repository": {
"type": "git",
"url": "https://github.com/espressif/binutils-gdb"
},
"system": ${PLATFORMIO_SYSTEM}
}
EOL
# Common template for all builds
.build_template: &build_template
stage: build
tags: [ "build", "amd64" ]
artifacts:
paths:
- ${GDB_DIST_DIR}
when: always
expire_in: 1 week
script:
- *get_release_version
- echo ${ESP_GDB_VERSION} > ./gdb/version.in
- ./build_esp_gdb.sh ${BUILD_ARCH_TRIPLET} ${ESP_CHIP_ARCH} ${PYTHON_VERSION} ${GDB_DIST_DIR}
# Template for tests with qemu
.test_qemu_template: &test_qemu_template
stage: test
artifacts:
when: on_failure
paths:
- ${CI_PROJECT_DIR}/gdb/testsuite/gdb.log
script:
# Load variables with tests to remove and to ignore
- set -a; source <(grep -v "^#" ".gitlab/ci/gdb-test-suites.env"); set +a
- set +u; . ~/.profile; set -u
- cd gdb/testsuite
- cp -R ${GDB_DIST_DIR}/share/gdb/* ../data-directory/
- ./configure --target=${ESP_CHIP_ARCH}-${ESP_CHIP}-elf --host=${ESP_CHIP_ARCH}-${ESP_CHIP}-elf
- make site.exp
- test "${CI_JOB_NAME##*-}" != "without_python" && pyenv local ${PYTHON_VERSION}
- test "${CI_JOB_NAME##*-}" == "without_python" && export REMOVE_TESTS="gdb.python $REMOVE_TESTS"
- ESP_DEBUG_TRACE=1 ${GDB_DIST_DIR}/bin/${ESP_CHIP_ARCH}-${ESP_CHIP}-elf-gdb --version
# Run chip specific test first. It will be removed by next step.
- runtest --tool gdb --status --target ${ESP_CHIP_ARCH}-${ESP_CHIP}-elf --target_board=simesp GDB=${GDB_DIST_DIR}/bin/${ESP_CHIP_ARCH}-${ESP_CHIP}-elf-gdb gdb.${ESP_CHIP_ARCH}-${ESP_CHIP}/*.exp
- rm -fr $REMOVE_TESTS
- runtest --tool gdb --status --target ${ESP_CHIP_ARCH}-${ESP_CHIP}-elf --target_board=simesp GDB=${GDB_DIST_DIR}/bin/${ESP_CHIP_ARCH}-${ESP_CHIP}-elf-gdb --ignore "$IGNORE_TESTS" gdb.*/*.exp
# Template for others tests without qemu
.test_no_qemu_template: &test_no_qemu_template
stage: test
artifacts:
when: on_failure
paths:
- ${CI_PROJECT_DIR}/gdb/testsuite/gdb.log
script:
- set +u; . ~/.profile; set -u
- cd gdb/testsuite
- cp -R ${GDB_DIST_DIR}/share/gdb/* ../data-directory/
- ./configure --target=${ESP_CHIP_ARCH}-${ESP_CHIP}-elf --host=${ESP_CHIP_ARCH}-${ESP_CHIP}-elf
- make site.exp
- echo "GDB_BASE_TESTS $GDB_BASE_TESTS"
- test "${CI_JOB_NAME##*-}" != "without_python" && pyenv local ${PYTHON_VERSION}
- ESP_DEBUG_TRACE=1 ${GDB_DIST_DIR}/bin/${ESP_CHIP_ARCH}-${ESP_CHIP}-elf-gdb --version
- TESTS_TO_RUN="${GDB_BASE_TESTS} gdb.${ESP_CHIP_ARCH}-${ESP_CHIP}/*.exp"
- runtest --tool gdb --status --target ${ESP_CHIP_ARCH}-${ESP_CHIP}-elf GDB=${GDB_DIST_DIR}/bin/${ESP_CHIP_ARCH}-${ESP_CHIP}-elf-gdb $TESTS_TO_RUN
.windows_test_corefile: &windows_test_corefile |
& $env:GDB_DIST_DIR\bin\$env:ESP_CHIP_ARCH-$env:ESP_CHIP-elf-gdb $chip_tests_dir\corefile.elf $chip_tests_dir\corefile.core -ex "bt" -ex "quit" | Tee-Object -FilePath test_corefile_out.txt
$stringmatch = Get-Content -Raw -Path test_corefile_out.txt
$pattern = Get-Content -Raw -Path $chip_tests_dir\corefile_pattern.txt
Select-String -InputObject $stringmatch -pattern $pattern -OutVariable patternMatch
if(!$patternMatch) {exit 1}
.windows_test_tdep: &windows_test_tdep |
& $env:GDB_DIST_DIR\bin\$env:ESP_CHIP_ARCH-$env:ESP_CHIP-elf-gdb -ex '\"maint print arch\"' -ex "quit" | Tee-Object -FilePath test_tdep_out.txt
$stringmatch = Get-Content -Raw -Path test_tdep_out.txt
$pattern = Get-Content -Raw -Path $chip_tests_dir\tdep_pattern.txt
Select-String -InputObject $stringmatch -pattern $pattern -OutVariable patternMatch
if(!$patternMatch) {exit 1}
# Template for windows
.test_windows_template: &test_windows_template
stage: test
variables:
GIT_SUBMODULE_STRATEGY: none
inherit:
default: false
script:
- $chip_tests_dir="$env:CI_PROJECT_DIR\gdb\testsuite\gdb.$env:ESP_CHIP_ARCH-$env:ESP_CHIP"
- *windows_test_corefile
- *windows_test_tdep
# Template for macos
.test_macos_template: &test_macos_template
stage: test
artifacts:
when: on_failure
paths:
- ${CI_PROJECT_DIR}/gdb/testsuite/gdb.log
variables:
GIT_SUBMODULE_STRATEGY: none
inherit:
default: false
before_script:
- set -o errexit; set -o pipefail; set -o nounset
- test "${DEBUG_SHELL:-''}" = "1" && set -x
- curl -LO http://ftp.gnu.org/gnu/dejagnu/dejagnu-1.6.3.tar.gz
- tar -xf dejagnu-1.6.3.tar.gz
- pushd dejagnu-1.6.3
- ./configure
- make
- export PATH="$PWD:$PATH"
- popd
- eval "$(pyenv init --path)"
script:
- cd gdb/testsuite
- cp -R ${GDB_DIST_DIR}/share/gdb/* ../data-directory/
- ./configure
- make site.exp
- pyenv local $TEST_PYTHON_VERSION
- python3 -V
- ESP_DEBUG_TRACE=1 ${GDB_DIST_DIR}/bin/${ESP_CHIP_ARCH}-${ESP_CHIP}-elf-gdb --version
- runtest --tool gdb --status --target ${ESP_CHIP_ARCH}-${ESP_CHIP}-elf GDB=${GDB_DIST_DIR}/bin/${ESP_CHIP_ARCH}-${ESP_CHIP}-elf-gdb gdb.${ESP_CHIP_ARCH}-${ESP_CHIP}/*.exp
# Simple test template
.test_simple_template: &test_simple_template
stage: test
variables:
GIT_SUBMODULE_STRATEGY: none
inherit:
default: false
script:
- ESP_DEBUG_TRACE=1 ${GDB_DIST_DIR}/bin/${ESP_CHIP_ARCH}-${ESP_CHIP}-elf-gdb --version
# Pack build output
.pack_template: &pack_template
stage: pack
tags: [ "build", "amd64" ]
rules:
- if: $CI_COMMIT_TAG
- if: '$CI_COMMIT_TAG =~ "/^$/"'
when: manual
allow_failure: true
variables:
GIT_SUBMODULE_STRATEGY: none
artifacts:
paths:
- ${GDB_DIST_DIR}
when: always
expire_in: 1 week
script:
- *get_release_version
- *gen_platformio_package_json
- GDB_BASE_NAME=${ESP_CHIP_ARCH}-esp-elf-gdb
- ARCHIVE_NAME=${GDB_BASE_NAME}-${ESP_GDB_VERSION}-${PLATFORM_NAME}.${ARCHIVE_EXT}
- mv ${GDB_DIST_DIR} ${GDB_BASE_NAME}
- ${ARCHIVE_TOOL} ${ARCHIVE_NAME} ${GDB_BASE_NAME}
- mkdir ${GDB_DIST_DIR}
- mv ${ARCHIVE_NAME} ${GDB_DIST_DIR}/
- test -z ${PLATFORM_NAME/*apple*} && echo "${ARCHIVE_NAME}" > ${GDB_DIST_DIR}/dist_name_${GDB_BASE_NAME}-${ESP_GDB_VERSION}-${PLATFORM_NAME} || true
.template_macos_codesign: &template_macos_codesign
stage: macos_codesign
resource_group: macos_codesign
tags: [ "darwin", "codesign" ]
when: manual
artifacts:
paths:
- ${GDB_DIST_DIR}
variables:
# directory with distro archives
DIST_ART_DIR: ${GDB_DIST_DIR}
# command to archive distro
ARCHIVE_TOOL: "tar czf"
# command to unarchive distro
UNARCHIVE_TOOL: "tar xzf"
# URL to macos codesign repo
NOTARIZATION_SCRIPTS_GIT: "${CI_SERVER_PROTOCOL}://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/espressif/macos_codesign_notarization.git"
script:
- git clone -q --depth=1 ${NOTARIZATION_SCRIPTS_GIT} -b ${CI_COMMIT_REF_NAME} ||
git clone -q --depth=1 ${NOTARIZATION_SCRIPTS_GIT}
- ./macos_codesign_notarization/run.sh
- rm -f ${GDB_DIST_DIR}/dist_name_*
macos_codesign_xtensa_esp_macos_arm64:
extends: .template_macos_codesign
needs: [ pack-xtensa-aarch64-apple-darwin21.1 ]
macos_codesign_riscv32_esp_macos_arm64:
extends: .template_macos_codesign
needs: [ pack-riscv32-aarch64-apple-darwin21.1 ]
macos_codesign_xtensa_esp_macos:
extends: .template_macos_codesign
needs: [ pack-xtensa-x86_64-apple-darwin14 ]
macos_codesign_riscv32_esp_macos:
extends: .template_macos_codesign
needs: [ pack-riscv32-x86_64-apple-darwin14 ]
upload_to_http:
stage: private_deploy
<<: *needs_all_distros
tags:
- deploy
- shiny
when: manual
allow_failure: true
variables:
GIT_STRATEGY: none
artifacts:
reports:
dotenv: ${GDB_DIST_DIR}/build.env
before_script:
- set -o errexit; set -o pipefail; set -o nounset
- test "${DEBUG_SHELL:-''}" = "1" && set -x
- *use_ci_tools
script:
- *get_release_version
- cit_add_ssh_key "${HTTP_UPLOAD_KEY}" "$(cit_parse_url_host ${HTTP_UPLOAD_DIR})"
- cd ${GDB_DIST_DIR}
- *gen_sha256_file
- FILES="$SHA256_FILE $(find . -type f -name "*esp-elf-gdb-${ESP_GDB_VERSION}*")"
- scp ${FILES} ${HTTP_UPLOAD_DIR}/
- echo -e "\nArchives were published there:\n\n$(for n in ${FILES}; do echo "${HTTP_PUBLIC_DIR}/${n}"; done)\n"
- echo "NEW_GDB_ARMHF_DISTRO_URL=${HTTP_PUBLIC_DIR}/xtensa-esp-elf-gdb-${ESP_GDB_VERSION}-arm-linux-gnueabihf.${LINUX_ARCHIVE_EXT}" >> ${GDB_DIST_DIR}/build.env
- echo "NEW_GDB_ARMHF_DISTRO_DIR=xtensa-esp-elf-gdb" >> ${GDB_DIST_DIR}/build.env
test_with_openocd:
stage: test
when: manual
allow_failure: true
variables:
GDB_ARMHF_DISTRO_URL: ${NEW_GDB_ARMHF_DISTRO_URL}
NEW_GDB_ARMHF_DISTRO_DIR: ${NEW_GDB_ARMHF_DISTRO_DIR}
needs: [ upload_to_http ]
trigger:
project: idf/openocd-esp32
strategy: depend
release_tag:
stage: release_submit
tags: [ "amd64", "internet" ]
<<: *needs_all_distros
<<: *release_tag_filter
<<: *release_submit_action
artifacts:
reports:
dotenv: ${GDB_DIST_DIR}/build.env
script:
- *get_release_version
- hub release delete ${GH_REL_TAG} || true
# List of archives
- cd ${GDB_DIST_DIR}
- *gen_sha256_file
- FILES_LIST=$(find * -type f -name "*esp-elf-gdb-${ESP_GDB_VERSION}*")
- ATTACH_FILE_OPTIONS=$(printf -- "-a %s " $FILES_LIST)
- ATTACH_FILE_OPTIONS="-a $SHA256_FILE $ATTACH_FILE_OPTIONS"
# Create pre-release with archives attached
- hub release create --prerelease -m "${ESP_GDB_VERSION}" ${ATTACH_FILE_OPTIONS} ${GH_REL_TAG}
- echo "IDF_TOOLS_GDB_VERSION=${ESP_GDB_VERSION}" >> ${GDB_DIST_DIR}/build.env
update_idf_tools:
stage: update_idf_tools
needs: [ release_tag ]
when: manual
allow_failure: true
<<: *release_tag_filter
variables:
TOOL_NAME: "gdb"
TOOL_MEMBERS: "xtensa-esp-elf-gdb riscv32-esp-elf-gdb"
TOOL_VERSION: ${IDF_TOOLS_GDB_VERSION}
TOOL_SHA256_URL: "https://github.com/espressif/binutils-gdb/releases/download/${CI_COMMIT_TAG}/esp-gdb-${IDF_TOOLS_GDB_VERSION}-checksum.sha256"
trigger:
project: idf/idf-tools-updater
strategy: depend

View File

@ -0,0 +1,505 @@
# This is an env file using by .gitlab-ci.yml
# NOTES:
# Comment lines must start with '#' character
REMOVE_TESTS="
gdb.ada
gdb.fortran
gdb.go
gdb.guile
gdb.opencl
gdb.pascal
gdb.rust
gdb.threads
gdb.dap
# chip depended tests. Run it before removing
gdb.riscv32-esp
gdb.xtensa-esp32
gdb.xtensa-esp32s2
gdb.xtensa-esp32s3
"
IGNORE_TESTS="
# Initial ignoring tests
abstract-origin.exp
access-mem-running-thread-exit.exp
advance.exp
advance-until-multiple-locations.exp
all-bin.exp
ambiguous.exp
annotate-symlink.exp
array-element.exp
assign.exp
async.exp
base.exp
batch-preserve-term-settings.exp
bg-execution-repeat.exp
bitfields2.exp
bitfields.exp
bp-permanent.exp
break-idempotent.exp
break-inline-psymtab.exp
break-main-file-remove-fail.exp
breakpoint.exp
breakpoint-in-ro-region.exp
break-unload-file.exp
break-while-running.exp
bs15503.exp
call-ar-st.exp
callexit.exp
callfuncs.exp
call-method-register.exp
call-no-debug.exp
call-rt-st.exp
call-sc.exp
casts.exp
catch-follow-exec.exp
catch-fork-kill.exp
catch-syscall.exp
chained-calls.exp
charset.exp
chng-syms.exp
clang-debug-names.exp
classes.exp
code_elim.exp
commands.exp
common-block.exp
compare-sections.exp
compile-cplus-array-decay.exp
compile-cplus.exp
compile-cplus-method.exp
complete-empty.exp
completion.exp
complex.exp
complex-parts.exp
consecutive.exp
consecutive-step-over.exp
constexpr-field.exp
constvars.exp
continue-after-aborted-step-over.exp
continue-all-already-running.exp
continue-pending-after-query.exp
continue-pending-status.exp
converts.exp
corefile-buildid.exp
cpexprs-debug-types.exp
cpexprs.exp
cpls-abi-tag.exp
cplusfuncs.exp
cp-replace-typedefs-ns-template.exp
ctti.exp
data-loc.exp
dbx.exp
dcache-flush.exp
dcache-line-read-error.exp
debug-expr.exp
decl-before-def.exp
derivation.exp
derived-type.exp
derived-type-function.exp
display.exp
dmsym.exp
dprintf-non-stop.exp
dump.exp
dup-sect.exp
dw2-ada-ffffffff.exp
dw2-anon-mptr.exp
dw2-bad-parameter-type.exp
dw2-cp-infcall-ref-static.exp
dw2-dir-file-name.exp
dw2-disasm-over-non-stmt.exp
dw2-dos-drive.exp
dw2-double-set-die-type.exp
dw2-dummy-cu.exp
dw2-empty-namespace.exp
dw2-empty-pc-range.exp
dw2-entry-value.exp
dw2-filename.exp
dw2-fixed-point.exp
dw2-icc-opaque.exp
dw2-inheritance.exp
dw2-inline-many-frames.exp
dw2-inline-small-func.exp
dw2-intermix.exp
dw2-is-stmt-2.exp
dw2-is-stmt.exp
dw2-line-number-zero.exp
dw2-linkage-name-trust.exp
dw2-modula2-self-type.exp
dw2-objfile-overlap.exp
dw2-op-call.exp
dw2-op-stack-value.exp
dw2-opt-structptr.exp
dw2-param-error.exp
dw2-ranges-func.exp
dw2-ranges-psym.exp
dw2-ref-missing-frame.exp
dw2-simple-locdesc.exp
dw2-skip-prologue.exp
dw2-using-debug-str.exp
dw4-sig-types.exp
dw4-sig-type-unused.exp
dw5-rnglist-test.exp
dwzbuildid.exp
dynarr-ptr.exp
ena-dis-br.exp
ena-dis-br-range.exp
endian.exp
entry-values.exp
examine-backward.exp
exception.exp
exceptprint.exp
exec-invalid-sysroot.exp
execl-update-breakpoints.exp
execution-termios.exp
expand-psymtabs-cxx.exp
expand-sals.exp
explicit.exp
find.exp
find-unmapped.exp
finish.exp
finish-pretty.exp
fission-absolute-dwo.exp
fission-relative-dwo.exp
float.exp
forking-threads-plus-breakpoint.exp
fork-running-state.exp
fpointer.exp
frame-inlined-in-outer-frame.exp
funcargs.exp
func-ptrs.exp
gcore.exp
gcore-relro-pie.exp
gdb11479.exp
gdb2549.exp
gdb701.exp
gdb792.exp
gdb-add-index-symlink.exp
gdb-caching-proc.exp
gdb-index.exp
gdb-index-nodebug.exp
gdb-sigterm-2.exp
gdb-sigterm.exp
gnu_vector.exp
gnu-debugdata.exp
hand-call-new-thread.exp
hbreak2.exp
hook-stop.exp
implptr-64bit.exp
included.exp
index-cache.exp
infcall-exec.exp
infcall-nested-structs-c++.exp
infcall-nested-structs-c.exp
info-macros.exp
info_minsym.exp
info-modules.exp
info-threads.exp
info-types.exp
inherit.exp
inline-bt.exp
inline-cmds.exp
inline-small-func.exp
interrupt-daemon.exp
interrupt-noterm.exp
interrupt-while-step-over.exp
intrinsics.exp
iostream.exp
killed-outside.exp
kill.exp
koenig.exp
label.exp
langs.exp
large-frame.exp
linespec.exp
line-symtabs.exp
list.exp
local.exp
loclists-multiple-cus.exp
loclists-sec-offset.exp
loclists-start-end.exp
logical.exp
longest-types.exp
longjmp.exp
ls-dollar.exp
macscp.exp
maint.exp
maint-info-sections.exp
max-depth-c++.exp
max-depth.exp
mb-ctor.exp
mb-inline.exp
mb-templates.exp
member-ptr-forwardref.exp
method-call-in-c.exp
method.exp
mi2-cli-display.exp
mi2-var-child.exp
mi-async-run.exp
mi-break.exp
mi-breakpoint-multiple-locations.exp
mi-catch-cpp-exceptions.exp
mi-cli.exp
mi-cmd-param-changed.exp
mi-complete.exp
mi-condbreak-call-thr-state.exp
mi-console.exp
mi-detach.exp
mi-disassemble.exp
mi-dprintf.exp
mi-eval.exp
mi-exit-code.exp
mi-fill-memory.exp
mi-fortran-modules.exp
mi-frame-regs.exp
mi-info-sources.exp
mi-inheritance-syntax-error.exp
mi-linespec-err-cp.exp
mi-logging.exp
mi-memory-changed.exp
mi-read-memory.exp
mi-return.exp
miscexprs.exp
mi-simplerun.exp
mi-stack.exp
mi-stepi.exp
mi-stepn.exp
mi-sym-info.exp
mi-traceframe-changed.exp
mi-until.exp
mi-var-block.exp
mi-var-child.exp
mi-var-child-f.exp
mi-var-cmd.exp
mi-var-cp.exp
mi-var-create-rtti.exp
mi-var-display.exp
mi-var-invalidate.exp
mi-var-list-children-invalid-grandchild.exp
mi-var-rtti.exp
mi-vla-c99.exp
mi-vla-fortran.exp
mi-watch.exp
mixed-lang-stack.exp
module.exp
morestack.exp
m-static.exp
multi-create-ns-info-thr.exp
multi-dim.exp
multi-re-run.exp
names.exp
namespace.exp
namespace-nested-import.exp
nested-funcs.exp
new-ui-echo.exp
new-ui.exp
new-ui-mi-sync.exp
next-bp-other-thread.exp
nextoverexit.exp
nextoverthrow.exp
next-while-other-thread-longjmps.exp
nodebug.exp
no-dmgl-verbose.exp
no-libstdcxx-probe.exp
non-ldr-exit.exp
noreturn-finish.exp
noreturn-return.exp
nsrecurs.exp
nsusing.exp
offsets.exp for testing large offsets
omp-par-scope.exp
opaque.exp
oranking.exp
ovldbreak.exp
ovsrch.exp
paginate-bg-execution.exp
pass-by-ref-2.exp
pass-by-ref.exp
per-bfd-sharing.exp
pie-fork.exp
pointers.exp
pr10687.exp
pr11465.exp
pr-1210.exp
pr17132.exp
pr-574.exp
pr9167.exp
pr9631.exp
premature-dummy-frame-removal.exp
printcmds.exp
print-formatted.exp
printmethod.exp
process-dies-while-handling-bp.exp
psmang.exp
psymtab-parameter.exp
ptr-typedef.exp
ptype.exp
ptype-on-functions.exp
py-autoloaded-pretty-printers-in-newobjfile-event.exp
py-auto-load-chaining.exp
py-breakpoint.exp
py-evsignal.exp
py-finish-breakpoint2.exp
py-frame.exp
py-framefilter-mi.exp
py-mi-events.exp
py-mi.exp
py-mi-var-info-path-expression.exp
py-pending-frame-level.exp
py-pp-integral.exp
py-pp-re-notag.exp
py-progspace.exp
py-rbreak.exp
py-strfns.exp
py-unwind-user-regs.exp
py-value.exp
quit-live.exp
radix.exp
readline-ask.exp
return2.exp
rnglists-multiple-cus.exp
rnglists-sec-offset.exp
rtti.exp
run-attach-while-running.exp
rvalue-ref-casts.exp
rvalue-ref-overload.exp
rvalue-ref-params.exp
scope.exp
sect-cmd.exp
sep.exp
setshow.exp
signals-state-child.exp
sizeof.exp
skip.exp
skip-inline.exp
skip-two.exp
solib-probes-nosharedlibrary.exp
stack-checking.exp
stack-protector.exp
stale-infcall.exp
stap-probe.exp
static-method.exp
static-print-quit.exp
step-and-next-inline.exp
step-bg-decr-pc-switch-thread.exp
step-bt.exp
step-indirect-call-thunk.exp
step-symless.exp
step-test.exp
stop-with-handle.exp
store.exp
structs2.exp
structs.exp
style.exp
subarray.exp
subtypes.exp
symbol-without-target_section.exp
tdesc-reload.exp
temargs.exp
templates.exp
term.exp
tfile.exp
tid-reuse.exp
try_catch.exp
tui-missing-src.exp
twice.exp
typedef-operator.exp
typeid.exp
ui-redirect.exp
unavailable.exp
unbounded-array.exp
userdef.exp
using-crash.exp
utf8-identifiers.exp
var-tag.exp
vfork-follow-child-exec.exp
vfork-follow-child-exit.exp
virtbase.exp
virtfunc2.exp
virtfunc.exp
vla-alloc-assoc.exp
vla-cxx.exp
vla-datatypes.exp
vla-history.exp
vla-optimized-out.exp
vla-ptr-info.exp
vla-ptype.exp
vla-ptype-sub.exp
vla-sizeof.exp
vla-struct-fields.exp
vla-type.exp
vla-value.exp
vla-value-sub-arbitrary.exp
vla-value-sub.exp
vla-value-sub-finish.exp
volatile.exp
watch-bitfields.exp
watchpoint.exp
watchpoint-multi-exit.exp
watch-vfork.exp
wchar.exp
weird.exp
whatis-ptype-typedefs.exp
whatis_type.exp
wide_char_types.exp
# GDB 12.1
break-on-_exit.exp
fortran-string.exp
foll-fork.exp
mi-add-inferior.exp
# testsuite gets wrong GDB pid, because we use bin_wrappers
bt-on-fatal-signal.exp
# can't set non-stop mode for remote ESP
access-mem-running.exp
# TODO: fix GCC-293
cli-suppress-notification.exp
# TODO: fix GCC-295
dw2-ranges-base.exp
# TODO: fix GCC-294
non-trivial-retval.exp
retval-large-struct.exp
# GDB 13.2
step-through-epilogue.exp
clear_non_user_bp.exp
longjmp-until-in-main.exp
vfork-follow-parent.exp
break-f-std-string.exp
py-disasm.exp
py-startup-opt.exp
dw2-lines.exp
loc-sec-offset.exp
reread.exp
test_ioctl_TCSETSW.exp
interrupt-a.exp
# GDB 14.2
# Most failing tests require libpthreads that is not supported in toolchain
bg-exec-sigint-bp-cond.exp
board-sanity.exp
bp-cond-failure.exp
frame-view.exp
funcreturn.exp
gdb-caching-proc-consistency.exp
gdb669.exp
mi-pthreads.exp
infcall-failure.exp
info-program.exp
jump_multiple_objfiles.exp
lotsa-lines.exp
maint_print_struct.exp
mi-condbreak-fail.exp
mi-condbreak-throw.exp
mi-py-modify-bp.exp
mi-thread-bp-deleted.exp
mi-thread-specific-bp.exp
pr13961.exp
printf-wchar_t.exp
print-global-stub.exp
print-simple-values.exp
py-exec-file.exp
py-progspace-events.exp
py-varobj.exp
recurse.exp
run-with-two-mi-uis.exp
self-spec.exp
tui-layout.exp
"

View File

@ -0,0 +1,40 @@
variables:
GDB_BASE_TESTS: '
gdb.base/alias.exp
gdb.base/all-architectures-0.exp
gdb.base/all-architectures-1.exp
gdb.base/all-architectures-2.exp
gdb.base/all-architectures-3.exp
gdb.base/all-architectures-4.exp
gdb.base/all-architectures-5.exp
gdb.base/all-architectures-6.exp
gdb.base/all-architectures-7.exp
gdb.base/bad-file.exp
gdb.base/batch-exit-status.exp
gdb.base/bitops.exp
gdb.base/command-line-input.exp
gdb.base/define-prefix.exp
gdb.base/dfp-exprs.exp
gdb.base/echo.exp
gdb.base/empty_exe.exp
gdb.base/environ.exp
gdb.base/eval.exp
gdb.base/gdb1056.exp
gdb.base/gdbhistsize-history.exp
gdb.base/help.exp
gdb.base/history-duplicates.exp
gdb.base/ifelse.exp
gdb.base/interact.exp
gdb.base/multi-line-starts-subshell.exp
gdb.base/osabi.exp
gdb.base/page.exp
gdb.base/quit.exp
gdb.base/readline.exp
gdb.base/remotetimeout.exp
gdb.base/shell.exp
gdb.base/source.exp
gdb.base/statistics.exp
gdb.base/subst.exp
gdb.base/trace-commands.exp
gdb.base/warning.exp
gdb.base/gdbinit-history.exp'

1697
.gitlab/ci/jobs.yml Normal file

File diff suppressed because it is too large Load Diff

239
.gitlab/ci/jobs.yml-gen.sh Executable file
View File

@ -0,0 +1,239 @@
#!/bin/bash
PYTHON_VERSIONS="without_python 3.8.0 3.9.0 3.10.0 3.11.0 3.12.0"
PYTHON_MACOS_AARCH64_VERSIONS="without_python 3.8.10 3.9.13 3.10.0 3.11.0 3.12.0"
MACOS_TESTS_PYTHON_VERSIONS="3.8.10 3.9.5 3.10.2"
declare -a TEST_ESP_CHIPS=( "esp32"
"esp32s2"
"esp32s3"
"esp")
declare -a TEST_ESP_CHIPS_ARCH=( "xtensa"
"xtensa"
"xtensa"
"riscv32")
ESP_ARCHITECTURES_ALL="xtensa riscv32"
MACOS_x86_64_TRIPLET="x86_64-apple-darwin14"
MACOS_AARCH64_TRIPLET="aarch64-apple-darwin21.1"
LINUX_x86_64_TRIPLET="x86_64-linux-gnu"
WIN_x86_64_TRIPLET="x86_64-w64-mingw32"
declare -a ARCHITECTURES_ARRAY=(${LINUX_x86_64_TRIPLET}
"i586-linux-gnu"
"arm-linux-gnueabi"
"arm-linux-gnueabihf"
"aarch64-linux-gnu"
"i686-w64-mingw32"
${WIN_x86_64_TRIPLET}
${MACOS_x86_64_TRIPLET}
${MACOS_AARCH64_TRIPLET})
declare -a PLATFORMIO_SYSTEM_ARRAY=("\\\"linux_x86_64\\\""
"\\\"linux_i686\\\""
"[\\\"linux_armv6l\\\",\\\"linux_armv7l\\\"]"
"[\\\"linux_armv7l\\\",\\\"linux_armv8l\\\"]"
"\\\"linux_aarch64\\\""
"\\\"windows_x86\\\""
"\\\"windows_amd64\\\""
"\\\"darwin_x86_64\\\""
"\\\"darwin_arm64\\\"")
declare -a RUST_TARGET_TRIPLET_ARRAY=("x86_64-unknown-linux-gnu"
"i586-unknown-linux-gnu"
"arm-unknown-linux-gnueabi"
"arm-unknown-linux-gnueabihf"
"aarch64-unknown-linux-gnu"
"i686-pc-windows-gnu"
"x86_64-pc-windows-gnu"
"x86_64-apple-darwin"
"aarch64-apple-darwin")
# e.g. a postfix of image for "arm-linux-gnueabi" is "arm-cross".
# Note that sequence of array is important
declare -a IMAGE_POSTFIX_ARRAY=("linux-x86_64"
"linux-x86"
"linux-armel"
"linux-armhf"
"linux-arm64"
"win-x86"
"win-x86_64"
"macos-x86_64"
"macos-arm64")
ARCHITECTURES_ARRAY_LENGTH=${#ARCHITECTURES_ARRAY[@]}
test $ARCHITECTURES_ARRAY_LENGTH != ${#RUST_TARGET_TRIPLET_ARRAY[@]} && echo "Bad arrays initialization" && exit 1
test $ARCHITECTURES_ARRAY_LENGTH != ${#IMAGE_POSTFIX_ARRAY[@]} && echo "Bad arrays initialization" && exit 1
test $ARCHITECTURES_ARRAY_LENGTH != ${#PLATFORMIO_SYSTEM_ARRAY[@]} && echo "Bad arrays initialization" && exit 1
read -r -d '' build_arch_python <<-EOF
\$ARCH_TRIPLET-\$PYTHON_VERSION
image: \$BUILD_IMAGE
eval "echo \"$build_arch_python\""
EOF
function build_arch() {
BUILD_ARCH_TRIPLET=$1
IMAGE_SUFFIX=$2
RUST_TARGET_TRIPLET=$3
PYTHON_VERSIONS_TO_BUILD=$PYTHON_VERSIONS
if [ "$MACOS_AARCH64_TRIPLET" = "$BUILD_ARCH_TRIPLET" ]; then
PYTHON_VERSIONS_TO_BUILD=$PYTHON_MACOS_AARCH64_VERSIONS
fi
echo ""
for ESP_CHIP_ARCH in $ESP_ARCHITECTURES_ALL; do
echo ""
for PYTHON_VERSION in $PYTHON_VERSIONS_TO_BUILD; do
echo "$ESP_CHIP_ARCH-$BUILD_ARCH_TRIPLET-$PYTHON_VERSION:"
echo " variables:"
echo " BUILD_ARCH_TRIPLET: $BUILD_ARCH_TRIPLET"
echo " ESP_CHIP_ARCH: $ESP_CHIP_ARCH"
echo " PYTHON_VERSION: $PYTHON_VERSION"
echo " RUST_TARGET_TRIPLET: $RUST_TARGET_TRIPLET"
echo " image: \$CI_REGISTRY_IMAGE/gdb-build-$IMAGE_SUFFIX:latest"
echo " extends: .build_template"
done;
done;
echo ""
echo ""
}
function test_arch_linux() {
BUILD_ARCH_TRIPLET=$1
IMAGE_SUFFIX=$2
RUNNER_TAGS=$3
for PYTHON_VERSION in $PYTHON_VERSIONS; do
for ((i = 0; i < ${#TEST_ESP_CHIPS[@]}; i++)); do
ESP_CHIP=${TEST_ESP_CHIPS[$i]}
ESP_CHIP_ARCH=${TEST_ESP_CHIPS_ARCH[$i]}
echo ""
echo ""
TEST_TEMPLATE=
if [ $ESP_CHIP == "esp32" ]; then
TEST_TEMPLATE=".test_qemu_template"
else
TEST_TEMPLATE=".test_no_qemu_template"
fi
echo "$ESP_CHIP_ARCH-$ESP_CHIP-test-$BUILD_ARCH_TRIPLET-$PYTHON_VERSION:"
echo " tags: $RUNNER_TAGS"
echo " variables:"
echo " ESP_CHIP: $ESP_CHIP"
echo " ESP_CHIP_ARCH: $ESP_CHIP_ARCH"
echo " PYTHON_VERSION: $PYTHON_VERSION"
echo " image: \$CI_REGISTRY_IMAGE/gdb-test-dejagnu:latest"
echo " needs: [ $ESP_CHIP_ARCH-$BUILD_ARCH_TRIPLET-$PYTHON_VERSION ]"
echo " extends: $TEST_TEMPLATE"
echo ""
done;
done;
}
function test_macos() {
for PYTHON_VERSION in $MACOS_TESTS_PYTHON_VERSIONS; do
echo ""
echo ""
for ((i = 0; i < ${#TEST_ESP_CHIPS[@]}; i++)); do
ESP_CHIP=${TEST_ESP_CHIPS[$i]}
ESP_CHIP_ARCH=${TEST_ESP_CHIPS_ARCH[$i]}
echo "$ESP_CHIP_ARCH-$ESP_CHIP-test-macos-$PYTHON_VERSION:"
echo " tags: [ \"darwin\", \"amd64\" ]"
echo " variables:"
echo " ESP_CHIP: $ESP_CHIP"
echo " ESP_CHIP_ARCH: $ESP_CHIP_ARCH"
echo " TEST_PYTHON_VERSION: $PYTHON_VERSION"
echo " needs: [ $ESP_CHIP_ARCH-$MACOS_x86_64_TRIPLET-${PYTHON_VERSION%.*}.0 ]"
echo " extends: .test_macos_template"
echo ""
done;
done;
}
function test_windows() {
echo ""
echo ""
for ((i = 0; i < ${#TEST_ESP_CHIPS[@]}; i++)); do
ESP_CHIP=${TEST_ESP_CHIPS[$i]}
ESP_CHIP_ARCH=${TEST_ESP_CHIPS_ARCH[$i]}
echo "$ESP_CHIP_ARCH-$ESP_CHIP-test-$WIN_x86_64_TRIPLET:"
echo " tags: [ windows, powershell ]"
echo " variables:"
echo " ESP_CHIP: $ESP_CHIP"
echo " ESP_CHIP_ARCH: $ESP_CHIP_ARCH"
echo " needs: [ $ESP_CHIP_ARCH-$WIN_x86_64_TRIPLET-without_python ]"
echo " extends: .test_windows_template"
echo ""
done;
}
function pack_output() {
BUILD_ARCH_TRIPLET=$1
PLATFORMIO_SYSTEM=$2
IS_TESTED=$3
RUNNER_TAGS=$4
PYTHON_VERSIONS_TO_PACK=$PYTHON_VERSIONS
if [ "$MACOS_AARCH64_TRIPLET" = "$BUILD_ARCH_TRIPLET" ]; then
PYTHON_VERSIONS_TO_PACK=$PYTHON_MACOS_AARCH64_VERSIONS
fi
for ESP_CHIP_ARCH in $ESP_ARCHITECTURES_ALL; do
echo ""
echo "pack-$ESP_CHIP_ARCH-$BUILD_ARCH_TRIPLET:"
echo " variables:"
echo " PLATFORM_NAME: ${BUILD_ARCH_TRIPLET}"
echo " PLATFORMIO_SYSTEM: \"${PLATFORMIO_SYSTEM}\""
echo " ESP_CHIP_ARCH: ${ESP_CHIP_ARCH}"
if [[ ${BUILD_ARCH_TRIPLET} =~ "mingw" ]]; then
echo " ARCHIVE_TOOL: \"zip -r\""
echo " ARCHIVE_EXT: \"zip\""
else
echo " ARCHIVE_TOOL: \${LINUX_ARCHIVE_TOOL}"
echo " ARCHIVE_EXT: \${LINUX_ARCHIVE_EXT}"
fi
echo " tags: $RUNNER_TAGS"
echo " needs:"
for PYTHON_VERSION in $PYTHON_VERSIONS_TO_PACK; do
echo " - $ESP_CHIP_ARCH-$BUILD_ARCH_TRIPLET-$PYTHON_VERSION"
done;
echo " extends: .pack_template"
done;
echo ""
echo ""
}
read -r -d '' header <<-EOF
# DO NOT EDIT!
# THIS FILE WAS GENERATED BY .gitlab-ci.yml-gen.sh
# JUST MODIFY IT IF YOU NEED AND UPDATE WITH:
# $ ./jobs.yml-gen.sh > ./jobs.yml
include: '.gitlab/ci/gdb-test-suites.yml'
EOF
echo "$header"
echo ""
for (( i=0; i<${ARCHITECTURES_ARRAY_LENGTH}; i++ )); do
echo "# BUILD ${ARCHITECTURES_ARRAY[$i]}"
build_arch ${ARCHITECTURES_ARRAY[$i]} ${IMAGE_POSTFIX_ARRAY[$i]} ${RUST_TARGET_TRIPLET_ARRAY[i]}
done
echo "# TEST ${LINUX_x86_64_TRIPLET}"
test_arch_linux ${LINUX_x86_64_TRIPLET} "" "[ \"amd64\", \"build\" ]"
echo "# TEST ${MACOS_x86_64_TRIPLET}"
test_macos
echo "# TEST ${WIN_x86_64_TRIPLET}"
test_windows
for (( i=0; i<${ARCHITECTURES_ARRAY_LENGTH}; i++ )); do
echo "# PACK GDB ${ARCHITECTURES_ARRAY[$i]}"
IS_TESTED="n"
if [ ${ARCHITECTURES_ARRAY[$i]} == ${LINUX_x86_64_TRIPLET} ]; then
IS_TESTED="y"
fi
pack_output ${ARCHITECTURES_ARRAY[$i]} ${PLATFORMIO_SYSTEM_ARRAY[$i]} $IS_TESTED "[ \"amd64\", \"build\" ]"
done

View File

@ -0,0 +1,105 @@
FROM ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
git \
wget \
curl \
zip \
autoconf \
make \
texinfo \
expect \
libpixman-1-0 \
libnuma1 \
libglib2.0-0 \
libffi-dev \
libncursesw5 \
libssl-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
zlib1g-dev \
gcc \
liblzma-dev \
patch \
xz-utils \
libsdl2-2.0-0 \
libslirp0 \
&& apt remove --purge -y python3 \
&& apt autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# instal dejagnu
ARG DEJAGNU_VERSION=1.6.3
ARG DEJAGNU_SHA256=87daefacd7958b4a69f88c6856dbd1634261963c414079d0c371f589cd66a2e3
RUN curl -LO http://ftp.gnu.org/gnu/dejagnu/dejagnu-${DEJAGNU_VERSION}.tar.gz && \
tar -xf dejagnu-${DEJAGNU_VERSION}.tar.gz && \
echo "${DEJAGNU_SHA256} dejagnu-${DEJAGNU_VERSION}.tar.gz" | sha256sum --check --strict - && \
cd dejagnu-${DEJAGNU_VERSION} && \
./configure && \
make && \
make install && \
cd .. && \
rm -fr dejagnu*
# Install esp-toolchains for esp DejaGNU tests
ARG ESP_TOOLCHAIN_CHECKSUM_URL="https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240305/crosstool-NG-esp-13.2.0_20240305-checksum.sha256"
ARG ESP_TOOLCHAIN_URLS=" \
https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240305/xtensa-esp-elf-13.2.0_20240305-x86_64-linux-gnu.tar.xz \
https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240305/riscv32-esp-elf-13.2.0_20240305-x86_64-linux-gnu.tar.xz"
RUN set -e; \
curl -LO $ESP_TOOLCHAIN_CHECKSUM_URL && \
export ESP_TOOLCHAIN_CHECKSUM_FILE=${ESP_TOOLCHAIN_CHECKSUM_URL##*/} && \
for ESP_TOOLCHAIN_URL in $ESP_TOOLCHAIN_URLS; do \
curl -LO ${ESP_TOOLCHAIN_URL} && \
export ESP_TOOLCHAIN_ARCHIVE=${ESP_TOOLCHAIN_URL##*/} && \
grep "*$ESP_TOOLCHAIN_ARCHIVE" $ESP_TOOLCHAIN_CHECKSUM_FILE | sha256sum --check --strict - && \
tar -xf $ESP_TOOLCHAIN_ARCHIVE -C /opt && \
rm -fr $ESP_TOOLCHAIN_ARCHIVE; \
done; \
rm $ESP_TOOLCHAIN_CHECKSUM_FILE
ENV PATH=/opt/xtensa-esp-elf/bin/:$PATH
ENV PATH=/opt/riscv32-esp-elf/bin/:$PATH
# Install esp-qemu for esp DejaGNU tests
ARG ESP_QEMU_CHECKSUM_URL="https://github.com/espressif/qemu/releases/download/esp-develop-8.2.0-20240122/qemu-esp_develop_8.2.0_20240122-checksum.sha256"
ARG ESP_QEMU_URLS=" \
https://github.com/espressif/qemu/releases/download/esp-develop-8.2.0-20240122/qemu-xtensa-softmmu-esp_develop_8.2.0_20240122-x86_64-linux-gnu.tar.xz \
https://github.com/espressif/qemu/releases/download/esp-develop-8.2.0-20240122/qemu-riscv32-softmmu-esp_develop_8.2.0_20240122-x86_64-linux-gnu.tar.xz"
RUN set -e; \
curl -LO $ESP_QEMU_CHECKSUM_URL && \
export ESP_QEMU_CHECKSUM_FILE=${ESP_QEMU_CHECKSUM_URL##*/} && \
for ESP_TOOLCHAIN_URL in $ESP_QEMU_URLS; do \
curl -LO ${ESP_TOOLCHAIN_URL} && \
export ESP_TOOLCHAIN_ARCHIVE=${ESP_TOOLCHAIN_URL##*/} && \
grep "*$ESP_TOOLCHAIN_ARCHIVE" $ESP_QEMU_CHECKSUM_FILE | sha256sum --check --strict - && \
tar -xf $ESP_TOOLCHAIN_ARCHIVE -C /opt && \
rm -fr $ESP_TOOLCHAIN_ARCHIVE; \
done; \
rm $ESP_QEMU_CHECKSUM_FILE
ENV PATH=/opt/qemu/bin/:$PATH
# install pyenv
ARG PYENV_DIST_VERSION="v2.3.36"
RUN mkdir -p /opt/pyenv \
&& git clone -b ${PYENV_DIST_VERSION} --single-branch --depth 1 https://github.com/pyenv/pyenv.git /opt/pyenv/pyenv-${PYENV_DIST_VERSION} \
&& echo "export PYENV_ROOT=\"/opt/pyenv/pyenv-${PYENV_DIST_VERSION}\"" >> ~/.profile \
&& echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile \
&& echo 'eval "$(pyenv init --path)"' >> ~/.profile \
&& echo 'if command -v pyenv 1>/dev/null 2>&1; then' >> ~/.bashrc \
&& echo ' eval "$(pyenv init --path)"' >> ~/.bashrc \
&& echo 'fi' >> ~/.bashrc
# install pythons
ARG PYTHON_VERSIONS="3.8.0 3.9.0 3.10.0 3.11.0 3.12.0"
RUN . ~/.profile && \
export PYTHON_CONFIGURE_OPTS="--enable-shared" && \
for PYTHON_VERSION in $PYTHON_VERSIONS; do \
pyenv install $PYTHON_VERSION; \
done; \
pyenv local --unset

View File

@ -0,0 +1,24 @@
# syntax = edrevo/dockerfile-plus
ARG DOCKER_REGISTRY
ARG TOOLCHAIN_TAG
FROM ${DOCKER_REGISTRY}/esp32-toolchain-arm-cross:${TOOLCHAIN_TAG}
ARG TARGET_HOSTS="aarch64-linux-gnu"
ARG OPENSSL_BUILD_PLATFORM="linux-generic64"
ARG OPENSSL_TARGET_PLATFORM="linux-aarch64"
ARG TARGET_HOST="aarch64-linux-gnu"
INCLUDE+ ./common/Dockerfile.update-apt-sources
RUN set -ex; \
apt-get update \
&& apt-get install -y -q --no-install-recommends \
libc6-dev \
linux-libc-dev \
libffi-dev:arm64 \
&& rm -rf /var/lib/apt/lists/*
INCLUDE+ ./common/Dockerfile.gdb-deps
INCLUDE+ ./common/Dockerfile.python-builder

View File

@ -0,0 +1,24 @@
# syntax = edrevo/dockerfile-plus
ARG DOCKER_REGISTRY
ARG TOOLCHAIN_TAG
FROM ${DOCKER_REGISTRY}/esp32-toolchain-arm-cross:${TOOLCHAIN_TAG}
ARG TARGET_HOSTS="arm-linux-gnueabi"
ARG OPENSSL_BUILD_PLATFORM="linux-generic32"
ARG OPENSSL_TARGET_PLATFORM="linux-armv4"
ARG TARGET_HOST="arm-linux-gnueabi"
INCLUDE+ ./common/Dockerfile.update-apt-sources
RUN set -ex; \
apt-get update \
&& apt-get install -y -q --no-install-recommends \
libc6-dev \
linux-libc-dev \
libffi-dev:armel \
&& rm -rf /var/lib/apt/lists/*
INCLUDE+ ./common/Dockerfile.gdb-deps
INCLUDE+ ./common/Dockerfile.python-builder

View File

@ -0,0 +1,24 @@
# syntax = edrevo/dockerfile-plus
ARG DOCKER_REGISTRY
ARG TOOLCHAIN_TAG
FROM ${DOCKER_REGISTRY}/esp32-toolchain-arm-cross:${TOOLCHAIN_TAG}
ARG TARGET_HOSTS="arm-linux-gnueabihf"
ARG OPENSSL_BUILD_PLATFORM="linux-generic32"
ARG OPENSSL_TARGET_PLATFORM="linux-armv4"
ARG TARGET_HOST="arm-linux-gnueabihf"
INCLUDE+ ./common/Dockerfile.update-apt-sources
RUN set -ex; \
apt-get update \
&& apt-get install -y -q --no-install-recommends \
libc6-dev \
linux-libc-dev \
libffi-dev:armhf \
&& rm -rf /var/lib/apt/lists/*
INCLUDE+ ./common/Dockerfile.gdb-deps
INCLUDE+ ./common/Dockerfile.python-builder

View File

@ -0,0 +1,12 @@
# syntax = edrevo/dockerfile-plus
ARG DOCKER_REGISTRY
ARG TOOLCHAIN_TAG
FROM ${DOCKER_REGISTRY}/esp32-toolchain-x86:${TOOLCHAIN_TAG}
ARG OPENSSL_BUILD_PLATFORM="linux-generic32"
INCLUDE+ ./common/Dockerfile.update-apt-sources
INCLUDE+ ./common/Dockerfile.gdb-deps
INCLUDE+ ./common/Dockerfile.python-builder

View File

@ -0,0 +1,12 @@
# syntax = edrevo/dockerfile-plus
ARG DOCKER_REGISTRY
ARG TOOLCHAIN_TAG
FROM ${DOCKER_REGISTRY}/esp32-toolchain:${TOOLCHAIN_TAG}
ARG OPENSSL_BUILD_PLATFORM="linux-generic64"
INCLUDE+ ./common/Dockerfile.update-apt-sources
INCLUDE+ ./common/Dockerfile.gdb-deps
INCLUDE+ ./common/Dockerfile.python-builder

View File

@ -0,0 +1,45 @@
# syntax = edrevo/dockerfile-plus
ARG DOCKER_REGISTRY
ARG TOOLCHAIN_TAG
FROM ${DOCKER_REGISTRY}/esp32-toolchain-macos-cross:${TOOLCHAIN_TAG}
# Download built python versions for linking when cross-compile
ARG PYTHON_DOWNLOAD_LINKS="https://www.python.org/ftp/python/3.8.0/python-3.8.0-macosx10.9.pkg \
https://www.python.org/ftp/python/3.8.10/python-3.8.10-macos11.pkg \
https://www.python.org/ftp/python/3.9.0/python-3.9.0-macosx10.9.pkg \
https://www.python.org/ftp/python/3.9.13/python-3.9.13-macos11.pkg \
https://www.python.org/ftp/python/3.10.0/python-3.10.0-macos11.pkg \
https://www.python.org/ftp/python/3.11.0/python-3.11.0-macos11.pkg \
https://www.python.org/ftp/python/3.12.0/python-3.12.0-macos11.pkg"
ARG TARGET_HOST="x86_64-apple-darwin14"
INCLUDE+ ./common/Dockerfile.update-apt-sources
RUN rm /bin/sh && ln -s bash /bin/sh
RUN which $TARGET_HOST-gcc || \
(set +H && \
echo -e "#!/bin/bash\n$TARGET_HOST-clang++ \"\$@\"" > /opt/osxcross/target/bin/$TARGET_HOST-g++ && \
echo -e "#!/bin/bash\n$TARGET_HOST-clang \"\$@\"" > /opt/osxcross/target/bin/$TARGET_HOST-gcc && \
chmod 755 /opt/osxcross/target/bin/$TARGET_HOST-g++ /opt/osxcross/target/bin/$TARGET_HOST-gcc)
INCLUDE+ ./common/Dockerfile.gdb-deps
RUN for LINK in $PYTHON_DOWNLOAD_LINKS; do \
export TEMP_DIR="python_unpack_dir"; \
export FILE_NAME=$(basename $LINK); \
export PYTHON_VERSION=$(basename $(dirname $LINK)); \
export PYTHON_VERSION_MINOR=${PYTHON_VERSION%.*}; \
export DEST_DIR=/opt/python-$TARGET_HOST-$PYTHON_VERSION; \
wget --no-verbose $LINK; \
mkdir $TEMP_DIR && cd $TEMP_DIR; \
xar -xf ../$FILE_NAME; \
rm -fr ../$FILE_NAME; \
cd Python_Framework.pkg && cat Payload | gzip -d | cpio -id; \
mkdir -p $DEST_DIR/lib; \
cp Versions/$PYTHON_VERSION_MINOR/lib/libpython*.dylib $DEST_DIR/lib; \
cp -r Versions/$PYTHON_VERSION_MINOR/include $DEST_DIR/; \
cd ../../ && rm -fr $TEMP_DIR; \
done;

View File

@ -0,0 +1,18 @@
# syntax = edrevo/dockerfile-plus
ARG DOCKER_REGISTRY
ARG TOOLCHAIN_TAG
# Needed to build for mingw, see
# http://lists.gnu.org/archive/html/info-gnu/2011-02/msg00020.html
ARG NCURSES_TARGET_OPTS="--enable-term-driver --enable-sp-funcs"
FROM ${DOCKER_REGISTRY}/esp32-toolchain-win-cross:${TOOLCHAIN_TAG}
ARG TARGET_HOST="i686-w64-mingw32"
ARG WIN_PLATFORM="win32"
INCLUDE+ ./common/Dockerfile.update-apt-sources
INCLUDE+ ./common/Dockerfile.gdb-deps
INCLUDE+ ./common/Dockerfile.win-python

View File

@ -0,0 +1,18 @@
# syntax = edrevo/dockerfile-plus
ARG DOCKER_REGISTRY
ARG TOOLCHAIN_TAG
# Needed to build for mingw, see
# http://lists.gnu.org/archive/html/info-gnu/2011-02/msg00020.html
ARG NCURSES_TARGET_OPTS="--enable-term-driver --enable-sp-funcs"
FROM ${DOCKER_REGISTRY}/esp32-toolchain-win64-cross:${TOOLCHAIN_TAG}
ARG TARGET_HOST="x86_64-w64-mingw32"
ARG WIN_PLATFORM="amd64"
INCLUDE+ ./common/Dockerfile.update-apt-sources
INCLUDE+ ./common/Dockerfile.gdb-deps
INCLUDE+ ./common/Dockerfile.win-python

View File

@ -0,0 +1,80 @@
ARG GMP_VERSION=6.2.1
ARG MPFR_VERSION=4.2.1
ARG MPC_VERSION=1.2.0
ARG EXPAT_VERSION=2.4.1
ARG NCURSES_VERSION=6.2
ARG NCURSES_SHA256=30306e0c76e0f9f1f0de987cf1c82a5c21e1ce6568b9227f7da5b71cbea86c9d
ARG NCURSES_TARGET_OPTS
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN apt-get -o Acquire::Check-Valid-Until=false update && apt-get install -y --force-yes \
lzip \
m4 \
jq \
&& rm -rf /var/lib/apt/lists/*
RUN if [ -z "$TARGET_HOST" ] ; then export TARGET_HOST=`gcc -dumpmachine`; fi && \
rm -fr /opt/*${TARGET_HOST}*
RUN echo "TARGET_HOST: ${TARGET_HOST:-}" && \
echo "GMP_VERSION: ${GMP_VERSION:-}" && \
if [ -z "$TARGET_HOST" ] ; then export TARGET_HOST=`gcc -dumpmachine`; fi && \
wget --no-verbose --no-check-certificate https://gmplib.org/download/gmp/gmp-$GMP_VERSION.tar.lz && \
tar --lzip -xvf gmp-$GMP_VERSION.tar.lz && \
rm gmp-$GMP_VERSION.tar.lz && \
cd gmp-$GMP_VERSION && \
./configure --enable-static --disable-shared --prefix=/opt/gmp-$TARGET_HOST --host=$TARGET_HOST && \
make && make install
RUN if [ -z "$TARGET_HOST" ] ; then export TARGET_HOST=`gcc -dumpmachine`; fi && \
wget --no-verbose --no-check-certificate https://www.mpfr.org/mpfr-current/mpfr-$MPFR_VERSION.tar.gz && \
tar xzf mpfr-$MPFR_VERSION.tar.gz && \
rm mpfr-$MPFR_VERSION.tar.gz && \
cd mpfr-$MPFR_VERSION && \
./configure --enable-static --disable-shared --with-gmp-build=$PWD/../gmp-$GMP_VERSION --prefix=/opt/mpfr-$TARGET_HOST --host=$TARGET_HOST && \
make && make install && \
cd .. && rm -fr mpfr-$MPFR_VERSION gmp-$GMP_VERSION
RUN if [ -z "$TARGET_HOST" ] ; then export TARGET_HOST=`gcc -dumpmachine`; fi && \
wget --no-verbose --no-check-certificate https://www.multiprecision.org/downloads/mpc-$MPC_VERSION.tar.gz && \
tar xzf mpc-$MPC_VERSION.tar.gz && \
rm mpc-$MPC_VERSION.tar.gz && \
cd mpc-$MPC_VERSION && \
export CFLAGS="-I/opt/gmp-$TARGET_HOST/include -I/opt/mpfr-$TARGET_HOST/include" && \
export LDFLAGS="-L/opt/gmp-$TARGET_HOST/lib -L/opt/mpfr-$TARGET_HOST/lib" && \
./configure --enable-static --disable-shared --prefix=/opt/mpc-$TARGET_HOST --host=$TARGET_HOST && \
make && make install && \
cd .. && rm -fr mpc-$MPC_VERSION
RUN if [ -z "$TARGET_HOST" ] ; then export TARGET_HOST=`gcc -dumpmachine`; fi && \
curl -LO https://github.com/libexpat/libexpat/releases/download/R_${EXPAT_VERSION//./_}/expat-$EXPAT_VERSION.tar.gz && \
tar xzf expat-$EXPAT_VERSION.tar.gz && \
rm expat-$EXPAT_VERSION.tar.gz && \
cd expat-$EXPAT_VERSION && \
./configure --enable-static --disable-shared --prefix=/opt/expat-$TARGET_HOST --host=$TARGET_HOST && \
make && make install && \
cd .. && rm -fr expat-$EXPAT_VERSION
RUN if [ -z "$TARGET_HOST" ] ; then export TARGET_HOST=`gcc -dumpmachine`; fi && \
wget --no-verbose https://ftp.gnu.org/pub/gnu/ncurses/ncurses-$NCURSES_VERSION.tar.gz && \
echo "$NCURSES_SHA256 *ncurses-$NCURSES_VERSION.tar.gz" | sha256sum --check --strict - && \
tar xzf ncurses-$NCURSES_VERSION.tar.gz && \
pushd ncurses-$NCURSES_VERSION && \
mkdir utils && \
pushd utils && \
$PWD/../configure && \
make -C include && make -C progs tic infocmp && \
export PATH=$PWD/progs:$PATH && \
popd && \
NCURSES_OPTS="--prefix=/opt/ncurses-$TARGET_HOST --host=$TARGET_HOST \
--without-progs --without-debug --enable-termcap --enable-symlinks --without-manpages \
--without-tests --without-cxx --without-cxx-binding --without-ada \
--disable-database --disable-db-install --with-abi-version=5 \
--with-fallbacks=linux,xterm,xterm-color,xterm-256color,vt100,ansi $NCURSES_TARGET_OPTS" && \
./configure $NCURSES_OPTS && \
make && make install && \
./configure $NCURSES_OPTS --enable-widec && \
make && make install && \
popd && rm -fr ncurses-$NCURSES_VERSION*

View File

@ -0,0 +1,94 @@
ARG OPENSSL_DIR="/opt/openssl"
ARG PYENV_VERSION="v2.3.36"
ARG PYTHON_VERSIONS="3.8.0 3.9.0 3.10.0 3.11.0 3.12.0"
ARG OPENSSL_VERSION="openssl-3.2.1"
# install python build dependencies
RUN apt-get -o Acquire::Check-Valid-Until=false update && apt-get install -y --force-yes \
lzip \
git \
build-essential \
libssl-dev \
zlib1g-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
wget \
curl \
llvm \
libncursesw5-dev \
xz-utils \
tk-dev \
libxml2-dev \
libxmlsec1-dev \
libffi-dev \
liblzma-dev \
$CUSTOM_PACKAGES \
&& rm -rf /var/lib/apt/lists/*
ARG HOST_TRIPLET="gcc -dumpmachine"
# install pyenv
RUN rm -fr ~/.pyenv && \
git clone -b ${PYENV_VERSION} --single-branch --depth 1 https://github.com/pyenv/pyenv.git ~/.pyenv && \
cd ~/.pyenv && \
src/configure && \
make -C src
# setup environment variables for pyenv
RUN sed -Ei -e '/^([^#]|$)/ {a \export PYENV_ROOT="$HOME/.pyenv"\nexport PATH="$PYENV_ROOT/bin:$PATH" \n' -e ':a' -e '$!{n;ba};}' ~/.profile && \
echo 'eval "$(pyenv init --path)"' >> ~/.profile && \
bash -c "echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\\n eval \"\$(pyenv init -)\"\nfi' >> ~/.bashrc"
RUN git clone -b $OPENSSL_VERSION https://github.com/openssl/openssl.git --depth=1 && \
cd openssl && \
./Configure ${OPENSSL_BUILD_PLATFORM} --prefix=${OPENSSL_DIR}-`${HOST_TRIPLET}` && \
make install_sw && make distclean && \
for TARGET_HOST in $TARGET_HOSTS; do \
./Configure ${OPENSSL_TARGET_PLATFORM} --cross-compile-prefix=${TARGET_HOST}- --prefix=${OPENSSL_DIR}-${TARGET_HOST} && \
make install_sw && make distclean; \
done && \
rm -fr openssl
# build native python3 versions using pyenv. Linking with built openssl
RUN . ~/.profile && \
export PYTHON_CONFIGURE_OPTS="--enable-shared --with-openssl=${OPENSSL_DIR}-`${HOST_TRIPLET}`" && \
export LD_LIBRARY_PATH="${OPENSSL_DIR}-`${HOST_TRIPLET}`/lib:$LIBRARY_PATH" && \
for PYTHON_VERSION in $PYTHON_VERSIONS; do \
pyenv install "$PYTHON_VERSION"; \
cp -R /root/.pyenv/versions/$PYTHON_VERSION /opt/python-`${HOST_TRIPLET}`-${PYTHON_VERSION}; \
done; \
find /root/.pyenv/versions -type f | xargs strip || true
RUN . ~/.profile && \
for TARGET_HOST in $TARGET_HOSTS; do \
export OPENSSL_CROSS_DIR="${OPENSSL_DIR}-${TARGET_HOST}" \
export CC=$TARGET_HOST-gcc && \
export CXX=$TARGET_HOST-g++ && \
export AR=$TARGET_HOST-ar && \
export RANLIB=$TARGET_HOST-ranlib && \
eval "$(pyenv init -)" && \
for PYTHON_VERSION in $PYTHON_VERSIONS; do \
unset PYTHON_EXTRA_OPTIONS; \
if [ "$(echo $PYTHON_VERSION | cut -d . -f2)" = "11" ]; then \
PYTHON_EXTRA_OPTIONS+=" --with-system-ffi"; \
fi; \
if [ "$(echo $PYTHON_VERSION | cut -d . -f2)" -ge "11" ]; then \
PYTHON_EXTRA_OPTIONS+=" --with-build-python=/opt/python-`${HOST_TRIPLET}`-${PYTHON_VERSION}/bin/python"; \
fi; \
export PYTHON_DIST_DIR=/opt/python-$TARGET_HOST-$PYTHON_VERSION; \
pyenv shell "$PYTHON_VERSION"; \
wget --no-verbose https://www.python.org/ftp/python/"$PYTHON_VERSION"/Python-"$PYTHON_VERSION".tgz; \
tar xzf Python-"$PYTHON_VERSION".tgz; \
rm Python-"$PYTHON_VERSION".tgz; \
cd Python-"$PYTHON_VERSION"; \
./configure --prefix=$PYTHON_DIST_DIR --host=$TARGET_HOST --target=$TARGET_HOST --build=`gcc -dumpmachine` --disable-ipv6 ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no ac_cv_have_long_long_format=yes --enable-shared --with-openssl=${OPENSSL_CROSS_DIR} CFLAGS="-I$OPENSSL_CROSS_DIR/include" export LDFLAGS="-L$OPENSSL_CROSS_DIR/lib" $PYTHON_EXTRA_OPTIONS; \
make HOSTPYTHON=$PYTHON_DIST_DIR HOSTPGEN=$PYTHON_DIST_DIR/Parser/pgen BLDSHARED="$TARGET_HOST-gcc -shared" CROSS-COMPILE=$TARGET_HOST- CROSS_COMPILE_TARGET=yes HOSTARCH=$TARGET_HOST BUILDARCH=$TARGET_HOST; \
make install; \
find $PYTHON_DIST_DIR -type f | xargs strip || true; \
cd ..; \
rm -fr Python-"$PYTHON_VERSION"; \
done; \
done; \
rm -fr /opt/python-${TARGET_HOST}-*/bin /opt/python-${TARGET_HOST}-*/lib/python* /opt/python-${TARGET_HOST}-*/share

View File

@ -0,0 +1,13 @@
RUN if grep -q jessie /etc/apt/sources.list; then \
find /etc/apt/ -name "*.list" -exec rm {} + && \
echo "deb http://archive.debian.org/debian/ jessie main contrib non-free" > /etc/apt/sources.list && \
echo "deb http://archive.debian.org/debian-security jessie/updates main contrib non-free" >> /etc/apt/sources.list; \
elif grep -q stretch /etc/apt/sources.list; then \
find /etc/apt/ -name "*.list" -exec rm {} + && \
echo "deb http://archive.debian.org/debian/ stretch main contrib non-free" > /etc/apt/sources.list && \
echo "deb http://archive.debian.org/debian/ stretch-proposed-updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb http://archive.debian.org/debian-security stretch/updates main contrib non-free" >> /etc/apt/sources.list; \
else \
echo "Error: /etc/apt/sources.list does not contain 'jessie' or 'stretch' or does not exist." && \
exit 1; \
fi

View File

@ -0,0 +1,30 @@
# Download built python versions for linking when cross-compile
ARG PYTHON_VERSIONS="3.8.0 3.9.0 3.10.0 3.11.0 3.12.0"
# Get pre-built libraries
RUN for PYTHON_VERSION in $PYTHON_VERSIONS; do \
export TEMP_DIR="python_unpack_dir"; \
export LINK="https://www.python.org/ftp/python/$PYTHON_VERSION/python-$PYTHON_VERSION-embed-$WIN_PLATFORM.zip"; \
export FILE_NAME=$(basename $LINK); \
export DEST_DIR=/opt/python-$TARGET_HOST-$PYTHON_VERSION; \
wget --no-verbose $LINK; \
unzip $FILE_NAME -d $TEMP_DIR && rm $FILE_NAME; \
mkdir -p $DEST_DIR/lib; \
cp -R $TEMP_DIR/* $DEST_DIR/lib; \
rm -fr $TEMP_DIR; \
done;
# Get include dir from sources
RUN for PYTHON_VERSION in $PYTHON_VERSIONS; do \
export TEMP_DIR="python_unpack_dir"; \
export LINK="https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz"; \
export FILE_NAME=$(basename $LINK); \
export DEST_DIR=/opt/python-$TARGET_HOST-$PYTHON_VERSION; \
wget --no-verbose $LINK; \
mkdir $TEMP_DIR; \
tar -xzf $FILE_NAME -C $TEMP_DIR && rm $FILE_NAME; \
mkdir -p $DEST_DIR/include; \
cp -R $TEMP_DIR/Python-$PYTHON_VERSION/Include/* $DEST_DIR/include/; \
cp -R $TEMP_DIR/Python-$PYTHON_VERSION/PC/pyconfig.h $DEST_DIR/include/; \
rm -fr $TEMP_DIR; \
done;

View File

@ -0,0 +1,27 @@
#!/bin/sh
# This script is workaround for bug https://github.com/edrevo/dockerfile-plus/issues/13
# You DO NOT need to run this script if you build only one image at a time
set -e
FILE_TO_OVERRIDE=$1
TMP_FILE="$1-copy"
echo "Overriding ${FILE_TO_OVERRIDE} to replace \"INCLUDE+\" strings with specified files content"
cp $FILE_TO_OVERRIDE $TMP_FILE
echo -n "" > ${FILE_TO_OVERRIDE}
while IFS= read -r line
do
if [ $(expr match "${line}" ".*edrevo/dockerfile-plus.*") != 0 ]; then
continue
fi
if [ $(expr match "${line}" "INCLUDE+") != 0 ]; then
cat ${line##INCLUDE+} >> ${FILE_TO_OVERRIDE}
continue
fi
echo "${line}" >> ${FILE_TO_OVERRIDE}
done < "${TMP_FILE}"
rm $TMP_FILE

View File

@ -0,0 +1,104 @@
.build_image: &build_image
stage: images
image: espressif/dind:1
tags: [ "dind", "internet", "amd64" ]
rules:
- if: $BUILD_IMAGES
- changes:
- .gitlab/docker/**/*
variables:
QEMU_IMAGE: qemu-v5.2:2-20230522
TOOLCHAIN_TAG: 4
EXTRA_BUILD_ARGS: ""
artifacts:
expire_in: 1 week
when: on_failure
paths:
- ${CI_PROJECT_DIR}/build.log
script:
- cd .gitlab/docker
# This is workaround for https://github.com/edrevo/dockerfile-plus/issues/13
# After the bug is fixed, please remove the line below.
- ./dockerfile-plus_workaround.sh ${DOCKERFILE_NAME} && cat ${DOCKERFILE_NAME}
- echo -n $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
- echo -n $DOCKER_REGISTRY_PASS | docker login -u $DOCKER_REGISTRY_USER --password-stdin $CI_DOCKER_REGISTRY
- docker pull $CI_REGISTRY_IMAGE/$IMAGE_NAME:latest || true
- docker build
--cache-from $CI_REGISTRY_IMAGE/$IMAGE_NAME:latest
--file $DOCKERFILE_NAME
--build-arg DOCKER_REGISTRY=$CI_DOCKER_REGISTRY
--build-arg TOOLCHAIN_TAG=$TOOLCHAIN_TAG
${EXTRA_BUILD_ARGS}
--tag $CI_REGISTRY_IMAGE/$IMAGE_NAME:$CI_COMMIT_SHA
--tag $CI_REGISTRY_IMAGE/$IMAGE_NAME:latest .
> ${CI_PROJECT_DIR}/build.log
- docker push $CI_REGISTRY_IMAGE/$IMAGE_NAME:$CI_COMMIT_SHA
- docker push $CI_REGISTRY_IMAGE/$IMAGE_NAME:latest
image_linux_x86:
variables:
DOCKERFILE_NAME: Dockerfile.linux-x86
IMAGE_NAME: gdb-build-linux-x86
extends: .build_image
image_linux_x86_64:
variables:
DOCKERFILE_NAME: Dockerfile.linux-x86_64
IMAGE_NAME: gdb-build-linux-x86_64
extends: .build_image
image_linux_armel:
variables:
TOOLCHAIN_TAG: 5
DOCKERFILE_NAME: Dockerfile.linux-armel
IMAGE_NAME: gdb-build-linux-armel
extends: .build_image
image_linux_armhf:
variables:
TOOLCHAIN_TAG: 5
DOCKERFILE_NAME: Dockerfile.linux-armhf
IMAGE_NAME: gdb-build-linux-armhf
extends: .build_image
image_linux_arm64:
variables:
TOOLCHAIN_TAG: 5
DOCKERFILE_NAME: Dockerfile.linux-arm64
IMAGE_NAME: gdb-build-linux-arm64
extends: .build_image
image_win_x86:
variables:
DOCKERFILE_NAME: Dockerfile.win-x86
IMAGE_NAME: gdb-build-win-x86
extends: .build_image
image_win_x86_64:
variables:
DOCKERFILE_NAME: Dockerfile.win-x86_64
IMAGE_NAME: gdb-build-win-x86_64
extends: .build_image
image_macos_x86_64:
variables:
TOOLCHAIN_TAG: 3
DOCKERFILE_NAME: Dockerfile.macos
IMAGE_NAME: gdb-build-macos-x86_64
extends: .build_image
image_macos_arm64:
variables:
TOOLCHAIN_TAG: 5
DOCKERFILE_NAME: Dockerfile.macos
IMAGE_NAME: gdb-build-macos-arm64
EXTRA_BUILD_ARGS: "--build-arg TARGET_HOST=aarch64-apple-darwin21.1"
extends: .build_image
image_dejagnu:
variables:
DOCKERFILE_NAME: Dockerfile.dejagnu
IMAGE_NAME: gdb-test-dejagnu
EXTRA_BUILD_ARGS: "--build-arg QEMU_IMAGE=$QEMU_IMAGE"
extends: .build_image

9
.gitmodules vendored Normal file
View File

@ -0,0 +1,9 @@
[submodule "esp-toolchain-bin-wrappers"]
path = esp-toolchain-bin-wrappers
url = ../esp-toolchain-bin-wrappers
[submodule "xtensa-dynconfig"]
path = xtensa-dynconfig
url = ../xtensa-dynconfig
[submodule "xtensa-overlays"]
path = xtensa-overlays
url = ../xtensa-overlays

182
build_esp_gdb.sh Executable file
View File

@ -0,0 +1,182 @@
#!/bin/bash
set -e
TARGET_HOST=$1
ESP_CHIP_ARCHITECTURE=$2
BUILD_PYTHON_VERSION=$3
GDB_DIST=$4
GDB_REPO_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
GDB_BUILD_DIR="${GDB_REPO_ROOT}/_build"
if [[ -z $TARGET_HOST || -z $BUILD_PYTHON_VERSION || -z $ESP_CHIP_ARCHITECTURE ]]; then
echo "Target host, chip arch and python version must be specified (set python version \"without_python\" to build without python), eg:"
echo " ./build_esp_gdb.sh i686-w64-mingw32 xtensa 3.6.0"
exit 1
fi
if [ -z $GDB_DIST ]; then
GDB_DIST="${GDB_REPO_ROOT}/dist"
fi
PLATFORM=
if [[ ${TARGET_HOST} == *"mingw32" ]] ; then
PLATFORM="windows"
elif [[ ${TARGET_HOST} == *"apple-darwin"* ]] ; then
PLATFORM="macos"
else # linux
PLATFORM="linux"
fi
# Prepare build configure variables
if [ $BUILD_PYTHON_VERSION != "without_python" ]; then
PYTHON_CROSS_DIR=/opt/python-$TARGET_HOST-$BUILD_PYTHON_VERSION
PYTHON_CROSS_DIR_INCLUDE=`find $PYTHON_CROSS_DIR -name Python.h | xargs -n1 dirname`
fi
PYTHON_CROSS_DIR_LIB=
PYTHON_CROSS_LINK_FLAG=
PYTHON_LIB_POINT=
PYTHON_LIB_SUFFIX=
PYTHON_LIB_PREFIX=
EXE=
if [[ ${PLATFORM} == "windows" ]] ; then
PYTHON_LIB_SUFFIX=".dll"
EXE=".exe"
elif [[ ${PLATFORM} == "macos" ]] ; then
PYTHON_LIB_POINT="."
PYTHON_LIB_SUFFIX=".dylib"
PYTHON_LIB_PREFIX="lib"
else # linux
PYTHON_LIB_POINT="."
PYTHON_LIB_SUFFIX=".so"
PYTHON_LIB_PREFIX="lib"
fi
# Clean build and dist directories
rm -fr $GDB_BUILD_DIR $GDB_DIST
#build xtensaconfig
if [ $ESP_CHIP_ARCHITECTURE == "xtensa" ]; then
# Build xtensa-config libs
pushd xtensa-dynconfig
make clean
make CC=${TARGET_HOST}-gcc CONF_DIR="${GDB_REPO_ROOT}/xtensa-overlays"
make install DESTDIR="${GDB_DIST}"
popd
fi
# build wrapper
if [[ ${PLATFORM} == "windows" ]] ; then
pushd esp-toolchain-bin-wrappers/gnu-debugger/windows
TARGET_ESP_ARCH=${ESP_CHIP_ARCHITECTURE^^} CROSS_COMPILE=$TARGET_HOST- DESTDIR=$GDB_DIST make install
popd
else # unix
if [ "${RUST_TARGET_TRIPLET:-}" != "" ]; then
pushd esp-toolchain-bin-wrappers/gnu-debugger/unix
# Can not use rust version > 1.69.0 because of https://github.com/rust-lang/rust/issues/112368
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.69.0
source "$HOME/.cargo/env"
rustup target add $RUST_TARGET_TRIPLET
cargo install --target=$RUST_TARGET_TRIPLET --config target.$RUST_TARGET_TRIPLET.linker=\"$TARGET_HOST-gcc\" --no-track --path ./ --root $GDB_DIST
popd
fi
fi
PYTHON_CONFIG_OPTS=
if [ $BUILD_PYTHON_VERSION != "without_python" ]; then
PYTHON_CROSS_LIB_PATH=$(find $PYTHON_CROSS_DIR -name ${PYTHON_LIB_PREFIX}python3${PYTHON_LIB_POINT}[0-9]*${PYTHON_LIB_SUFFIX} | head -1)
PYTHON_CROSS_LINK_FLAG=$(basename $PYTHON_CROSS_LIB_PATH)
PYTHON_CROSS_LINK_FLAG="${PYTHON_CROSS_LINK_FLAG%$PYTHON_LIB_SUFFIX}"
PYTHON_CROSS_LINK_FLAG="-l${PYTHON_CROSS_LINK_FLAG#$PYTHON_LIB_PREFIX}"
PYTHON_CROSS_DIR_LIB=$(dirname $PYTHON_CROSS_LIB_PATH)
PYTHON_LDFLAGS="-L$PYTHON_CROSS_DIR_LIB $PYTHON_CROSS_LINK_FLAG -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes"
PYTHON_CONFIG_OPTS="--with-python \
--with-python-libdir=$PYTHON_CROSS_DIR/lib \
--with-python-includes=-I$PYTHON_CROSS_DIR_INCLUDE \
--with-python-ldflags=\"$PYTHON_LDFLAGS\""
else
PYTHON_CONFIG_OPTS="--without-python"
fi
CONFIG_OPTS=" \
--host=$TARGET_HOST \
--target=${ESP_CHIP_ARCHITECTURE}-esp-elf \
--build=`gcc -dumpmachine` \
--disable-werror \
--with-expat \
--with-libexpat-prefix=/opt/expat-$TARGET_HOST \
--disable-threads \
--disable-sim \
--disable-nls \
--disable-binutils \
--disable-ld \
--disable-gas \
--disable-source-highlight \
--prefix=/ \
--with-gmp=/opt/gmp-$TARGET_HOST \
--with-libgmp-prefix=/opt/gmp-$TARGET_HOST \
--with-mpc=/opt/mpc-$TARGET_HOST \
--with-mpfr=/opt/mpfr-$TARGET_HOST \
${PYTHON_CONFIG_OPTS} \
--with-libexpat-type=static \
--with-liblzma-type=static \
--with-libgmp-type=static \
--with-static-standard-libraries \
--with-pkgversion="esp-gdb" \
--with-curses \
--enable-tui \
"
# Makes configure happy if native build
export LD_LIBRARY_PATH="$PYTHON_CROSS_DIR_LIB:$LD_LIBRARY_PATH"
# Link with static libncurses
export CFLAGS="-I/opt/ncurses-$TARGET_HOST/include"
export CXXFLAGS="-I/opt/ncurses-$TARGET_HOST/include"
export LDFLAGS="-L/opt/ncurses-$TARGET_HOST/lib"
if [[ ${PLATFORM} == "linux" ]] ; then
export CFLAGS="$CFLAGS -Wno-psabi"
export CXXFLAGS="$CXXFLAGS -Wno-psabi"
fi
mkdir $GDB_BUILD_DIR && cd $GDB_BUILD_DIR
eval "$GDB_REPO_ROOT/configure $CONFIG_OPTS"
# Build GDB
make
make install DESTDIR=$GDB_DIST
#strip binaries. Save user's disc space
${TARGET_HOST}-strip $GDB_DIST/bin/${ESP_CHIP_ARCHITECTURE}-esp-elf-gdb${EXE}
${TARGET_HOST}-strip $GDB_DIST/bin/${ESP_CHIP_ARCHITECTURE}-esp-elf-gprof${EXE}
GDB_PROGRAM_SUFFIX=
if [ $BUILD_PYTHON_VERSION == "without_python" ]; then
GDB_PROGRAM_SUFFIX="no-python"
else
GDB_PROGRAM_SUFFIX=${BUILD_PYTHON_VERSION%.*}
fi
# Change path to the libpython for macos
if [[ $BUILD_PYTHON_VERSION != "without_python" && ${PLATFORM} == "macos" ]]; then
# Python versions less than 3.8 have 'm' postfix in library name. See https://bugs.python.org/issue36707
LIB_VERSION=${BUILD_PYTHON_VERSION%.*}
LIBPOSTFIX=
if [[ $LIB_VERSION == "3.6" || $LIB_VERSION == "3.7" ]]; then
LIBPOSTFIX="m"
fi
${TARGET_HOST}-install_name_tool -change /Library/Frameworks/Python.framework/Versions/${LIB_VERSION}/Python @executable_path/../lib/libpython${LIB_VERSION}${LIBPOSTFIX}.dylib $GDB_DIST/bin/${ESP_CHIP_ARCHITECTURE}-esp-elf-gdb${EXE}
fi
# rename gdb to have python version in filename
mv $GDB_DIST/bin/${ESP_CHIP_ARCHITECTURE}-esp-elf-gdb${EXE} $GDB_DIST/bin/${ESP_CHIP_ARCHITECTURE}-esp-elf-gdb-${GDB_PROGRAM_SUFFIX}${EXE}
# rename wrapper to original gdb name
if [ $ESP_CHIP_ARCHITECTURE == "xtensa" ]; then
cp $GDB_DIST/bin/esp-elf-gdb-wrapper${EXE} $GDB_DIST/bin/${ESP_CHIP_ARCHITECTURE}-esp32-elf-gdb${EXE} 2> /dev/null || true
cp $GDB_DIST/bin/esp-elf-gdb-wrapper${EXE} $GDB_DIST/bin/${ESP_CHIP_ARCHITECTURE}-esp32s2-elf-gdb${EXE} 2> /dev/null || true
mv $GDB_DIST/bin/esp-elf-gdb-wrapper${EXE} $GDB_DIST/bin/${ESP_CHIP_ARCHITECTURE}-esp32s3-elf-gdb${EXE} 2> /dev/null || true
else
mv $GDB_DIST/bin/esp-elf-gdb-wrapper${EXE} $GDB_DIST/bin/${ESP_CHIP_ARCHITECTURE}-esp-elf-gdb${EXE} 2> /dev/null || true
fi

View File

@ -76,7 +76,7 @@ proc test {non_stop displaced always_inserted} {
} }
} }
foreach_with_prefix non_stop { "off" "on" } { foreach_with_prefix non_stop { "off" } {
foreach_with_prefix displaced_step { "off" "on" } { foreach_with_prefix displaced_step { "off" "on" } {
foreach_with_prefix always_inserted { "off" "on" } { foreach_with_prefix always_inserted { "off" "on" } {
test $non_stop $displaced_step $always_inserted test $non_stop $displaced_step $always_inserted

View File

@ -49,16 +49,17 @@ gdb_breakpoint "f22"
gdb_breakpoint "f3" gdb_breakpoint "f3"
gdb_breakpoint "f4" gdb_breakpoint "f4"
# GDB prints object address, not member value
gdb_continue_to_breakpoint "Break in f1" gdb_continue_to_breakpoint "Break in f1"
gdb_test "finish" " = {a = 123}" \ gdb_test "finish" " = {a = .*}" \
"finish from f1" "finish from f1"
gdb_continue_to_breakpoint "Break in f2" gdb_continue_to_breakpoint "Break in f2"
gdb_test "finish" " = {b = 123}" \ gdb_test "finish" " = {b = .*}" \
"finish from f2" "finish from f2"
gdb_continue_to_breakpoint "Break in f22" gdb_continue_to_breakpoint "Break in f22"
gdb_test "finish" " = {b1 = 123}" \ gdb_test "finish" " = {b1 = .*}" \
"finish from f22" "finish from f22"
gdb_continue_to_breakpoint "Break in f3" gdb_continue_to_breakpoint "Break in f3"

1
xtensa-dynconfig Submodule

Submodule xtensa-dynconfig added at 905b913aa6

1
xtensa-overlays Submodule

Submodule xtensa-overlays added at dd1cf19f6e

3
xtensaconfig/.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "config"]
path = config
url = ../xtensa-overlays.git

1
xtensaconfig/1.c Normal file
View File

@ -0,0 +1 @@
//asd

56
xtensaconfig/Makefile1 Normal file
View File

@ -0,0 +1,56 @@
#
# Libraries for configurations
#
TARGET_ESP_CHIPS = \
esp32s3 \
esp32s2 \
esp32
CROSS_COMPILE ?= ""
CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
AR = $(CROSS_COMPILE)ar
lib: $(patsubst %,xtensaconfig-%.so,$(TARGET_ESP_CHIPS))
OBJ_DIR=./obj
LIBCONFIG-GDB_SOURCES = \
src/dynconfig.c \
src/option_gdb.c
LIBCONFIG-DEFAULT_SOURCES = \
lib_config/xtensa-config.c
.PHONY: lib
RELEASE_FLAGS = -O2 -Wall -Wextra -Wpedantic -D_GNU_SOURCE
LIB_SRCS = xtensa-config.c \
config/xtensa_%/binutils/bfd/xtensa-modules.c \
config/xtensa_%/gdb/gdb/xtensa-config.c \
config/xtensa_%/gdb/gdb/xtensa-xtregs.c
INCLUDE += -Iinclude -Iconfig/xtensa_$*/binutils/include
LIB_FLAGS = -nostdlib -shared -fPIC $(RELEASE_FLAGS) $(CFLAGS)
$(OBJ_DIR)/%.o: %.c dirmake
$(CC) -c $(RELEASE_FLAGS) $(CFLAGS) $(INCLUDE) -o $@ $<
dirmake:
@mkdir -p $(OBJ_DIR)
xtensaconfig-%.so: $(LIB_SRCS)
@echo $@
@echo $^
@echo $(CFLAGS)
$(CC) $(LIB_FLAGS) $(INCLUDE) $^ -o $@
clean:
rm -fr *.so *.a $(OBJ_DIR)
install: lib
mkdir -p $(DESTDIR)$(PREFIX)/lib
cp -f *.so $(DESTDIR)$(PREFIX)/lib

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.