From: Nishanth Menon <nm-l0cyMroinI0@public.gmane.org>
To: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Cc: David Airlie <airlied-cv59FeDIM0c@public.gmane.org>,
linaro-dev-cunTk1MwBs8s++Sfvej+rw@public.gmane.org,
dri-devel
<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [RFC PATCH] drm.h: Fix DRM compilation with bare-metal toolchain.
Date: Tue, 16 Apr 2013 14:48:57 -0500 [thread overview]
Message-ID: <20130416194857.GA3385@kahuna> (raw)
In-Reply-To: <26789313.AOGUY9QNc3@wuerfel>
On 12:50-20130416, Arnd Bergmann wrote:
> On Tuesday 16 April 2013 12:48:28 Paul Sokolovsky wrote:
> > > diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> > > index 8d1e2bb..73a99e4 100644
> > > --- a/include/uapi/drm/drm.h
> > > +++ b/include/uapi/drm/drm.h
> > > @@ -36,7 +36,7 @@
> > > #ifndef _DRM_H_
> > > #define _DRM_H_
> > >
> > > -#if defined(__linux__)
> > > +#if defined(__KERNEL__) || defined(__linux__)
> > >
> > > #include <linux/types.h>
> > > #include <asm/ioctl.h>
>
> This is still completely bogus, the __KERNEL__ symbol has no significance here.
> Either make the compiler define __linux__, or remove this #ifdef completely.
>
Searching the v.39-rc7 tag, and greping for _linux_ a few interesting
list pops up. (pruned):
arch/arc/Makefile:cflags-y += -mA7 -fno-common -pipe -fno-builtin -D__linux__
arch/h8300/Makefile:KBUILD_CFLAGS += -D__linux__
arch/hexagon/Makefile:KBUILD_CFLAGS += -ffixed-$(TIR_NAME) -DTHREADINFO_REG=$(TIR_NAME) -D__linux__
arch/score/Makefile: -D__linux__ -ffunction-sections -ffreestanding
arch/xtensa/Makefile:KBUILD_CFLAGS += -ffreestanding -D__linux__
^^ these architectures seem to bypass the pain entirely by defining
__linux__
arch/mips/include/uapi/asm/sgidefs.h:#ifndef __linux__
drivers/gpu/drm/radeon/radeon_cp.c:#ifdef __linux__
{snip}
drivers/scsi/aic7xxx/aic7770.c:#ifdef __linux__
drivers/scsi/aic7xxx/aic79xx.h:#ifndef __linux__
{snip}
drivers/scsi/aic7xxx/aic79xx_core.c:#ifdef __linux__
{snip}
drivers/scsi/aic7xxx/aic79xx_pci.c:#ifdef __linux__
drivers/scsi/aic7xxx/aic7xxx.h:#ifndef __linux__
drivers/scsi/aic7xxx/aic7xxx.h:#ifndef __linux__
drivers/scsi/aic7xxx/aic7xxx_93cx6.c:#ifdef __linux__
drivers/scsi/aic7xxx/aic7xxx_core.c:#ifdef __linux__
{snip}
drivers/scsi/aic7xxx/aic7xxx_pci.c:#ifdef __linux__
drivers/scsi/aic7xxx/aicasm/aicasm.h:#ifdef __linux__
drivers/scsi/aic7xxx/aicasm/aicasm_gram.y:#ifdef __linux__
drivers/scsi/aic7xxx/aicasm/aicasm_macro_scan.l:#ifdef __linux__
drivers/scsi/aic7xxx/aicasm/aicasm_scan.l:#ifdef __linux__
drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c:#ifdef __linux__
drivers/scsi/aic7xxx/aicasm/aicasm_symbol.h:#ifdef __linux__
drivers/scsi/dpt/osd_defs.h:#if (defined(__linux__))
drivers/staging/ced1401/machine.h:#if (defined(__linux__) || defined(_linux) || defined(__linux)) && !defined(LINUX)
include/acpi/platform/acenv.h:#if defined(_LINUX) || defined(__linux__)
include/linux/coda.h:#if defined(__linux__)
include/uapi/drm/drm.h:#if defined(__linux__)
include/uapi/linux/coda.h:#if defined(__linux__)
include/uapi/linux/fuse.h:#ifdef __linux__
And then we have the following as well..
fs/ext4/ext4.h:#if defined(__KERNEL__) || defined(__linux__)
Trying out a few different prebuilt compilers I had around, I see:
http://pastebin.com/bTVDLTb1
So, is our approach just to use __linux__ for builds? I am trying to
understand rationale behind why #include <linux/types.h> #include <asm/ioctl.h>
would want __linux__ and why __KERNEL__ check is un-wanted.
Ofcourse, I cant comment about the "One of the BSDs" in else options..
and why we'd like to keep it around in kernel :)
--
Regards,
Nishanth Menon
next prev parent reply other threads:[~2013-04-16 19:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-12 23:28 [RFC PATCH] drm.h: Fix DRM compilation with bare-metal toolchain Nishanth Menon
2013-04-16 3:15 ` Dave Airlie
[not found] ` <1365809306-1323-1-git-send-email-nm-l0cyMroinI0@public.gmane.org>
2013-04-16 9:48 ` Paul Sokolovsky
2013-04-16 10:50 ` Arnd Bergmann
2013-04-16 19:48 ` Nishanth Menon [this message]
2013-04-17 10:43 ` Arnd Bergmann
[not found] ` <201304171243.49854.arnd-r2nGTMty4D4@public.gmane.org>
2013-04-17 11:13 ` Rob Clark
2013-04-17 10:55 ` Jon Medhurst (Tixy)
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=20130416194857.GA3385@kahuna \
--to=nm-l0cymroini0@public.gmane.org \
--cc=airlied-cv59FeDIM0c@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=linaro-dev-cunTk1MwBs8s++Sfvej+rw@public.gmane.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.