[Android Q&A, Help & Troubleshooting] kaefert:
Okey. So about building this kernel from huawei. From googling a bit I learned that this error

...arch/arm/include/asm/irqflags.h:11:5: warning: "__LINUX_ARM_ARCH__" is not defined
error, forbidden warning: irqflags.h:11
make[1]: *** [arch/arm/kernel/asm-offsets.s] Fehler 1
make: *** [prepare0] Fehler 2

stems from problems with the toolchain used for building

But first let me document a bit how I got this far:

1.) download the kernel sources from:

http://www.huaweidevice.com/worldwide/technicaIndex.do?method=gotoProductSupport&productId=3834&tb=0

2.) get the kernel config from the device, by connecting it via usb, turning on the usb debugging on it and then using

adb pull /proc/config.gz

to fetch it. unpack it and put it into the same directory as the extracted kernel, but by the name ".config"

--> learned this one from http://mjanja.co.ke/2011/06/compiling-custom-kernels-on-the-huawei-u8150/

3.) Download and extract an android NDK

4.) open a terminal and set up a few environment variables:

export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=/path_where_i_extracted/android-ndk-r7b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-

5.) simply call make. I also tried to run "make menuconfig" before running make, since a few sources stated it would be neccecary, but that didn't change the error I got.

This guy here states that 7b is not good and 5c is the way to go, but this error kept the same.

http://www.android-hilfe.de/root-ha...deos-x3/172743-kernel-selbst-kompilieren.html

So I looked into ubuntu and found that there is also an arm gcc toolchain, and got it by simply installing this package:

sudo apt-get install gcc-arm-linux-gnueabi

and since the system puts its stuff all into the proper path so you can use it easily just call

export CROSS_COMPILE=arm-linux-gnueabi-

and afterwards again "make" and I got a new and different output:

CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: »include/generated/mach-types.h« ist bereits aktualisiert.
CC kernel/bounds.s
GEN include/generated/bounds.h
CC arch/arm/kernel/asm-offsets.s
In file included from include/linux/irqflags.h:15:0,
from path_to_kernel/arch/arm/include/asm/system.h:61,
from path_to_kernel/arch/arm/include/asm/bitops.h:27,
from include/linux/bitops.h:22,
from include/linux/kernel.h:17,
from include/linux/sched.h:55,
from arch/arm/kernel/asm-offsets.c:13:
path_to_kernel/arch/arm/include/asm/irqflags.h:11:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from path_to_kernel/arch/arm/include/asm/bitops.h:27:0,
from include/linux/bitops.h:22,
from include/linux/kernel.h:17,
from include/linux/sched.h:55,
from arch/arm/kernel/asm-offsets.c:13:
path_to_kernel/arch/arm/include/asm/system.h:123:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
path_to_kernel/arch/arm/include/asm/system.h:129:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
path_to_kernel/arch/arm/include/asm/system.h:130:3: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
path_to_kernel/arch/arm/include/asm/system.h:136:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
path_to_kernel/arch/arm/include/asm/system.h:140:35: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from path_to_kernel/arch/arm/include/asm/bitops.h:27:0,
from include/linux/bitops.h:22,
from include/linux/kernel.h:17,
from include/linux/sched.h:55,
from arch/arm/kernel/asm-offsets.c:13:
path_to_kernel/arch/arm/include/asm/system.h: In Funktion »__xchg«:
path_to_kernel/arch/arm/include/asm/system.h:274:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
path_to_kernel/arch/arm/include/asm/system.h:281:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from path_to_kernel/arch/arm/include/asm/bitops.h:27:0,
from include/linux/bitops.h:22,
from include/linux/kernel.h:17,
from include/linux/sched.h:55,
from arch/arm/kernel/asm-offsets.c:13:
path_to_kernel/arch/arm/include/asm/system.h: Auf höchster Ebene:
path_to_kernel/arch/arm/include/asm/system.h:351:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from include/linux/bitops.h:22:0,
from include/linux/kernel.h:17,
from include/linux/sched.h:55,
from arch/arm/kernel/asm-offsets.c:13:
path_to_kernel/arch/arm/include/asm/bitops.h:217:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from include/linux/swab.h:6:0,
from include/linux/byteorder/little_endian.h:12,
from path_to_kernel/arch/arm/include/asm/byteorder.h:21,
from include/asm-generic/bitops/le.h:5,
from path_to_kernel/arch/arm/include/asm/bitops.h:308,
from include/linux/bitops.h:22,
from include/linux/kernel.h:17,
from include/linux/sched.h:55,
from arch/arm/kernel/asm-offsets.c:13:
path_to_kernel/arch/arm/include/asm/swab.h:25:28: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from path_to_kernel/arch/arm/include/asm/thread_info.h:16:0,
from include/linux/thread_info.h:53,
from include/linux/preempt.h:9,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:29,
from include/linux/time.h:8,
from include/linux/timex.h:56,
from include/linux/sched.h:57,
from arch/arm/kernel/asm-offsets.c:13:
path_to_kernel/arch/arm/include/asm/fpstate.h:32:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from include/linux/spinlock_up.h:8:0,
from include/linux/spinlock.h:89,
from include/linux/seqlock.h:29,
from include/linux/time.h:8,
from include/linux/timex.h:56,
from include/linux/sched.h:57,
from arch/arm/kernel/asm-offsets.c:13:
path_to_kernel/arch/arm/include/asm/processor.h:88:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
path_to_kernel/arch/arm/include/asm/processor.h:108:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from include/linux/spinlock.h:387:0,
from include/linux/seqlock.h:29,
from include/linux/time.h:8,
from include/linux/timex.h:56,
from include/linux/sched.h:57,
from arch/arm/kernel/asm-offsets.c:13:
path_to_kernel/arch/arm/include/asm/atomic.h:30:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from include/linux/time.h:9:0,
from include/linux/timex.h:56,
from include/linux/sched.h:57,
from arch/arm/kernel/asm-offsets.c:13:
include/linux/math64.h: In Funktion »div_u64_rem«:
include/linux/math64.h:51:15: Fehler: »__LINUX_ARM_ARCH__« nicht deklariert (erste Benutzung in dieser Funktion)
include/linux/math64.h:51:15: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet
In file included from include/linux/mm_types.h:15:0,
from include/linux/sched.h:64,
from arch/arm/kernel/asm-offsets.c:13:
path_to_kernel/arch/arm/include/asm/page.h: Auf höchster Ebene:
path_to_kernel/arch/arm/include/asm/page.h:116:2: Fehler: #error Unknown user operations model
In file included from path_to_kernel/arch/arm/include/asm/pgtable.h:27:0,
from include/linux/mm.h:44,
from arch/arm/kernel/asm-offsets.c:14:
path_to_kernel/arch/arm/include/asm/tlbflush.h:215:2: Fehler: #error Unknown TLB model
path_to_kernel/arch/arm/include/asm/tlbflush.h:577:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from include/linux/mm.h:44:0,
from arch/arm/kernel/asm-offsets.c:14:
path_to_kernel/arch/arm/include/asm/pgtable.h:379:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from path_to_kernel/arch/arm/include/asm/cacheflush.h:15:0,
from arch/arm/kernel/asm-offsets.c:16:
path_to_kernel/arch/arm/include/asm/glue-cache.h:129:2: Fehler: #error Unknown cache maintenance model
In file included from path_to_kernel/arch/arm/include/asm/cacheflush.h:17:0,
from arch/arm/kernel/asm-offsets.c:16:
path_to_kernel/arch/arm/include/asm/cachetype.h:26:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
path_to_kernel/arch/arm/include/asm/cachetype.h:30:7: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from arch/arm/kernel/asm-offsets.c:16:0:
path_to_kernel/arch/arm/include/asm/cacheflush.h:215:7: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
path_to_kernel/arch/arm/include/asm/cacheflush.h:217:7: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from arch/arm/kernel/asm-offsets.c:17:0:
path_to_kernel/arch/arm/include/asm/glue-df.h:107:2: Fehler: #error Unknown data abort handler type
In file included from arch/arm/kernel/asm-offsets.c:18:0:
path_to_kernel/arch/arm/include/asm/glue-pf.h:54:2: Fehler: #error Unknown prefetch abort handler type
make[1]: *** [arch/arm/kernel/asm-offsets.s] Fehler 1
make: *** [prepare0] Fehler 2

But well. I also can't make a lot of meaning out of this... So still looking for help on how to get myself a kernel compiled