Skip to content

Conversation

@nishalkulkarni
Copy link
Contributor

Clang requires fields to have a constant size and does not support variable length array in structure causing build to to fail at compile_check()

error: fields must have a constant size: 'variable length array in structure' extension will never be supported

This change selects the compatible version of ALIGN_UP and ALIGN_DOWN macro when compiling with Clang.

While there's no official support for LLVM toolchain right now, this change should help in that direction.

Clang requires fields to have a constant size and does not
support variable length array in structure causing build to
to fail at compile_check()

This change selects the compatible version of ALIGN_UP and
ALIGN_DOWN macro when compiling with Clang.

Signed-off-by: Nishal Kulkarni <nishalkulkarni@gmail.com>
@sofci
Copy link
Collaborator

sofci commented Apr 6, 2023

Can one of the admins verify this patch?

reply test this please to run this test once

@sys-pt1s
Copy link

sys-pt1s commented Apr 6, 2023

Can one of the admins verify this patch?

@lgirdwood

This comment was marked as outdated.

@lgirdwood
Copy link
Member

test this please

@kv2019i
Copy link
Collaborator

kv2019i commented Apr 12, 2023

@wszypelt This one got stuck as well.

@lgirdwood
Copy link
Member

@wszypelt @lrudyX good to merge ?

@wszypelt
Copy link

@lgirdwood good to merge

@kv2019i
Copy link
Collaborator

kv2019i commented Apr 25, 2023

Test infra issue in https://sof-ci.01.org/sofpr/PR7411/build5584/devicetest/index.html , not blocking this PR.

@kv2019i kv2019i merged commit c8253af into thesofproject:main Apr 25, 2023
@marc-hb
Copy link
Collaborator

marc-hb commented Apr 26, 2023

Which clang version does this solve a problem with? We've been routinely using xt-clang for a while now and this has never been an issue: https://sof-ci.01.org/sofpr/PR7411/build5583/build/mtl_zph_ipc4.txt

-- The C compiler identification is Clang 10.0.1
-- The CXX compiler identification is Clang 10.0.1

@marc-hb
Copy link
Collaborator

marc-hb commented Apr 26, 2023

Oh wait, I suspect xt-clang defines BOTH __XCC__ and __clang__, that would explain why we didn't hit this issue.

@dcpleung should this be changed to ! GCC or something?

More background:

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.

8 participants