All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Thiery <heiko.thiery@gmail.com>
To: Michal Kubecek <mkubecek@suse.cz>, netdev@vger.kernel.org
Subject: ethtool build failure
Date: Sat, 6 Jun 2020 15:24:22 +0200	[thread overview]
Message-ID: <CAEyMn7a5SwQtMxrrJ-C0Jy6THZcCCPXp5ouC+jRLH4ySK-8p_A@mail.gmail.com> (raw)

Hi Michael et all,

I'm digging in the reason for a failure when building ethtool with
buildroot [1].

I see the following error:
---
data/buildroot/buildroot-test/instance-0/output/host/bin/i686-linux-gcc
-DHAVE_CONFIG_H -I.  -I./uapi  -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os   -static -c -o
netlink/desc-rtnl.o netlink/desc-rtnl.c
In file included from ./uapi/linux/ethtool_netlink.h:12,
                 from netlink/desc-ethtool.c:7:
./uapi/linux/ethtool.h:1294:19: warning: implicit declaration of
function '__KERNEL_DIV_ROUND_UP' [-Wimplicit-function-declaration]
  __u32 queue_mask[__KERNEL_DIV_ROUND_UP(MAX_NUM_QUEUE, 32)];
                   ^~~~~~~~~~~~~~~~~~~~~
./uapi/linux/ethtool.h:1294:8: error: variably modified 'queue_mask'
at file scope
  __u32 queue_mask[__KERNEL_DIV_ROUND_UP(MAX_NUM_QUEUE, 32)];
        ^~~~~~~~~~
---

The problems seems to be injected by the "warning: implicit
declaration of function".

When I move the __KERNEL_DIV_ROUND_UP macro right beside usage in
"uapi/linux/ethtool.h" the failure is gone.

---
diff --git a/uapi/linux/ethtool.h b/uapi/linux/ethtool.h
index d3dcb45..6710fa0 100644
--- a/uapi/linux/ethtool.h
+++ b/uapi/linux/ethtool.h
@@ -1288,6 +1288,11 @@ enum ethtool_sfeatures_retval_bits {
  * @queue_mask: Bitmap of the queues which sub command apply to
  * @data: A complete command structure following for each of the
queues addressed
  */
+/* ethtool.h epxects __KERNEL_DIV_ROUND_UP to be defined by <linux/kernel.h> */
+#include <linux/kernel.h>
+#ifndef __KERNEL_DIV_ROUND_UP
+#define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
+#endif
 struct ethtool_per_queue_op {
        __u32   cmd;
        __u32   sub_command;
---

Has anyone an idea what goes wrong?

[1] http://autobuild.buildroot.net/results/23dffe2f9766c12badb6e42bf3f0356c6df0cbfb/build-end.log

-- 
Thanks,
Heiko

             reply	other threads:[~2020-06-06 13:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-06 13:24 Heiko Thiery [this message]
2020-06-06 13:43 ` ethtool build failure Michal Kubecek
2020-06-06 13:47   ` Heiko Thiery
2020-06-06 13:51     ` Heiko Thiery

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEyMn7a5SwQtMxrrJ-C0Jy6THZcCCPXp5ouC+jRLH4ySK-8p_A@mail.gmail.com \
    --to=heiko.thiery@gmail.com \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.