Skip to content

Update HP libunwind to v1.8.0 #96969

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

Merged
merged 5 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 7 additions & 5 deletions src/native/external/libunwind-version.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
v1.7.0
https://github.com/libunwind/libunwind/commit/688caaf6ef9853cc26ad8bd1706804d48a0df0bc
v1.8.0
https://github.com/libunwind/libunwind/commit/2c2566c79c4f9cb505e6a23e4ab884d856ef88fe

Apply https://github.com/libunwind/libunwind/pull/457
Apply https://github.com/libunwind/libunwind/pull/455
Apply https://github.com/libunwind/libunwind/pull/460
Apply https://github.com/libunwind/libunwind/pull/700
Apply https://github.com/libunwind/libunwind/pull/701
Apply https://github.com/libunwind/libunwind/pull/703
Apply https://github.com/libunwind/libunwind/pull/704
Revert https://github.com/libunwind/libunwind/pull/503 # issue: https://github.com/libunwind/libunwind/issues/702
8 changes: 8 additions & 0 deletions src/native/external/libunwind.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ set(libunwind_la_SOURCES_generic
mi/Gget_fpreg.c mi/Gset_fpreg.c
mi/Gset_caching_policy.c
mi/Gset_cache_size.c
mi/Gaddress_validator.c
)

set(libunwind_la_SOURCES_os_linux
Expand Down Expand Up @@ -81,6 +82,8 @@ if(CLR_CMAKE_TARGET_LINUX)
set(libunwind_la_SOURCES_x86_64_os_local x86_64/Los-linux.c)
set(libunwind_la_SOURCES_arm_os arm/Gos-linux.c)
set(libunwind_la_SOURCES_arm_os_local arm/Los-linux.c)
set(libunwind_la_SOURCES_aarch64_os aarch64/Gos-linux.c)
set(libunwind_la_SOURCES_aarch64_os_local aarch64/Los-linux.c)
list(APPEND libunwind_coredump_la_SOURCES coredump/_UCD_access_reg_linux.c)
elseif(CLR_CMAKE_TARGET_FREEBSD)
set(libunwind_la_SOURCES_os ${libunwind_la_SOURCES_os_freebsd})
Expand All @@ -92,6 +95,8 @@ elseif(CLR_CMAKE_TARGET_FREEBSD)
set(libunwind_la_SOURCES_x86_64_os_local x86_64/Los-freebsd.c)
set(libunwind_la_SOURCES_arm_os arm/Gos-freebsd.c)
set(libunwind_la_SOURCES_arm_os_local arm/Los-freebsd.c)
set(libunwind_la_SOURCES_aarch64_os aarch64/Gos-freebsd.c)
set(libunwind_la_SOURCES_aarch64_os_local aarch64/Los-freebsd.c)
list(APPEND libunwind_coredump_la_SOURCES coredump/_UCD_access_reg_freebsd.c)
elseif(CLR_CMAKE_HOST_SUNOS)
set(libunwind_la_SOURCES_os ${libunwind_la_SOURCES_os_solaris})
Expand Down Expand Up @@ -224,6 +229,7 @@ set(libunwind_la_SOURCES_aarch64_common
# The list of files that go into libunwind:
set(libunwind_la_SOURCES_aarch64
${libunwind_la_SOURCES_aarch64_common}
${libunwind_la_SOURCES_aarch64_os_local}
${libunwind_la_SOURCES_local}
aarch64/Lapply_reg_state.c aarch64/Lreg_states_iterate.c
aarch64/Lcreate_addr_space.c aarch64/Lget_proc_info.c
Expand All @@ -234,8 +240,10 @@ set(libunwind_la_SOURCES_aarch64
aarch64/getcontext.S
)

# The list of files that go into libunwind-aarch64:
set(libunwind_aarch64_la_SOURCES_aarch64
${libunwind_la_SOURCES_aarch64_common}
${libunwind_la_SOURCES_aarch64_os}
${libunwind_la_SOURCES_generic}
aarch64/Gapply_reg_state.c aarch64/Greg_states_iterate.c
aarch64/Gcreate_addr_space.c aarch64/Gget_proc_info.c
Expand Down
126 changes: 72 additions & 54 deletions src/native/external/libunwind/.github/workflows/CI-unix.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: CI - Unix

permissions:
contents: read

on:
pull_request:
paths:
Expand All @@ -16,113 +19,128 @@ on:
- master

jobs:
build:
runs-on: ubuntu-latest
name: build-${{ join(matrix.*, ' ') }}
build-native:
runs-on: ubuntu-22.04
name: build-${{ matrix.toolchain.compiler }}-${{ matrix.target.arch }}${{ matrix.optimization.CFLAGS }}

strategy:
fail-fast: false
matrix:
HOST:
- x86_64-linux-gnu
- x86-linux-gnu
- arm-linux-gnueabihf
- aarch64-linux-gnu
- mipsel-linux-gnu
- powerpc64-linux-gnu
OPT:
- O0
- O3
target:
- { arch: i686, triple: i686-pc-linux-gnu, CFLAGS: -m32 }
- { arch: x86_64, triple: x86_64-pc-linux-gnu, CFLAGS: }
toolchain:
- { compiler: gcc, CC: gcc-12, CXX: g++-12 }
- { compiler: clang, CC: clang-13, CXX: clang++-13 }
optimization:
- { CFLAGS: -O0 }
- { CFLAGS: -O3 }
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup
if: ${{ matrix.target.arch }} = 'i686'
run: |
HOST=${{ matrix.HOST }}
if [ $HOST = 'x86-linux-gnu' ]; then
sudo apt-get update
sudo apt-get install -yqq -o=Dpkg::Use-Pty=0 g++-multilib
elif [ $HOST != 'x86_64-linux-gnu' ]; then
sudo apt-get update
sudo apt-get install -yqq -o=Dpkg::Use-Pty=0 g++-$HOST
fi
sudo apt update
sudo apt install -y g++-12-multilib

- name: Configure
run: |
set -x
HOST=${{ matrix.HOST }}
BUILD=x86_64-linux-gnu
if [ $HOST = 'x86-linux-gnu' ]; then
CFLAGS="-m32"
CXXFLAGS="-m32"
BUILD=x86-linux-gnu
fi
export CFLAGS="$CFLAGS -${{ matrix.OPT }}"
export CXXFLAGS="$CXXFLAGS -${{ matrix.OPT}}"
autoreconf -i
./configure --build=$BUILD --host=$HOST
./configure --build=x86_64-pc-linux-gnu --host=${{ matrix.target.triple }}
env:
CC: ${{ matrix.toolchain.CC }}
CXX: ${{ matrix.toolchain.CXX }}
CFLAGS: "${{ matrix.target.CFLAGS }} ${{ matrix.optimization.CFLAGS }} -Wall -Wextra"
CXXFLAGS: "${{ matrix.target.CFLAGS }} ${{ matrix.optimization.CFLAGS }} -Wall -Wextra"
LDFLAGS: ${{ matrix.target.CFLAGS }}

- name: Build
run: |
make -j8

- name: Test (native)
if: ${{ success() && (matrix.HOST == 'x86_64-linux-gnu' || matrix.HOST == 'x86-linux-gnu') }}
if: ${{ success() }}
run: |
set -x
sudo bash -c 'echo core.%p.%p > /proc/sys/kernel/core_pattern'
ulimit -c unlimited
make check -j32
make check -j8

- name: Show Logs
if: ${{ failure() }}
run: |
cat tests/test-suite.log 2>/dev/null

build-cross-qemu:
runs-on: ubuntu-latest
name: build-cross-qemu-${{ matrix.config.target }}
build-cross:
runs-on: ubuntu-22.04
name: build-cross-${{ matrix.config.target }}

strategy:
fail-fast: false
matrix:
config:
- {target: arm, toolchain: g++-arm-linux-gnueabi, host: arm-linux-gnueabi, qemu: arm }
- {target: armhf, toolchain: g++-arm-linux-gnueabihf, host: arm-linux-gnueabihf, qemu: arm }
- {target: aarch64, toolchain: g++-aarch64-linux-gnu, host: aarch64-linux-gnu, qemu: aarch64 }
- {target: riscv64, toolchain: g++-riscv64-linux-gnu, host: riscv64-linux-gnu, qemu: riscv64 }
- {target: ppc, toolchain: g++-powerpc-linux-gnu, host: powerpc-linux-gnu, qemu: ppc }
- {target: ppc64, toolchain: g++-powerpc64-linux-gnu, host: powerpc64-linux-gnu, qemu: ppc64 }
- {target: ppc64le, toolchain: g++-powerpc64le-linux-gnu, host: powerpc64le-linux-gnu, qemu: ppc64le }
- {target: s390x, toolchain: g++-s390x-linux-gnu, host: s390x-linux-gnu, qemu: s390x }
- {target: mips, toolchain: g++-mips-linux-gnu, host: mips-linux-gnu, qemu: mips }
- {target: mips64, toolchain: g++-mips64-linux-gnuabi64, host: mips64-linux-gnuabi64, qemu: mips64 }
- {target: mipsel, toolchain: g++-mipsel-linux-gnu, host: mipsel-linux-gnu, qemu: mipsel }
- {target: mips64el,toolchain: g++-mips64el-linux-gnuabi64, host: mips64el-linux-gnuabi64,qemu: mips64el }
- {target: arm, host: arm-linux-gnueabi, qemu: arm, gccver: 12 }
- {target: armhf, host: arm-linux-gnueabihf, qemu: arm, gccver: 12 }
- {target: aarch64, host: aarch64-linux-gnu, qemu: aarch64, gccver: 12 }
- {target: riscv64, host: riscv64-linux-gnu, qemu: riscv64, gccver: 12 }
- {target: ppc, host: powerpc-linux-gnu, qemu: ppc, gccver: 12 }
- {target: ppc64, host: powerpc64-linux-gnu, qemu: ppc64, gccver: 12 }
- {target: ppc64le, host: powerpc64le-linux-gnu, qemu: ppc64le, gccver: 12 }
- {target: s390x, host: s390x-linux-gnu, qemu: s390x, gccver: 12 }
- {target: mips, host: mips-linux-gnu, qemu: mips, gccver: 10 }
- {target: mips64, host: mips64-linux-gnuabi64, qemu: mips64, gccver: 10 }
- {target: mipsel, host: mipsel-linux-gnu, qemu: mipsel, gccver: 10 }
- {target: mips64el, host: mips64el-linux-gnuabi64, qemu: mips64el, gccver: 10 }

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install QEMU
# this ensure install latest qemu on ubuntu, apt get version is old
env:
QEMU_SRC: "http://archive.ubuntu.com/ubuntu/pool/universe/q/qemu"
QEMU_VER: "qemu-user-static_4\\.2-.*_amd64.deb$"
QEMU_VER: "qemu-user-static_7\\.2.*_amd64.deb$"
run: |
DEB=`curl -s $QEMU_SRC/ | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2 | grep $QEMU_VER | tail -1`
wget $QEMU_SRC/$DEB
sudo dpkg -i $DEB
- name: Install ${{ matrix.config.toolchain }}

- name: Install ${{ matrix.config.host }} Toolchain
run: |
sudo apt update
sudo apt install ${{ matrix.config.toolchain }} -y
sudo apt install g++-${{ matrix.config.gccver }}-${{ matrix.config.host }} -y

- name: Configure with ${{ matrix.config.cc }}
run: |
set -x
autoreconf -i
BUILD=x86_64-linux-gnu
./configure --build=$BUILD --host=${{ matrix.config.host }} --with-testdriver=$(pwd)/scripts/qemu-test-driver
./configure --build=$BUILD --host=${{ matrix.config.host }} --with-testdriver=$(pwd)/scripts/qemu-test-driver --enable-debug
env:
CC: ${{ matrix.config.host }}-gcc-${{ matrix.config.gccver }}
CXX: ${{ matrix.config.host }}-g++-${{ matrix.config.gccver }}

- name: Build
run: |
make -j8
env:
CFLAGS: "-Wall -Wextra"

- name: ABI Check
run: |
cd tests && ./run-check-namespace

- name: Test
run: |
set -x
sudo bash -c 'echo core.%p.%p > /proc/sys/kernel/core_pattern'
ulimit -c unlimited
CROSS_LIB="/usr/${{ matrix.config.host }}"
make -j8 check LOG_DRIVER_FLAGS="--qemu-arch ${{ matrix.config.qemu }}" LDFLAGS="-L$CROSS_LIB/lib -static" QEMU_LD_PREFIX="$CROSS_LIB"
env:
UNW_DEBUG_LEVEL: 4

- name: Show Logs
if: ${{ failure() }}
run: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: CI - Windows

permissions:
contents: read

on:
pull_request:
paths:
Expand Down Expand Up @@ -27,7 +30,7 @@ jobs:
- {toolchain: Visual Studio 17 2022, arch: x64, server: 2022, TARGET: aarch64-linux-gnu}
- {toolchain: Visual Studio 17 2022, arch: x64, server: 2022, TARGET: x86_64-linux-gnu}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build
shell: cmd
env:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "CodeQL"

on:
push:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
# Runs automatically on the twelfth of every month at 16:26
- cron: '26 16 12 * *'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: security-extended,security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Automate stale iossue tagging and closing
name: Close inactive issues
on:
schedule:
- cron: "30 1 * * *"

jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
with:
stale-issue-label: "needs info"
days-before-issue-stale: -1
days-before-issue-close: 60
close-issue-message: >
Without additional information we're not able to resolve this issue.
Feel free to add more info or respond to any questions above and we
can reopen the case. Thanks for your contribution!
days-before-pr-stale: -1
days-before-pr-close: -1
repo-token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions src/native/external/libunwind/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Makefile.in

INSTALL
aclocal.m4
m4/
autom4te.cache/
aux
config.log
Expand Down Expand Up @@ -77,7 +78,12 @@ tests/[GL]ia64-test-readonly
tests/[GL]ia64-test-stack
tests/ia64-test-dyn1
tests/ia64-test-sig
tests/ppc64-test-altivec
tests/ppc64-test-plt
tests/[GL]x64-test-dwarf-expressions
tests/x64-unwind-badjmp-signal-frame
tests/[GL]arm64-test-sve-signal
tests/aarch64-test-plt
tests/aarch64-test-frame-record
tests/*.log
tests/*.trs
2 changes: 1 addition & 1 deletion src/native/external/libunwind/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(CMAKE_C_STANDARD 11)

set(PKG_MAJOR "1")
set(PKG_MINOR "6")
set(PKG_EXTRA "-rc1")
set(PKG_EXTRA "-rc2")
set(PACKAGE_STRING "libunwind")
set(PACKAGE_BUGREPORT "")

Expand Down
9 changes: 3 additions & 6 deletions src/native/external/libunwind/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ endif BUILD_PTRACE
if BUILD_COREDUMP
include_HEADERS += include/libunwind-coredump.h
endif BUILD_COREDUMP

if BUILD_NTO
include_HEADERS += include/libunwind-nto.h
endif BUILD_NTO
if ARCH_AARCH64
include_HEADERS += include/libunwind-aarch64.h
endif
Expand All @@ -24,9 +26,6 @@ endif
if ARCH_MIPS
include_HEADERS += include/libunwind-mips.h
endif
if ARCH_TILEGX
include_HEADERS += include/libunwind-tilegx.h
endif
if ARCH_X86
include_HEADERS += include/libunwind-x86.h
endif
Expand Down Expand Up @@ -85,8 +84,6 @@ noinst_HEADERS = include/dwarf.h include/dwarf_i.h include/dwarf-eh.h \
include/tdep-hppa/jmpbuf.h include/tdep-hppa/dwarf-config.h \
include/tdep-mips/libunwind_i.h \
include/tdep-mips/jmpbuf.h include/tdep-mips/dwarf-config.h \
include/tdep-tilegx/libunwind_i.h \
include/tdep-tilegx/jmpbuf.h include/tdep-tilegx/dwarf-config.h \
include/tdep-x86/libunwind_i.h \
include/tdep-x86/jmpbuf.h include/tdep-x86/dwarf-config.h \
include/tdep-x86_64/libunwind_i.h \
Expand Down
Loading