Skip to content

Conversation

@jhuber6
Copy link
Contributor

@jhuber6 jhuber6 commented Jan 5, 2026

Summary:
The code object version defines the ABI the HSA executables follow. This
prevents it from hard-coding it in the OpenCL libraries and preventing
users from overriding it when using them.

Summary:
The code object version defines the ABI the HSA executables follow. This
prevents it from hard-coding it in the OpenCL libraries and preventing
users from overriding it when using them.
@llvmbot llvmbot added the libclc libclc OpenCL library label Jan 5, 2026
endif()
elseif( ARCH STREQUAL amdgcn )
set( build_flags "SHELL:-Xclang -mcode-object-version=none" )
set( opt_flags -O3 )
Copy link
Contributor

Choose a reason for hiding this comment

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

The opt level probably shouldn't be coming from each target

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was just following the existing form, I could do more refactorings if you want but the libclc CMake is kind of convoluted due to the lack of using any normal CMake support.

Copy link
Contributor

@arsenm arsenm left a comment

Choose a reason for hiding this comment

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

Ideally we would be able to base this on the triple (failing total removal of the flag). It's not great to spread the clang internal flags around, but given this is an internal project anyway it's tolerable and we do it for other flags already

@jhuber6
Copy link
Contributor Author

jhuber6 commented Jan 5, 2026

Ideally we would be able to base this on the triple (failing total removal of the flag). It's not great to spread the clang internal flags around, but given this is an internal project anyway it's tolerable and we do it for other flags already

We expose -mcode-object-version=N but for there was a decision to suppress none into the compiler internals. I'm assuming that's because only internal runtime libraries are supposed to use it?

@jhuber6 jhuber6 merged commit 3f2c598 into llvm:main Jan 5, 2026
12 checks passed
mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Jan 6, 2026
…74412)

Summary:
The code object version defines the ABI the HSA executables follow. This
prevents it from hard-coding it in the OpenCL libraries and preventing
users from overriding it when using them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libclc libclc OpenCL library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants