Skip to content

[SYCL] Move device library install out of lib/ and into share/#22036

Draft
sarnex wants to merge 1 commit into
intel:syclfrom
sarnex:movebc
Draft

[SYCL] Move device library install out of lib/ and into share/#22036
sarnex wants to merge 1 commit into
intel:syclfrom
sarnex:movebc

Conversation

@sarnex
Copy link
Copy Markdown
Contributor

@sarnex sarnex commented May 15, 2026

Currently, we install all libdevice files to lib/. We are trying to improve our packaging to make it easier for Linux distros to package this repo, and installing dozens of .bc files to /usr/lib breaks many repo policies. The main problems are that these filse have no use to end users or applications using SYCL, they are only needed by the SYCL compiler itself. Installing to /usr/lib/libsycl-crt.bc doesn't make sense.

This change proposes moving the files to share/, which the Linux FSH spec describes as "The /usr/share hierarchy is for all read-only architecture independent data files., which I think fits the best out of the options we have.

This change is being made only for Linux, as the file packaging is already much different for Windows, for example today we put the libdevice files in lib/ on windows but shared libraries in general (such as libsycl.dll)inbin/`, so I don't see any need to match the behavior between OSes and complicate the Driver code even more.

Note the libdevice code also generates a host static library, libsycl-devicelib-host.a, which is completely untouched by this PR.

Closes: #21512

Fallback implementation
=======================

If a device compiler does not indicate "native" support for a
Copy link
Copy Markdown
Contributor Author

@sarnex sarnex May 15, 2026

Choose a reason for hiding this comment

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

I believe the bevavior being discussed was removed in 726f8d2, so rather than updating the paths mentioned in this section to reflect the changes in the PR, I just removed the entire section as the functionality seems removed.

SmallString<128> LibName("libsycl-crt");
SmallString<128> LibName("libsycl-crt.bc");
bool IsNewOffload = D.getUseNewOffloadingDriver();
StringRef LibSuffix = TheTriple.isWindowsMSVCEnvironment()
Copy link
Copy Markdown
Contributor Author

@sarnex sarnex May 15, 2026

Choose a reason for hiding this comment

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

We don't generate or use .o/.obj files for libdevice anymore, only .bc, so I believe the existing code was out of date.

Signed-off-by: Nick Sarnie <nick.sarnie@intel.com>
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.

libsycl installed .spv/.bc/.o files flood $libdir

1 participant