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

Compile error when building xtest with musl #722

Open
jonmason opened this issue Jan 24, 2024 · 10 comments
Open

Compile error when building xtest with musl #722

jonmason opened this issue Jan 24, 2024 · 10 comments

Comments

@jonmason
Copy link
Contributor

When compiling optee_test v4.1 (in yocto) with musl, I see the following error:
| In file included from optee-test/4.1.0/recipe-sysroot/usr/include/sys/stat.h:23,
| from optee-test/4.1.0/git/host/xtest/stats.c:17:
| optee-test/4.1.0/recipe-sysroot/usr/include/bits/stat.h:17:26: error: expected identifier or '(' before '[' token
| 17 | unsigned __unused[2];
| | ^

This is similar to commit 1013c49
And similar to that commit, I was able to remove the header file in question and it compiles without issue.

@etienne-lms
Copy link
Contributor

I see that sys/stat.h is included from several source file in OP-TEE source trees:

optee_client/libteec/src/tee_client_api.c:#include <sys/stat.h>
optee_client/tee-supplicant/src/rpmb.c:#include <sys/stat.h>
optee_client/tee-supplicant/src/tee_supplicant.c:#include <sys/stat.h>
optee_client/tee-supplicant/src/prof.c:#include <sys/stat.h>
optee_client/tee-supplicant/src/tee_supp_fs.c:#include <sys/stat.h>
optee_test/host/xtest/hash_perf.c:#include <sys/stat.h>
optee_test/host/xtest/stats.c:#include <sys/stat.h>
optee_test/host/xtest/install_ta.c:#include <sys/stat.h>
optee_test/host/xtest/aes_perf.c:#include <sys/stat.h>

__unused attributes if defined from compiler.h header file exported to host applications through the OP-TEE TA devkit (export-ta_*/host_include/compiler.h). Maybe we should not export OP-TEE compiler.h into OP-TEE TA devkit.

@jenswi-linaro
Copy link
Contributor

__unused attributes if defined from compiler.h header file exported to host applications through the OP-TEE TA devkit (export-ta*/host_include/compiler.h_). Maybe we should not export OP-TEE compiler.h into OP-TEE TA devkit.

Into TA devkit is OK, but perhaps not into the host includes.

@jforissier
Copy link
Contributor

__unused attributes if defined from compiler.h header file exported to host applications through the OP-TEE TA devkit (export-ta*/host_include/compiler.h_). Maybe we should not export OP-TEE compiler.h into OP-TEE TA devkit.

Into TA devkit is OK, but perhaps not into the host includes.

+1

@etienne-lms
Copy link
Contributor

Into TA devkit is OK, but perhaps not into the host includes.

Indeed.

Note that this changes requires changes in optee_test that uses __unused, __maybe_unused and __printf(...) in the host applications implementation.

@jenswi-linaro
Copy link
Contributor

Note that this changes requires changes in optee_test that uses __unused, __maybe_unused and __printf(...) in the host applications implementation.

Agreed.

Copy link

This issue has been marked as a stale issue because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this issue will automatically be closed in 5 days. Note that you can always re-open a closed issue at any time.

@jonmason
Copy link
Contributor Author

jonmason commented May 1, 2024

We're still maintaining a patch in the meta-arm yocto layer to remove this header file (to work around the issue). Based on the comments, it seemed to be agreed that this issue needs to be addressed. Yet, the bot closed this issue (and I didn't see anything in the commit log which looks like the issue has been fixed). Can someone re-open and address this issue?

@jbech-linaro
Copy link
Contributor

@jonmason I've reopened it and added the bug and enhancement labels (prevent the bot from automatically closing it). Having said that I believe this has low or no attention here right now, people busy with other things, so don't dare to say when it'll be fixed if there is no-one outside jumping in and having a look at it.

@jforissier
Copy link
Contributor

I'll try simply removing #include <sys/stat.h> from host/xtest/stats.c, if that's enough to fix the issue, then I'll open a PR. In any case that would be a workaround.

@jforissier
Copy link
Contributor

#744

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants