mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mukesh Ojha <mojha@codeaurora.org>
To: masahiroy@kernel.org, lkml <linux-kernel@vger.kernel.org>
Subject: Query on header test
Date: Thu, 10 Jun 2021 19:42:20 +0530	[thread overview]
Message-ID: <96589e2f-0063-f1ec-818b-d421ac80ae7c@codeaurora.org> (raw)

Hi All,

We are facing issue while compiling kernel (5.4) in android (arm64) on 
ubuntu18 host machine
when header test is performed.
Note: there is no issue observed on ubuntu16.

And it is failing with below issue,

./usr/include/linux/videodev2.h:2323:20: error: field has incomplete 
type 'struct timespec'
         struct timespec                 timestamp;
                                         ^
./usr/include/linux/videodev2.h:2323:9: note: forward declaration of 
'struct timespec'
         struct timespec                 timestamp;
                ^
1 error generated.


where in one of the headers "include/uapi/linux/videodev2.h" is 
including "sys/time.h"
Inside include/uapi/linux/videodev2.h
#ifndef __KERNEL__
#include <sys/time.h>
#endif

and it is try to search this file in host machine in 
"usr/include/x86_64-linux-gnu/sys/time.h".
but it is failing with that as looks like ubuntu18  packaged 
x86_64-linux-gnu time.h is not
compatible while it is compatible with ubuntu16 packaged time.h has no 
issue.

Defining _GNU_SOURCE is somehow fixing the issue the somehow.
And now i am not sure whether it is maintaining as per the standard of 
header test or it somehow
violates it.

diff --git a/usr/include/Makefile b/usr/include/Makefile
index bfc7f8e..7b789f7 100644
--- a/usr/include/Makefile
+++ b/usr/include/Makefile
@@ -8,7 +8,7 @@
  # We cannot go as far as adding -Wpedantic since it emits too many 
warnings.
  UAPI_CFLAGS := -std=c90 -Wall -Werror=implicit-function-declaration

-override c_flags = $(UAPI_CFLAGS) -Wp,-MD,$(depfile) 
-I$(objtree)/usr/include
+override c_flags = $(UAPI_CFLAGS) -Wp,-MD,$(depfile) -D_GNU_SOURCE 
-I$(objtree)/usr/include

Thanks,
Mukesh


                 reply	other threads:[~2021-06-10 14:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=96589e2f-0063-f1ec-818b-d421ac80ae7c@codeaurora.org \
    --to=mojha@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®