Skip to contentSkip to conversation

package/optee-client: fix build warnings from 3.4.0

PATCH Superseded Etienne Carriere 2 participants 3 messages Mar 26, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v6 1/1 package/optee-client: fix build warnings from 3.4.0

Add a patch over current optee-client 3.4.0 to fix build issues reported by some toolchains with traces like:

/path/to/build/optee-client-3.4.0/libteec/src/tee_client_api.c: In function 'TEEC_InitializeContext':
/path/to/build/optee-client-3.4.0/libteec/src/tee_client_api.c:149:28: error: 'gen_caps' may be used uninitialized in this function [-Werror=maybe-uninitialized]

    ctx->reg_mem = gen_caps & TEE_GEN_CAP_REG_MEM;
                            ^
  /path/to/build/optee-client-3.4.0/libteec/src/tee_client_api.c: In function ?TEEC_OpenSession?:
  /path/to/build/optee-client-3.4.0/libteec/src/tee_client_api.c:507:8: error: cast increases required alignment of target type [-Werror=cast-align]
    arg = (struct tee_ioctl_open_session_arg *)buf;
          ^
  /path/to/build/optee-client-3.4.0/libteec/src/tee_client_api.c: In function ?TEEC_InvokeCommand?:
  /path/to/build/optee-client-3.4.0/libteec/src/tee_client_api.c:581:8: error: cast increases required alignment of target type [-Werror=cast-align]
    arg = (struct tee_ioctl_invoke_arg *)buf;

The optee-client patches have been in the OP-TEE project [1] & [2] and will be available in the OP-TEE next release planned 3.5.0.

Fixes [3], [4], [5] and other failing builds reported by autobuild tests.

[1] https://github.com/OP-TEE/optee_client/pull/146
[2] https://github.com/OP-TEE/optee_client/pull/153
[3] http://autobuild.buildroot.net/results/80e78cb0bb955e912d6cbe5b30c9b024e7efc802
[4] http://autobuild.buildroot.net/results/a42c19897d03beb02fde2e7e6da25532be27d5ca
[5] http://autobuild.buildroot.net/results/827087f91b7481d1c3effd615172bbee86317962

---
Changes v5 -> v6:
- Cleanup patches applied on optee-client: apply changes following related commits ordering in the package.

Changes v4 -> v5:
- Fix buggy content sent in v3. Apologies.

Changes v3 -> v4:
- Update patch from [2] outcome

Changes v2 -> v3:
- Update patch from [1] outcome

Changes v1 -> v2:
- Updated commit comment with traces of the build issues that are fixed.

---
 ...BUILD_STATIC_LIBS-BUILD_SHARED_LIBS.patch} |   7 +-
 .../0002-libteec-fix-build-warnings.patch     | 127 ++++++++++++++++++
 .../0003-libteec-fix-clang-build-errors.patch |  63 +++++++++
 3 files changed, 194 insertions(+), 3 deletions(-)
 rename package/optee-client/{0002-cmake-support-BUILD_STATIC_LIBS-BUILD_SHARED_LIBS.patch => 0001-cmake-support-BUILD_STATIC_LIBS-BUILD_SHARED_LIBS.patch} (92%)
 create mode 100644 package/optee-client/0002-libteec-fix-build-warnings.patch
 create mode 100644 package/optee-client/0003-libteec-fix-clang-build-errors.patch
package/optee-client/0001-cmake-support-BUILD_STATIC_LIBS-BUILD_SHARED_LIBS.patch renamed from package/optee-client/0002-cmake-support-BUILD_STATIC_LIBS-BUILD_SHARED_LIBS.patch +4 -3
similarity index 92%
rename from package/optee-client/0002-cmake-support-BUILD_STATIC_LIBS-BUILD_SHARED_LIBS.patch
rename to package/optee-client/0001-cmake-support-BUILD_STATIC_LIBS-BUILD_SHARED_LIBS.patch
index 9aea801fc7..b62357f52b 100644
@@ -1,6 +1,6 @@
-From 857ed6a900e2f16035a88e73e47d79e9251f6544 Mon Sep 17 00:00:00 2001
+From e2d82d46b33b693305978dfe64d84148314aef46 Mon Sep 17 00:00:00 2001
 From: Etienne Carriere <[email protected]>
-Date: Fri, 1 Mar 2019 12:31:48 +0100
+Date: Wed, 6 Mar 2019 11:46:07 +0100
 Subject: [PATCH] cmake: support BUILD_STATIC_LIBS/BUILD_SHARED_LIBS
 
 CMake variables BUILD_STATIC_LIBS and BUILD_SHARED_LIBS
@@ -11,6 +11,7 @@ embedded files with the expected linkage configuration.
 
 Reported-by: Thomas Petazzoni <[email protected]>
 Signed-off-by: Etienne Carriere <[email protected]>
+Acked-by: Jerome Forissier <[email protected]>
 ---
  libteec/CMakeLists.txt        | 5 +++--
  tee-supplicant/CMakeLists.txt | 2 +-
@@ -47,5 +48,5 @@ index d2d3afd..e663be9 100644
 -install (TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_SBINDIR})
 +install (TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR})
 -- 
-1.9.1
+2.17.1
 
package/optee-client/0002-libteec-fix-build-warnings.patch new file +127 -0

127 lines not on this page · raw message

package/optee-client/0003-libteec-fix-clang-build-errors.patch new file +63 -0

63 lines not on this page · raw message

Signature · 1 line
2.17.1
#1 lore raw

PATCH v6 1/1 package/optee-client: fix build warnings from 3.4.0

Hello Etienne,

Quoted 15 lines · On Tue, 26 Mar 2019 14:19:25 +0100 Etienne Carriere…

Add a patch over current optee-client 3.4.0 to fix build issues reported by some toolchains with traces like:

/path/to/build/optee-client-3.4.0/libteec/src/tee_client_api.c: In function 'TEEC_InitializeContext':
/path/to/build/optee-client-3.4.0/libteec/src/tee_client_api.c:149:28: error: 'gen_caps' may be used uninitialized in this function [-Werror=maybe-uninitialized]

    ctx->reg_mem = gen_caps & TEE_GEN_CAP_REG_MEM;
                            ^
  /path/to/build/optee-client-3.4.0/libteec/src/tee_client_api.c: In function ?TEEC_OpenSession?:
  /path/to/build/optee-client-3.4.0/libteec/src/tee_client_api.c:507:8: error: cast increases required alignment of target type [-Werror=cast-align]
    arg = (struct tee_ioctl_open_session_arg *)buf;
          ^
  /path/to/build/optee-client-3.4.0/libteec/src/tee_client_api.c: In function ?TEEC_InvokeCommand?:
  /path/to/build/optee-client-3.4.0/libteec/src/tee_client_api.c:581:8: error: cast increases required alignment of target type [-Werror=cast-align]
    arg = (struct tee_ioctl_invoke_arg *)buf;
Quoted 7 lines

The optee-client patches have been in the OP-TEE project [1] & [2] and will be available in the OP-TEE next release planned 3.5.0.

Fixes [3], [4], [5] and other failing builds reported by autobuild tests.

[1] https://github.com/OP-TEE/optee_client/pull/146
[2] https://github.com/OP-TEE/optee_client/pull/153

These links should have pointed to the commits, not the pull requests, since the patches have been merged.

package/optee-client/0002-libteec-fix-build-warnings.patch line 29

Quoted 4 lines
package/optee-client/0002-libteec-fix-build-warnings.patch new file +4 -0
+Reported-by: Thomas Petazzoni <[email protected]>
+Signed-off-by: Etienne Carriere <[email protected]>
+Tested-by: Jerome Forissier <[email protected]> (HiKey960 32, 64)
+Reviewed-by: Jens Wiklander <[email protected]>

I've added here a reference to the upstream commit.

package/optee-client/0003-libteec-fix-clang-build-errors.patch line 20

Quoted 3 lines
package/optee-client/0003-libteec-fix-clang-build-errors.patch new file +3 -0
+
+[fix conflict]
+Signed-off-by: Etienne Carriere <[email protected]>

And here as well.

Applied to master, with those changes. Thanks a lot!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH v6 1/1 package/optee-client: fix build warnings from 3.4.0

Quoted 24 lines · Thomas Petazzoni

Hello Etienne,

Quoted 18 lines · On Tue, 26 Mar 2019 14:19:25 +0100 Etienne Carriere…

Add a patch over current optee-client 3.4.0 to fix build issues reported by some toolchains with traces like:

/path/to/build/optee-client-3.4.0/libteec/src/tee_client_api.c: In function 'TEEC_InitializeContext':
/path/to/build/optee-client-3.4.0/libteec/src/tee_client_api.c:149:28: error: 'gen_caps' may be used uninitialized in this function [-Werror=maybe-uninitialized]

    ctx->reg_mem = gen_caps & TEE_GEN_CAP_REG_MEM;
                            ^
  /path/to/build/optee-client-3.4.0/libteec/src/tee_client_api.c: In function ?TEEC_OpenSession?:
  /path/to/build/optee-client-3.4.0/libteec/src/tee_client_api.c:507:8: error: cast increases required alignment of target type [-Werror=cast-align]
    arg = (struct tee_ioctl_open_session_arg *)buf;
          ^
  /path/to/build/optee-client-3.4.0/libteec/src/tee_client_api.c: In function ?TEEC_InvokeCommand?:
  /path/to/build/optee-client-3.4.0/libteec/src/tee_client_api.c:581:8: error: cast increases required alignment of target type [-Werror=cast-align]
    arg = (struct tee_ioctl_invoke_arg *)buf;

The optee-client patches have been in the OP-TEE project [1] & [2] and will be available in the OP-TEE next release planned 3.5.0.

Quoted 7 lines
Quoted 4 lines

Fixes [3], [4], [5] and other failing builds reported by autobuild tests.

[1] https://github.com/OP-TEE/optee_client/pull/146
[2] https://github.com/OP-TEE/optee_client/pull/153

These links should have pointed to the commits, not the pull requests, since the patches have been merged.

Sorry, i made half the work.
Thank for all the fixes.

regards,
etienne

Quoted 21 lines

package/optee-client/0002-libteec-fix-build-warnings.patch line 29

Quoted 5 lines
package/optee-client/0002-libteec-fix-build-warnings.patch new file +4 -0
+Reported-by: Thomas Petazzoni <[email protected]>
+Signed-off-by: Etienne Carriere <[email protected]>
+Tested-by: Jerome Forissier <[email protected]> (HiKey960 32, 64)
+Reviewed-by: Jens Wiklander <[email protected]>

I've added here a reference to the upstream commit.

package/optee-client/0003-libteec-fix-clang-build-errors.patch line 20

Quoted 3 lines
package/optee-client/0003-libteec-fix-clang-build-errors.patch new file +3 -0
+
+[fix conflict]
+Signed-off-by: Etienne Carriere <[email protected]>

And here as well.

Applied to master, with those changes. Thanks a lot!

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com