Skip to content

[SYCL][Driver][Test] Apply -ccc-install-dir for sycl nordc fat archive tests. - #23635

Open
jinge90 wants to merge 2 commits into
intel:syclfrom
jinge90:replace_sysroot_for_sycl_no_rdc_fat_archive
Open

jinge90 wants to merge 2 commits into
intel:syclfrom
jinge90:replace_sysroot_for_sycl_no_rdc_fat_archive

Conversation

@jinge90

@jinge90 jinge90 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

When replacing '--sysroot' with '-ccc-install-dir' in no-rdc-fat-archive test, driver reports error that 'clang-offload-bundler' can't be found. Driver tries to launch clang-offload-bundler from the directory specified with '-ccc-install-dir' and leads to this error. We follow the approach from sycl-offload-jit-unix.cpp to create a simulated installation dir in '%t' and create symlink for clang-offload-bundler and dummy devicelib files there. For Windows target, we follow https://github.com/intel/llvm/blob/sycl/clang/test/Tooling/clang-check-mac-libcxx-fixed-compilation-db.cpp approach to copy dummy devicelibs and clang-offload-bundler tool to simulated installation dir.

test

Signed-off-by: jinge90 <ge.jin@intel.com>
@jinge90
jinge90 requested a review from a team as a code owner October 27, 2026 03:36
@jinge90
jinge90 requested a balanced review from Copilot October 27, 2026 03:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused test-only changes preserve existing assertions, with only a non-blocking comment typo remaining.

1 open issue
What changed in this PR

This PR updates SYCL no-RDC fat-archive driver tests to use simulated compiler installations for tool and device-library lookup.

Changes:

  • Replace --sysroot with -ccc-install-dir in phase-check commands.
  • Populate temporary installations with the offload bundler and dummy device libraries, using copies on Windows and symlinks for the old-model test.
  • Preserve existing phase assertions.
File Description
clang/​test/​Driver/​sycl-no-rdc-fat-archive-win.cpp Creates a temporary Windows installation and updates Clang and clang-cl invocations.
clang/​test/​Driver/​sycl-no-rdc-fat-archive-old-model.cpp Creates a symlink-based installation and updates old-driver invocations.

Review effort: Balanced

Comment thread clang/test/Driver/sycl-no-rdc-fat-archive-win.cpp Outdated
Signed-off-by: Jin <ge.jin@intel.com>
@jinge90

jinge90 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Hi, @mdtoguchi
Could you take a look at this PR?
Thanks very much.

@jinge90
jinge90 requested a review from mdtoguchi October 27, 2026 06:53
/// all dummy devicelib files.
// RUN: rm -rf %t && mkdir -p %t/bin
// RUN: ln -s %/S/Inputs/SYCL/lib %t/lib
// RUN: ln -s %llvmshlibdir/../bin/clang-offload-bundler %t/bin/clang-offload-bundler

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the bundler guaranteed to be built with a 'clang only' build?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @mdtoguchi
No, if we run "ninja clang", only following tools are built:
clang-24 clang-offload-deps clang-offload-extract clang-offload-wrapper clang-tblgen llvm-lit
llvm-min-tblgen llvm-tblgen

Previously, clang also have dependencies on clang-offload-bundler, there is a commit to remove it:

commit 326c135
Author: Chris Bieneman chris.bieneman@me.com
Date: Fri Mar 10 10:40:19 2023 -0600

[NFC] [CMake] Cleanup clang tool dependencies

None of these tools need to depend on clang to build, instead the test
target should depend on them.

This prevents rebuilding/linking these tools when building the `clang`
target directly.

Current, driver code has assumptions that clang-offload-bunder and offload-arch should be placed into D.Dir:
https://github.com/intel/llvm/blob/sycl/clang/lib/Driver/Driver.cpp#L4011

Thanks very much.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is no guarantee that clang-offload-bundler will be present with a clang only build, there should be a REQUIRES dependency so the symlink doesn't fail.

@jinge90
jinge90 requested a review from mdtoguchi October 28, 2026 09:07

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants