Hey everyone,
So I'm attempting to compile the kernel from source for the Nexus One and I'm almost there but run into this problem on "make"
$ make
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf -s arch/arm/Kconfig
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CC kernel/bounds.s
GEN include/generated/bounds.h
CC arch/arm/kernel/asm-offsets.s
GEN include/generated/asm-offsets.h
CALL scripts/checksyscalls.sh
CC scripts/mod/empty.o
HOSTCC scripts/mod/mk_elfconfig
scripts/mod/mk_elfconfig.c:4:17: error: elf.h: No such file or directory
scripts/mod/mk_elfconfig.c: In function ‘main’:
scripts/mod/mk_elfconfig.c:9: error: ‘EI_NIDENT’ undeclared (first use in this function)
scripts/mod/mk_elfconfig.c:9: error: (Each undeclared identifier is reported only once
scripts/mod/mk_elfconfig.c:9: error: for each function it appears in.)
scripts/mod/mk_elfconfig.c:16: error: ‘ELFMAG’ undeclared (first use in this function)
scripts/mod/mk_elfconfig.c:16: error: ‘SELFMAG’ undeclared (first use in this function)
scripts/mod/mk_elfconfig.c:20: error: ‘EI_CLASS’ undeclared (first use in this function)
scripts/mod/mk_elfconfig.c:21: error: ‘ELFCLASS32’ undeclared (first use in this function)
scripts/mod/mk_elfconfig.c:24: error: ‘ELFCLASS64’ undeclared (first use in this function)
scripts/mod/mk_elfconfig.c:30: error: ‘EI_DATA’ undeclared (first use in this function)
scripts/mod/mk_elfconfig.c:31: error: ‘ELFDATA2LSB’ undeclared (first use in this function)
scripts/mod/mk_elfconfig.c:34: error: ‘ELFDATA2MSB’ undeclared (first use in this function)
scripts/mod/mk_elfconfig.c:9: warning: unused variable ‘ei’
make[2]: *** [scripts/mod/mk_elfconfig] Error 1
make[1]: *** [scripts/mod] Error 2
make: *** [scripts] Error 2
Click to expand...
Click to collapse
I'm not really finding a lot of information in regards to Nexus One kernel development :-/
Edit: Solved!
This is for Mac OS X
1. I needed to reference in my $path /Android NDK directory/prebuilt/darwin-x86/toolchain/arm-eabi-4.4.0/bin instead of /linux-x86/
2. I needed to add a file: "elf.h" to /kernel repository/scripts/mod/
Data for the file here -> http://www.rockbox.org/tracker/9006?getfile=16683
3. I needed to change #include <elf.h> to #include "elf.h" in the following files in /kernel repository/scripts/mod/: mk_elfconfig.c and modpost.h
Original link that sort of helped halfway: http://comments.gmane.org/gmane.comp.handhelds.android.kernel/383
This trick still works!
I got mine from:
http://www.opensource.apple.com/source/dtrace/dtrace-90/sys/elf.h
Needed it to compile for Galaxy Nexus (maguro).
RMGeren said:
I got mine from:
http://www.opensource.apple.com/source/dtrace/dtrace-90/sys/elf.h
Needed it to compile for Galaxy Nexus (maguro).
Click to expand...
Click to collapse
when I build the francciscofranco's jb 4.1 kernel for google nexus, the OP's elf.h works fine for me.
but yours failed, got some error message like this.
Code:
scripts/mod/modpost.c:1487: error: ‘R_386_32’ undeclared (first use in this function)
scripts/mod/modpost.c:1487: error: (Each undeclared identifier is reported only once
scripts/mod/modpost.c:1487: error: for each function it appears in.)
scripts/mod/modpost.c:1490: error: ‘R_386_PC32’ undeclared (first use in this function)
Related
I can't seem to catch a break...
I haven't been able to compile anything with my build environment. For at least a few weeks. I know it should work, because I compiled a build of WD40M0D prior to all my merging of source. I'm using a MacBookPro running OS X 10.5.8
When trying to build a kernel, I get errors on "bounds.s" and "prepare0":
Code:
sean-whitleys-macbook-pro:kernel-msm wdfowty$ make ARCH=arm CROSS_COMPILE=$CCOMPILER
scripts/kconfig/conf -s arch/arm/Kconfig
CHK include/linux/version.h
UPD include/linux/version.h
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
Generating include/generated/mach-types.h
CC kernel/bounds.s
cc1: error: invalid option ‘little-endian’
cc1: error: invalid option ‘abi=aapcs-linux’
cc1: error: invalid option ‘no-thumb-interwork’
kernel/bounds.c:1: error: bad value (armv5t) for -march= switch
kernel/bounds.c:1: error: bad value (armv5t) for -mtune= switch
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2
My next error, if I skip the kernel, is in building libgps.so...It claims to not be able to find librpc.so, which to the best of my knowledge is where it's supposed to be (somewhere in the out directory).
Code:
#
/Users/wdfowty/bin/mydroid/prebuilt/darwin-x86/toolchain/arm-eabi-4.4.0/bin/../lib/gcc/arm-eabi/4.4.0/../../../../arm-eabi/bin/ld: warning: librpc.so, needed by out/target/product/passion/obj/lib/libgps.so, not found (try using -rpath or -rpath-link)
Some things I've noticed...
*Kernel error is constant across AOSP and CM source (could it be a bad .config?)
*Errors persist even after running "make clobber" or "make installclean"
I'm hoping someone can help, as I'm running on minimal knowledge and experience...Thank you in advance!
Here's the full librpc.so error on pastebin: http://pastebin.com/VBtAffE0
Hi everyone!
I'm trying to build Jellaxy kernel (https://github.com/Jellaxy/android_kernel_samsung_msm7x27/).
I've cloned the repo, and i have enetered:
Code:
make tass_cm_rev00_defconfig
make menuconfig
make -j4
However i keep having this error:
Code:
drivers/gpu/msm/kgsl_drm.c:1614:20: error: 'KGSL_GEM_CREATE' undeclared here (not in a function)
drivers/gpu/msm/kgsl_drm.c:1615:20: error: 'KGSL_GEM_PREP' undeclared here (not in a function)
drivers/gpu/msm/kgsl_drm.c:1616:20: error: 'KGSL_GEM_SETMEMTYPE' undeclared here (not in a function)
drivers/gpu/msm/kgsl_drm.c:1617:20: error: 'KGSL_GEM_GETMEMTYPE' undeclared here (not in a function)
drivers/gpu/msm/kgsl_drm.c:1618:20: error: 'KGSL_GEM_BIND_GPU' undeclared here (not in a function)
drivers/gpu/msm/kgsl_drm.c:1619:20: error: 'KGSL_GEM_UNBIND_GPU' undeclared here (not in a function)
drivers/gpu/msm/kgsl_drm.c:1620:20: error: 'KGSL_GEM_ALLOC' undeclared here (not in a function)
drivers/gpu/msm/kgsl_drm.c:1621:20: error: 'KGSL_GEM_MMAP' undeclared here (not in a function)
drivers/gpu/msm/kgsl_drm.c:1622:20: error: 'KGSL_GEM_GET_BUFINFO' undeclared here (not in a function)
drivers/gpu/msm/kgsl_drm.c:1623:20: error: 'KGSL_GEM_SET_BUFCOUNT' undeclared here (not in a function)
drivers/gpu/msm/kgsl_drm.c:1625:20: error: 'KGSL_GEM_SET_ACTIVE' undeclared here (not in a function)
drivers/gpu/msm/kgsl_drm.c:1626:20: error: 'KGSL_GEM_LOCK_HANDLE' undeclared here (not in a function)
drivers/gpu/msm/kgsl_drm.c:1628:20: error: 'KGSL_GEM_UNLOCK_HANDLE' undeclared here (not in a function)
drivers/gpu/msm/kgsl_drm.c:1630:20: error: 'KGSL_GEM_UNLOCK_ON_TS' undeclared here (not in a function)
drivers/gpu/msm/kgsl_drm.c:1632:20: error: 'KGSL_GEM_CREATE_FD' undeclared here (not in a function)
cc1: some warnings being treated as errors
Any idea what the cause is? There's absolutely nothing in google
All I can understand is in kgsl_drm.c source file, KGSL_GEM_CREATE, KGSL_GEM_PREP and other functions are not declared before/ anywhere and are being called.
Thanks for your answer.
chemicalrage said:
KGSL_GEM_CREATE, KGSL_GEM_PREP and other functions are not declared anywhere and are being called.
Click to expand...
Click to collapse
Yes, i thought the same thing but i can't understand which file i am missing!
frazar said:
Thanks for your answer.
Yes, i thought the same thing but i can't understand which file i am missing!
Click to expand...
Click to collapse
nope, you have to use the config for your device, and use the cyanogenmod one, as follows
(on the root directory of the kernel)
make cyanogenmod_<device>_defconfig
in example, Galaxy mini
make cyanogenmod_tass_defconfig
(and then compile after it setups the config)
make ARCH=arm CROSS_COMPILE=<path/to/your/compiler>
and then you will have a zImage (which is NON bootable, you need to make a boot.img with the correct partitions layout and parameters) in the arch/arm/boot directory.
Paul L. said:
make cyanogenmod_tass_defconfig
Click to expand...
Click to collapse
Thank you so much!
Hi Everyone,
I thought someone will be able to help. I'm getting those build errors when building cm11 from source. This is just at the end when building apks. Is it me or cm source?
Code:
In file included from external/chromium_org/content/common/android/hash_set.cc:5:0:
/root/cm/out/target/product/m7ul/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:10:26: error: extra tokens at end of #ifndef directive [-Werror]
/root/cm/out/target/product/m7ul/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:11:26: error: missing whitespace after the macro name [-Werror]
target thumb C++: content_content_common_gyp <= external/chromium_org/content/common/browser_rendering_stats.cc
target thumb C++: content_content_common_gyp <= external/chromium_org/content/common/cc_messages.cc
target thumb C++: content_content_common_gyp <= external/chromium_org/content/common/child_process_host_impl.cc
In file included from external/chromium_org/content/common/android/hash_set.cc:5:0:
/root/cm/out/target/product/m7ul/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:24:20: error: expected initializer before '<' token
/root/cm/out/target/product/m7ul/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:26:17: error: expected initializer before '<' token
/root/cm/out/target/product/m7ul/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:29:22: error: expected '{' before '<' token
/root/cm/out/target/product/m7ul/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:29:22: error: expected unqualified-id before '<' token
external/chromium_org/content/common/android/hash_set.cc:30:1: error: expected '}' at end of input
cc1plus: all warnings being treated as errors
make: *** [/root/cm/out/target/product/m7ul/obj/STATIC_LIBRARIES/content_content_common_gyp_intermediates/content/common/android/hash_set.o] Error 1
make: *** Waiting for unfinished jobs....
golcheck said:
Hi Everyone,
I thought someone will be able to help. I'm getting those build errors when building cm11 from source. This is just at the end when building apks. Is it me or cm source?
Code:
In file included from external/chromium_org/content/common/android/hash_set.cc:5:0:
/root/cm/out/target/product/m7ul/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:10:26: error: extra tokens at end of #ifndef directive [-Werror]
/root/cm/out/target/product/m7ul/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:11:26: error: missing whitespace after the macro name [-Werror]
target thumb C++: content_content_common_gyp <= external/chromium_org/content/common/browser_rendering_stats.cc
target thumb C++: content_content_common_gyp <= external/chromium_org/content/common/cc_messages.cc
target thumb C++: content_content_common_gyp <= external/chromium_org/content/common/child_process_host_impl.cc
In file included from external/chromium_org/content/common/android/hash_set.cc:5:0:
/root/cm/out/target/product/m7ul/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:24:20: error: expected initializer before '<' token
/root/cm/out/target/product/m7ul/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:26:17: error: expected initializer before '<' token
/root/cm/out/target/product/m7ul/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:29:22: error: expected '{' before '<' token
/root/cm/out/target/product/m7ul/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:29:22: error: expected unqualified-id before '<' token
external/chromium_org/content/common/android/hash_set.cc:30:1: error: expected '}' at end of input
cc1plus: all warnings being treated as errors
make: *** [/root/cm/out/target/product/m7ul/obj/STATIC_LIBRARIES/content_content_common_gyp_intermediates/content/common/android/hash_set.o] Error 1
make: *** Waiting for unfinished jobs....
Click to expand...
Click to collapse
Try this
http://www.playfuldroidz.com/wiki/How_to_Fix_HashSet_Issues_Building_Android
crt60 said:
Try this
http://www.playfuldroidz.com/wiki/How_to_Fix_HashSet_Issues_Building_Android
Click to expand...
Click to collapse
It was actually my fault. Was building with Java 7. Switched back to Java 6 and all good now. Thanks anyway
Build issues with openjdk-6-jdk_6b30
Hi,
just wanted to mention that I got the very same issue, introduced by a system update which also did update the jdk to 6b30. Took me some time to figure out that this was the actual issue, and it could only be resolved by switching back to 6b27 (which I had installed before)
Just in case someone comes across the same issue on Ubuntu precise, go back instantly and don't lose that much time as I did looking for the root cause somewhere else.
Interestingly, the newer raring, swarty releases are still on 6b27
Hello guys i just set up build environment for cm13 the non caf version,cant build kernel from that getting error
this is the error
HTML:
target thumb C++: libbase <= system/core/base/logging.cpp
target thumb C++: liblog <= system/core/liblog/log_time.cpp
target thumb C: liblog <= system/core/liblog/logd_write.c
target thumb C: liblog <= system/core/liblog/log_event_write.c
target thumb C: liblog <= system/core/liblog/event_tag_map.c
In file included from bionic/libc/include/stdatomic.h:156:0,
from system/core/liblog/logd_write.c:25:
bionic/libc/include/uchar.h:40:35: error: unknown type name 'char16_t'
size_t c16rtomb(char* __restrict, char16_t, mbstate_t* __restrict);
^
bionic/libc/include/uchar.h:41:35: error: unknown type name 'char32_t'
size_t c32rtomb(char* __restrict, char32_t, mbstate_t* __restrict);
^
bionic/libc/include/uchar.h:42:17: error: unknown type name 'char16_t'
size_t mbrtoc16(char16_t* __restrict,
^
bionic/libc/include/uchar.h:46:17: error: unknown type name 'char32_t'
size_t mbrtoc32(char32_t* __restrict,
^
In file included from system/core/liblog/logd_write.c:25:0:
bionic/libc/include/stdatomic.h:367:11: error: expected specifier-qualifier-list before 'char16_t'
typedef _Atomic(char16_t) atomic_char16_t;
^
bionic/libc/include/stdatomic.h:368:11: error: expected specifier-qualifier-list before 'char32_t'
typedef _Atomic(char32_t) atomic_char32_t;
^
build/core/binary.mk:816: recipe for target '/home/preshot2989/android/out/target/product/hammerhead/obj/STATIC_LIBRARIES/liblog_intermediates/logd_write.o' failed
make: *** [/home/preshot2989/android/out/target/product/hammerhead/obj/STATIC_LIBRARIES/liblog_intermediates/logd_write.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** wait: No child processes. Stop.
#### make failed to build some targets (04:45 (mm:ss)) ####
Using default toolchain for kernel GCC 4.8
Hi everyone, I'm having issues with compiling Magisk from a fresh environment. Has anyone had success building the latest Magisk, if so, what did your environment look like? Here is what I did...
Fresh Docker Ubuntu Instance
Installed Python3.7
Installed Android SDK Tools
Installed "ndk-bundle" "platform-tools" from sdkmanager
Downloaded/Extracted latest FrankeNDK
Set ANDROID_HOME to sdk path, and ANDROID_NDK_HOME to FrankeNDK path
Full clone w/submodule of Magisk Repo
Setup config.prop
python3 build.py -v binary
However this always produces the same linker error:
Code:
[armeabi-v7a] Executable : busybox
[armeabi-v7a] SharedLibrary : libsqlite.so
/root/dev/android/FrankeNDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/.[x86] SharedLibrary : libsqlite.so
./../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi-v7a/objs/sqlite/stubs/sqlite3_stub.o:1:3: invalid character
/root/dev/android/FrankeNDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi-v7a/objs/sqlite/stubs/sqlite3_stub.o:1:3: syntax error, unexpected $end
/root/dev/android/FrankeNDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi-v7a/objs/sqlite/stubs/sqlite3_stub.o: not an object or archive
collect2: error: ld returned 1 exit status
make: *** [obj/local/armeabi-v7a/libsqlite.so] Error 1
make: *** Waiting for unfinished jobs....
/root/dev/android/FrankeNDK/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: ./obj/local/x86/objs/sqlite/stubs/sqlite3_stub.o:1:3: invalid character
/root/dev/android/FrankeNDK/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: ./obj/local/x86/objs/sqlite/stubs/sqlite3_stub.o:1:3: syntax error, unexpected $end
/root/dev/android/FrankeNDK/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: ./obj/local/x86/objs/sqlite/stubs/sqlite3_stub.o: not an object or archive
collect2: error: ld returned 1 exit status
make: *** [obj/local/x86/libsqlite.so] Error 1
make: Leaving directory `/root/dev/android/Magisk/native'
Build binary failed!
I opened an issue on GitHub:1167 and TJW indicated that the linker is missing flags -flto. However, I didn't mess with anything and the default file of /native/jni/Application.mk:APP_LDFLAGS := -flto contains those flags. Is there anything else I could try to get the build to work? Thanks