← Back to team overview

linaro-pkg team mailing list archive

[Bug 868550] Re: __linux__ is not getting defined in android-build

 

I have this old AP from Linus (Torvalds) to make the kernel build with arm-none-*
baremetal compilers, currently there are more than a few obstacles to this:
https://lkml.org/lkml/2011/10/28/76

In this case:

-#ifdef linux
+#if defined(linux) || defined(__KERNEL__)
 #ifdef __KERNEL__
...

Which was tentatively ACK:ed by Torvalds.

-- 
You received this bug notification because you are a member of Linaro
Maintainers, which is the registrant for Linaro Linux.
https://bugs.launchpad.net/bugs/868550

Title:
  __linux__ is not getting defined in android-build

Status in Linaro Android:
  Fix Released
Status in Linaro Linux:
  New

Bug description:
  On 5 October 2011 09:03, Andy Green <andy.green@xxxxxxxxxx> wrote:
  > On 10/05/2011 09:54 PM, Somebody in the thread at some point said:
  >>
  >> On 5 October 2011 08:39, Andy Green<andy.green@xxxxxxxxxx>  wrote:
  >
  >>> #else /* One of the BSDs */
  >>>
  >>>
  >>> #include<sys/ioccom.h>
  >>>
  >>> I assume you don't mean to be building for BSD.
  >>>
  >>> It looks like the way you build the kernel is broken.
  >>
  >> Hmm... We've got:
  >>
  >>        make ARCH=arm
  >> CROSS_COMPILE=/mnt/jenkins/workspace/linaro-android_tracking-panda/build/toolchain/bin/arm-eabi-
  >> defconfig android_omap4_defconfig&&\
  >>        make ARCH=arm
  >> CROSS_COMPILE=/mnt/jenkins/workspace/linaro-android_tracking-panda/build/toolchain/bin/arm-eabi-
  >> uImage&&\
  >>        make ARCH=arm
  >> CROSS_COMPILE=/mnt/jenkins/workspace/linaro-android_tracking-panda/build/toolchain/bin/arm-eabi-
  >> modules
  >>
  >> wouldn't __linux__ be defined in the kernel build system?
  >
  > Yes, and your make lines look reasonable.
  >
  > Is this perhaps coming from broken toolchain and / or binutils then? Didn't
  > I read you are using HEAD toolchain pieces from somewhere now?
  >
  > There are several places in kernel that use code coming from BSD or designed
  > to be 'dual use' that uses __linux__ like this, and it all works fine on my
  > 4.5 stuff.  Sebjan cooks the same trees using 4.6 gcc ok... it can be
  > binutils or make issue too I guess.
  >
  > For reference my setup is
  >
  > binutils-2.20.51.0.12-2
  > gcc-4.5.1-5
  > make-3.82-6
  >
  > Your best bet, if it's true you are using avant garde toolchain, is bounce
  > it off toolchain guys, there's nothing to fix in our tree as it stands.

  Yup. We're one the latest and greatest from Linaro. Its always listed
  on the build page at:

  https://android-build.linaro.org/builds/~linaro-android/tracking-
  panda/

  I've tried both:

  build 3:

  https://android-build.linaro.org/jenkins/job/linaro-
  android_toolchain-4.6-bzr/33/artifact/build/out/android-toolchain-
  eabi-4.6-33-2011-10-03_00-11-15-linux-x86.tar.bz2

  build 4:

  https://android-build.linaro.org/jenkins/job/linaro-
  android_toolchain-4.6-2011.09/1/artifact/build/out/android-toolchain-
  eabi-linaro-4.6-2011.09-1-1-2011-09-16_16-16-01-linux-x86.tar.bz2

  (Linux/GNU Binutils) 2.21.53.0.2.20110804
  gcc version 4.6.2 20110908

  ...for make we're at Natty Narwhal at the moment.

  Bero or Ken do you guys know where __linux__ gets defined in the build
  chain?

  Is this a regression? Bero, would you mind taking a look?

  > -Andy
  >
  > --
  > Andy Green | TI Landing Team Leader
  > Linaro.org │ Open source software for ARM SoCs | Follow Linaro
  > http://facebook.com/pages/Linaro/155974581091106  -
  > http://twitter.com/#!/linaroorg - http://linaro.org/linaro-blog
  >


  -- 
  Zach Pfeffer
  Android Platform Team Lead, Linaro Platform Teams
  Linaro.org | Open source software for ARM SoCs
  Follow Linaro: http://www.facebook.com/pages/Linaro
  http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog

To manage notifications about this bug go to:
https://bugs.launchpad.net/linaro-android/+bug/868550/+subscriptions