embeded/odroid2016.10.17 23:36

크로스 컴파일은 잘만되던데.. 왜 얘는 안되나... 

include 헤더 문제일려나?


  CC      arch/arm/mach-exynos/cpu-exynos4.o

In file included from include/linux/posix_types.h:4:0,

                 from include/linux/types.h:17,

                 from include/linux/capability.h:16,

                 from include/linux/sched.h:53,

                 from arch/arm/mach-exynos/cpu-exynos4.c:11:

include/linux/stddef.h:10:16: error: expected identifier or ‘(’ before ‘void’

 #define NULL ((void *)0)

                ^

arch/arm/plat-s5p/include/plat/exynos4.h:34:24: note: in expansion of macro ‘NULL’

 #define exynos4_map_io NULL

                        ^

arch/arm/mach-exynos/cpu-exynos4.c:222:13: note: in expansion of macro ‘exynos4_map_io’

 void __init exynos4_map_io(void)

             ^

include/linux/stddef.h:10:23: error: expected ‘)’ before numeric constant

 #define NULL ((void *)0)

                       ^

arch/arm/plat-s5p/include/plat/exynos4.h:34:24: note: in expansion of macro ‘NULL’

 #define exynos4_map_io NULL

                        ^

arch/arm/mach-exynos/cpu-exynos4.c:222:13: note: in expansion of macro ‘exynos4_map_io’

 void __init exynos4_map_io(void)

             ^

include/linux/stddef.h:10:16: error: expected identifier or ‘(’ before ‘void’

 #define NULL ((void *)0)

                ^

arch/arm/plat-s5p/include/plat/exynos4.h:32:29: note: in expansion of macro ‘NULL’

 #define exynos4_init_clocks NULL

                             ^

arch/arm/mach-exynos/cpu-exynos4.c:279:13: note: in expansion of macro ‘exynos4_init_clocks’

 void __init exynos4_init_clocks(int xtal)

             ^

include/linux/stddef.h:10:23: error: expected ‘)’ before numeric constant

 #define NULL ((void *)0)

                       ^

arch/arm/plat-s5p/include/plat/exynos4.h:32:29: note: in expansion of macro ‘NULL’

 #define exynos4_init_clocks NULL

                             ^

arch/arm/mach-exynos/cpu-exynos4.c:279:13: note: in expansion of macro ‘exynos4_init_clocks’

 void __init exynos4_init_clocks(int xtal)

             ^

include/linux/stddef.h:10:16: error: expected identifier or ‘(’ before ‘void’

 #define NULL ((void *)0)

                ^

arch/arm/plat-s5p/include/plat/exynos4.h:35:22: note: in expansion of macro ‘NULL’

 #define exynos4_init NULL

                      ^

arch/arm/mach-exynos/cpu-exynos4.c:410:12: note: in expansion of macro ‘exynos4_init’

 int __init exynos4_init(void)

            ^

include/linux/stddef.h:10:23: error: expected ‘)’ before numeric constant

 #define NULL ((void *)0)

                       ^

arch/arm/plat-s5p/include/plat/exynos4.h:35:22: note: in expansion of macro ‘NULL’

 #define exynos4_init NULL

                      ^

arch/arm/mach-exynos/cpu-exynos4.c:410:12: note: in expansion of macro ‘exynos4_init’

 int __init exynos4_init(void)

            ^

arch/arm/mach-exynos/cpu-exynos4.c:49:24: warning: ‘exynos4_iodesc’ defined but not used [-Wunused-variable]

 static struct map_desc exynos4_iodesc[] __initdata = {

                        ^

arch/arm/mach-exynos/cpu-exynos4.c:148:24: warning: ‘exynos4210_iodesc’ defined but not used [-Wunused-variable]

 static struct map_desc exynos4210_iodesc[] __initdata = {

                        ^

arch/arm/mach-exynos/cpu-exynos4.c:167:24: warning: ‘exynos4210_iodesc_rev_0’ defined but not used [-Wunused-variable]

 static struct map_desc exynos4210_iodesc_rev_0[] __initdata = {

                        ^

arch/arm/mach-exynos/cpu-exynos4.c:176:24: warning: ‘exynos4210_iodesc_rev_1’ defined but not used [-Wunused-variable]

 static struct map_desc exynos4210_iodesc_rev_1[] __initdata = {

                        ^

arch/arm/mach-exynos/cpu-exynos4.c:185:24: warning: ‘exynos4212_iodesc’ defined but not used [-Wunused-variable]

 static struct map_desc exynos4212_iodesc[] __initdata = {

                        ^

arch/arm/mach-exynos/cpu-exynos4.c:209:13: warning: ‘exynos4_idle’ defined but not used [-Wunused-function]

 static void exynos4_idle(void)

             ^

arch/arm/mach-exynos/cpu-exynos4.c:335:26: warning: ‘exynos4_sysdev’ defined but not used [-Wunused-variable]

 static struct sys_device exynos4_sysdev = {

                          ^

arch/arm/mach-exynos/cpu-exynos4.c:395:13: warning: ‘exynos4_sw_reset’ defined but not used [-Wunused-function]

 static void exynos4_sw_reset(void)

             ^

arch/arm/mach-exynos/cpu-exynos4.c:405:22: warning: ‘exynos4_pmu_init_zero’ defined but not used [-Wunused-variable]

 static void __iomem *exynos4_pmu_init_zero[] = {

                      ^

make[1]: *** [arch/arm/mach-exynos/cpu-exynos4.o] Error 1

make: *** [arch/arm/mach-exynos] Error 2 


$ cat ./include/linux/stddef.h

#ifndef _LINUX_STDDEF_H

#define _LINUX_STDDEF_H


#include <linux/compiler.h>


#undef NULL

#if defined(__cplusplus)

#define NULL 0

#else

#define NULL ((void *)0)

#endif


#ifdef __KERNEL__


enum {

        false   = 0,

        true    = 1

};


#undef offsetof

#ifdef __compiler_offsetof

#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)

#else

#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)

#endif

#endif /* __KERNEL__ */


#endif 



응?

하늘별

2013-08-20 09:55

220.90.137.100

github에 있는 커널은 리눅스용으로 안드로이드를 지원하고 있지 않습니다. BSP으로 따로 배포하는 커널을 사용 하시기 바랍니다. 

[링크 : http://com.odroid.com/sigong/nf_board/nboard_view.php?brd_id=odroid-x2&kind=&bid=3359]


+

gcc -E - <<<'#include<stddef.h>' | grep stddef.h

[링크 : http://stackoverflow.com/questions/31285258/why-usr-include-linux-stddef-h-is-empty]


+

GCC is taking steps towards C++11, which is probably why you now need to include cstddef in order to use the NULL constant. The preferred way in C++11 is to use the new nullptr keyword, which is implemented in GCC since version 4.6

[링크 : http://stackoverflow.com/questions/462165/error-null-was-not-declared-in-this-scope]



+

x86용 크로스 컴파일러 옵션

$ arm-linux-gnueabihf-gcc -v

Using built-in specs.

COLLECT_GCC=arm-linux-gnueabihf-gcc

COLLECT_LTO_WRAPPER=/opt/toolchains/gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux/bin/../libexec/gcc/arm-linux-gnueabihf/4.7.3/lto-wrapper

Target: arm-linux-gnueabihf

Configured with: /cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/src/gcc-linaro-4.7-2013.04/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=arm-linux-gnueabihf --prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install --with-sysroot=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc --enable-languages=c,c++,fortran --enable-multilib --with-arch=armv7-a --with-tune=cortex-a9 --with-fpu=vfpv3-d16 --with-float=hard --with-pkgversion='crosstool-NG linaro-1.13.1-4.7-2013.04-20130415 - Linaro GCC 2013.04' --with-bugurl=https://bugs.launchpad.net/gcc-linaro --enable-__cxa_atexit --enable-libmudflap --enable-libgomp --enable-libssp --with-gmp=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-mpfr=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-mpc=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-ppl=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-cloog=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-libelf=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-host-libstdcxx='-L/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static/lib -lpwl' --enable-threads=posix --disable-libstdcxx-pch --enable-linker-build-id --enable-gold --with-local-prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc --enable-c99 --enable-long-long --with-mode=thumb

Thread model: posix

gcc version 4.7.3 20130328 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.04-20130415 - Linaro GCC 2013.04) 


ubuntu 14.04 / odroid용 컴파일러 옵션

$ gcc -v

Using built-in specs.

COLLECT_GCC=/usr/bin/gcc-4.8.real

COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.8/lto-wrapper

Target: arm-linux-gnueabihf

Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.3' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --enable-multilib --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --disable-werror --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf

Thread model: posix

gcc version 4.8.4 (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.3) 


설마.. c99 옵션 차이는 아니겠지?

찾아보니.. long-long에 가깝네..

--enable-c99

The long long type was introduced in C99, along with many other functions for wide characters, and math classification macros, etc. If enabled, all C99 functions not specified by the C++ standard will be put into namespace __gnu_cxx, and then all these names will be injected into namespace std, so that C99 functions can be used "as if" they were in the C++ standard (as they will eventually be in some future revision of the standard, without a doubt). By default, C99 support is on, assuming the configure probes find all the necessary functions and bits necessary. This option can change the library ABI. 


[링크 : https://gcc.gnu.org/onlinedocs/libstdc++/manual/configure.html]

신고

'embeded > odroid' 카테고리의 다른 글

odroid ubuntu 14.04 LTS / gcc-4.7  (0) 2016.10.19
gcc std c99와 asm  (0) 2016.10.19
odroid 커널 빌드(on odroid) 실패  (0) 2016.10.17
odroid 커널 distcc 성공?  (0) 2016.10.17
odroid UART0 ...  (0) 2016.10.16
odroid u3 uart 마지막... 희망(?)  (0) 2016.10.15
Posted by 구차니

댓글을 달아 주세요