Skip to content
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

[gccjit] try build with trunk #39

Closed
wants to merge 6 commits into from
Closed
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/build-gccjit-trunk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build (gccjit-trunk)
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-24.04
env:
LLVM_DIR: /usr/lib/llvm-18/cmake
steps:
- uses: actions/checkout@v4

- name: Install build tools and libraries
run: |
sudo apt-get update
sudo apt-get install -y gcc-14 g++-14 gcc-14-multilib cmake ninja-build llvm-18-dev llvm-18-tools \
libmlir-18-dev mlir-18-tools python3 python3-pip build-essential \
libmpfr-dev libmpc-dev libgmp-dev flex bison libbison-dev
pip install lit

- name: Run sccache-cache
uses: mozilla-actions/[email protected]

- name: Build GCCJIT
run: |
git clone https://github.com/gcc-mirror/gcc --single-branch -b trunk --shallow-since="Mon Dec 2 10:45:21 2024 -0700"
git checkout 4df8e6fc0cbc8358f88e81bb64b790af2a848a35
mkdir gcc-build
mkdir gcc-install
export PREFIX=$(pwd)/gcc-install
export SCCACHE_GHA_ENABLED=true
cd gcc-build
../gcc/configure CC='sccache gcc-14' CXX='sccache g++-14' \
--enable-host-shared \
--enable-languages=jit,c++ \
--disable-bootstrap \
--enable-checking=release \
--prefix=$PREFIX
make -j$(nproc)
make install
echo "GCCJIT_ROOT=$PREFIX" >> $GITHUB_ENV


- name: Build
run: |
export SCCACHE_GHA_ENABLED=true
cmake -B build -G Ninja \
-DGCCJIT_ROOT=${GCCJIT_ROOT} \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
-DCMAKE_C_COMPILER=gcc-14 \
-DCMAKE_CXX_COMPILER=g++-14 .
cmake --build build
cmake --build build --target gccjit-tools

- name: Run tests
run: |
cmake --build build --target check
3 changes: 2 additions & 1 deletion src/Translation/TranslateToGCCJIT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ gcc_jit_rvalue *RegionVisitor::visitExprWithoutCache(AlignOfOp op) {
if (resTy.getKind() != GCC_JIT_TYPE_INT)
align = gcc_jit_context_new_cast(getContext(), loc, align, resTyHandle);
return align;
#endif
#else
auto type = op.getType();
auto *typeHandle = getTranslator().convertType(type);
auto *resTyHandle = getTranslator().convertType(op.getResult().getType());
Expand All @@ -1018,6 +1018,7 @@ gcc_jit_rvalue *RegionVisitor::visitExprWithoutCache(AlignOfOp op) {
return gcc_jit_context_new_cast(getContext(), nullptr, fakeFieldAddrValue,
resTyHandle);
return fakeFieldAddrValue;
#endif
}

gcc_jit_rvalue *RegionVisitor::visitExprWithoutCache(AsRValueOp op) {
Expand Down
Loading