mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-18 14:47:18 +03:00
ci: add a Linux whole-program-LTO lane (test-linux-lto)
The `tcache_fiber_migration` reproducer only exercises the bug when the allocator is statically linked and inlined under whole-program LTO. None of the existing lanes build that way, so add a dedicated Linux lane: clang ThinLTO, `--with-jemalloc-prefix=je_`, and llvm-ar/nm/ranlib (to archive the LTO bitcode) + `-fuse-ld=lld`, then `make check`. Authored in scripts/gen_gh_actions.py; .github/workflows/linux-ci.yml regenerated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c68b7b1cac
commit
1903f63aaa
2 changed files with 49 additions and 0 deletions
19
.github/workflows/linux-ci.yml
vendored
19
.github/workflows/linux-ci.yml
vendored
|
|
@ -707,4 +707,23 @@ jobs:
|
|||
make check
|
||||
|
||||
|
||||
test-linux-lto:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install clang, lld and llvm
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y clang lld llvm
|
||||
|
||||
- name: Build and test (whole-program ThinLTO, je_ prefix)
|
||||
run: |
|
||||
autoconf
|
||||
CC=clang AR=llvm-ar NM=llvm-nm RANLIB=llvm-ranlib \
|
||||
./configure --with-jemalloc-prefix=je_ EXTRA_CFLAGS=-flto=thin
|
||||
make -j3 EXTRA_LDFLAGS="-flto=thin -fuse-ld=lld"
|
||||
make -j3 tests EXTRA_LDFLAGS="-flto=thin -fuse-ld=lld"
|
||||
make check
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -694,6 +694,34 @@ def generate_freebsd_job(arch):
|
|||
return job
|
||||
|
||||
|
||||
def generate_linux_lto_job():
|
||||
"""Dedicated lane: whole-program ThinLTO + the je_ public prefix, statically
|
||||
linked. This is the configuration under which the tcache_fiber_migration
|
||||
reproducer (issue #2890) actually exercises the bug -- the allocator
|
||||
fastpath must be inlined next to the swapcontext, which only happens with
|
||||
static linking under LTO. llvm-ar/nm/ranlib are needed to archive the LTO
|
||||
bitcode; -fuse-ld=lld to link it."""
|
||||
return """ test-linux-lto:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install clang, lld and llvm
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y clang lld llvm
|
||||
|
||||
- name: Build and test (whole-program ThinLTO, je_ prefix)
|
||||
run: |
|
||||
autoconf
|
||||
CC=clang AR=llvm-ar NM=llvm-nm RANLIB=llvm-ranlib \\
|
||||
./configure --with-jemalloc-prefix=je_ EXTRA_CFLAGS=-flto=thin
|
||||
make -j3 EXTRA_LDFLAGS="-flto=thin -fuse-ld=lld"
|
||||
make -j3 tests EXTRA_LDFLAGS="-flto=thin -fuse-ld=lld"
|
||||
make check
|
||||
"""
|
||||
|
||||
|
||||
def main():
|
||||
import sys
|
||||
|
||||
|
|
@ -704,6 +732,7 @@ def main():
|
|||
jobs = '\n'.join((
|
||||
generate_linux_job(AMD64),
|
||||
generate_linux_job(ARM64),
|
||||
generate_linux_lto_job(),
|
||||
))
|
||||
print(GITHUB_ACTIONS_TEMPLATE.format(name='Linux CI', jobs=jobs))
|
||||
|
||||
|
|
@ -727,6 +756,7 @@ def main():
|
|||
linux_jobs = '\n'.join((
|
||||
generate_linux_job(AMD64),
|
||||
generate_linux_job(ARM64),
|
||||
generate_linux_lto_job(),
|
||||
))
|
||||
macos_jobs = '\n'.join((
|
||||
generate_macos_job(AMD64), # Intel
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue