From patchwork Fri Mar 8 08:07:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 1053398 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="zsoy3Tyw"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44G0Vs5bjJz9s47 for ; Fri, 8 Mar 2019 19:08:18 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 320DD22708; Fri, 8 Mar 2019 08:08:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bqlDMEw8KiGz; Fri, 8 Mar 2019 08:08:08 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 6C54122686; Fri, 8 Mar 2019 08:08:08 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 151261BF59D for ; Fri, 8 Mar 2019 08:08:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 1274385CD8 for ; Fri, 8 Mar 2019 08:08:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iZFEoGlrz7Ky for ; Fri, 8 Mar 2019 08:08:06 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by fraxinus.osuosl.org (Postfix) with ESMTPS id BF0C785CD0 for ; Fri, 8 Mar 2019 08:08:05 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id d17so20308433wre.10 for ; Fri, 08 Mar 2019 00:08:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NcD2k5zdWBpAeWslCZzRBHFPhUcoFabIddW4l5DF0+g=; b=zsoy3TywyjNrUWDVIU9qR9lq+0nzW6LajPkumlAj8Ck6MidX2efQ0XCVrN1ZEaNaWA /DWEUp071q8iEa3Yd1RCIhxx+qe8BgKAPXYoVSWH3hosUKWHxHsOWt+n6oqQUk+/CRtD tbyBgWFmO23VaLqgUE8MkXxxPNXPZbLwLZ9uHFAAD33tvbuJT2+TaePelVpymbPYKAol 4DezU0kXxdS59itys9TEehpChwEN7XQMGDbAHw5BLiXZSKsEq8kUxrrCpBS8j8Xl+tR+ X8YDIbryJKyIwfZ1BC+Q7DwsXcOV8FVlsKBNVxjGVekoxu3HNOVxaA5hS3hXQcqV6UtZ U9dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NcD2k5zdWBpAeWslCZzRBHFPhUcoFabIddW4l5DF0+g=; b=jbo7oGmgOGxH7LMG5ahJBgZo3akb5k3xwSZNWw1YGwtRQH8Qughmdu78o8p0q++qAO fVYKLbInSeRK2N9DkQ+Mtfk/tKn+n5BouSe/cKk13ecaXxa3C3IKqaV/LMBk+HGeX1HP oxPtsK5OWEIPBxvCL6fUFzT4Z/OAEABiQY7RVIzeldAQvmgcSf+c6gLhZ5VY8jWuPZw1 ZvSrmUy2QlT5dYtIQVK/LhsITJUbEpgx896O7TX2FwVXRLif3+t8VxJPy4XXNf93bsQA TMyM5TRYQSc6pkn1qZbg9vFvhTplJd+aDqph8ZrvgFFD5qcG5TVa/HsK0xe1Q9qCNL5t vrBQ== X-Gm-Message-State: APjAAAXoOe1DA0EYkfgwwfrxhmsqF78eUfQuaUuQKIHTgv7XnR4gYvf6 LosDcxoIYv9J8o4AoX3gV0MevCe7kR+imQ== X-Google-Smtp-Source: APXvYqy9xkZoq7ZhT0W1LEPr0KJAe/taIe3sJpqOFhG3epMXHBfZs0mSteb4rOVxtEO+2l/+zw9EMA== X-Received: by 2002:adf:e949:: with SMTP id m9mr10443467wrn.1.1552032483883; Fri, 08 Mar 2019 00:08:03 -0800 (PST) Received: from lmenx29q.lme.st.com. ([80.214.70.65]) by smtp.gmail.com with ESMTPSA id j10sm725480wrt.58.2019.03.08.00.08.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Mar 2019 00:08:03 -0800 (PST) From: Etienne Carriere To: buildroot@buildroot.org Date: Fri, 8 Mar 2019 09:07:52 +0100 Message-Id: <1552032472-10717-1-git-send-email-etienne.carriere@linaro.org> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2] package/optee-client: fix build warnings from 3.4.0 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Etienne Carriere Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" 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 patch is under review in the OP-TEE project [1] and should be merged in the next OP-TEE release 3.5.0. Fixes [2], [3], [4] and other failing builds reported by autobuild tests. [1] https://github.com/OP-TEE/optee_client/pull/146 [2] http://autobuild.buildroot.net/results/80e78cb0bb955e912d6cbe5b30c9b024e7efc802 [3] http://autobuild.buildroot.net/results/a42c19897d03beb02fde2e7e6da25532be27d5ca [4] http://autobuild.buildroot.net/results/827087f91b7481d1c3effd615172bbee86317962 Signed-off-by: Etienne Carriere --- Changes v1 -> v2: - Updated commit comment with traces of the build issues that are fixed. --- .../0001-libteec-fix-build-warnings.patch | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 package/optee-client/0001-libteec-fix-build-warnings.patch diff --git a/package/optee-client/0001-libteec-fix-build-warnings.patch b/package/optee-client/0001-libteec-fix-build-warnings.patch new file mode 100644 index 0000000..21f47ec --- /dev/null +++ b/package/optee-client/0001-libteec-fix-build-warnings.patch @@ -0,0 +1,65 @@ +From 657414ccd20b4fb2985efd83b0679964fec923c2 Mon Sep 17 00:00:00 2001 +From: Etienne Carriere +Date: Fri, 1 Mar 2019 09:36:46 +0100 +Subject: [PATCH] libteec: fix build warnings +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fix build warnings reported by the Buildroot team [1]: + +/home/thomas/projets/outputs/armv5-ctng-linux-gnueabi/build/optee-client-3.4.0/libteec/src/tee_client_api.c: In function 'TEEC_InitializeContext': +/home/thomas/projets/outputs/armv5-ctng-linux-gnueabi/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; + ^ +/home/thomas/projets/buildroot/output/build/optee-client-3.4.0/libteec/src/tee_client_api.c: In function ‘TEEC_OpenSession’: +/home/thomas/projets/buildroot/output/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; + ^ +/home/thomas/projets/buildroot/output/build/optee-client-3.4.0/libteec/src/tee_client_api.c: In function ‘TEEC_InvokeCommand’: +/home/thomas/projets/buildroot/output/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; + ^ + +[1] http://lists.busybox.net/pipermail/buildroot/2019-February/243437.html + +Reported-by: Thomas Petazzoni +Signed-off-by: Etienne Carriere +--- + libteec/src/tee_client_api.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/libteec/src/tee_client_api.c b/libteec/src/tee_client_api.c +index 698092b..a8683fd 100644 +--- a/libteec/src/tee_client_api.c ++++ b/libteec/src/tee_client_api.c +@@ -140,7 +140,7 @@ TEEC_Result TEEC_InitializeContext(const char *name, TEEC_Context *ctx) + return TEEC_ERROR_BAD_PARAMETERS; + + for (n = 0; n < TEEC_MAX_DEV_SEQ; n++) { +- uint32_t gen_caps; ++ uint32_t gen_caps = 0; + + snprintf(devname, sizeof(devname), "/dev/tee%zu", n); + fd = teec_open_dev(devname, name, &gen_caps); +@@ -504,7 +504,7 @@ TEEC_Result TEEC_OpenSession(TEEC_Context *ctx, TEEC_Session *session, + buf_data.buf_ptr = (uintptr_t)buf; + buf_data.buf_len = sizeof(buf); + +- arg = (struct tee_ioctl_open_session_arg *)buf; ++ arg = (struct tee_ioctl_open_session_arg *)(void *)buf; + arg->num_params = TEEC_CONFIG_PAYLOAD_REF_COUNT; + params = (struct tee_ioctl_param *)(arg + 1); + +@@ -578,7 +578,7 @@ TEEC_Result TEEC_InvokeCommand(TEEC_Session *session, uint32_t cmd_id, + buf_data.buf_ptr = (uintptr_t)buf; + buf_data.buf_len = sizeof(buf); + +- arg = (struct tee_ioctl_invoke_arg *)buf; ++ arg = (struct tee_ioctl_invoke_arg *)(void *)buf; + arg->num_params = TEEC_CONFIG_PAYLOAD_REF_COUNT; + params = (struct tee_ioctl_param *)(arg + 1); + +-- +1.9.1 +