Openmoko Bug #2325: adventures in building Qi on Debian armel

Openmoko Public Trac bugs at docs.openmoko.org
Sat Jan 2 12:21:13 CET 2010


#2325: adventures in building Qi on Debian armel
-----------------------------+----------------------------------------------
 Reporter:  pabs             |          Owner:  openmoko-kernel
     Type:  defect           |         Status:  new            
 Priority:  normal           |      Milestone:                 
Component:  System Software  |        Version:                 
 Severity:  normal           |       Keywords:  qi             
 Haspatch:  1                |      Blockedby:                 
Estimated:                   |    Patchreview:                 
 Blocking:                   |   Reproducible:                 
-----------------------------+----------------------------------------------
 First try with a fresh checkout of master:

 {{{
 root at booph:~/devel/misc/qi (master)# make CPU=s3c6410 CROSS_PATH=
 CROSS_COMPILE= COMPILER_LIB_PATH_PRE= COMPILER_LIB_PATH=
 In file included from src/phase2.c:29:
 include/image.h:173: error: expected specifier-qualifier-list before
 'ulong'
 include/image.h:225: error: expected '=', ',', ';', 'asm' or
 '__attribute__' before 'genimg_get_image'
 include/image.h:228: error: expected declaration specifiers or '...'
 before 'ulong'
 include/image.h:228: error: expected declaration specifiers or '...'
 before 'ulong'
 include/image.h:292: error: expected '=', ',', ';', 'asm' or
 '__attribute__' before 'image_get_data'
 include/image.h:301: error: expected '=', ',', ';', 'asm' or
 '__attribute__' before 'image_get_image_end'
 include/image.h:337: error: expected declaration specifiers or '...'
 before 'ulong'
 include/image.h:340: error: expected '=', ',', ';', 'asm' or
 '__attribute__' before 'getenv_bootm_low'
 include/image.h:341: error: expected '=', ',', ';', 'asm' or
 '__attribute__' before 'getenv_bootm_size'
 include/image.h:342: error: expected declaration specifiers or '...'
 before 'ulong'
 include/image.h:362: error: expected '=', ',', ';', 'asm' or
 '__attribute__' before 'image_multi_count'
 include/image.h:363: error: expected declaration specifiers or '...'
 before 'ulong'
 include/image.h:364: error: expected declaration specifiers or '...'
 before 'ulong'
 include/image.h:364: error: expected declaration specifiers or '...'
 before 'ulong'
 src/phase2.c:34: error: expected declaration specifiers or '...' before
 'uint'
 src/phase2.c: In function 'try_this_kernel':
 src/phase2.c:457: error: too many arguments to function 'the_kernel'
 make: *** [src/phase2.o] Error 1
 }}}

 Ok, lets add ulong/uint/ushort manually to qi.h and rebuild...

 {{{
 root at booph:~/devel/misc/qi (master)# make CPU=s3c6410 CROSS_PATH=
 CROSS_COMPILE= COMPILER_LIB_PATH_PRE= COMPILER_LIB_PATH=
 cc1: warnings being treated as errors
 src/drivers/glamo-mmc.c: In function 'mmc_cmd':
 src/drivers/glamo-mmc.c:188: error: suggest parentheses around operand of
 '!' or change '&' to '&&' or '!' to '~'
 make: *** [src/drivers/glamo-mmc.o] Error 1
 }}}

 Ok, lets remove -Werror from the Makefile, that is never a good idea due
 to compilers getting stricter over time.

 {{{
 root at booph:~/devel/misc/qi (master)# make CPU=s3c6410 CROSS_PATH=
 CROSS_COMPILE= COMPILER_LIB_PATH_PRE= COMPILER_LIB_PATH=
 src/drivers/glamo-mmc.c: In function 'mmc_cmd':
 src/drivers/glamo-mmc.c:188: warning: suggest parentheses around operand
 of '!' or change '&' to '&&' or '!' to '~'
 make -C tools
 make[1]: Entering directory `/home/root/devel/misc/qi/tools'
 gcc -Wall    mkudfu.c   -o mkudfu
 make[1]: Leaving directory `/home/root/devel/misc/qi/tools'
 mkdir -p image
 src/fs/ext2.o: In function `ext2fs_read_inode':
 /home/root/devel/misc/qi/src/fs/ext2.c:235: undefined reference to
 `__aeabi_uidiv'
 /home/root/devel/misc/qi/src/fs/ext2.c:235: undefined reference to
 `__aeabi_uidivmod'
 src/fs/ext2.o: In function `ext2fs_read_file':
 /home/root/devel/misc/qi/src/fs/ext2.c:490: undefined reference to
 `__aeabi_uidiv'
 /home/root/devel/misc/qi/src/fs/ext2.c:490: undefined reference to
 `__aeabi_idiv'
 /home/root/devel/misc/qi/src/fs/ext2.c:490: undefined reference to
 `__aeabi_uidivmod'
 /home/root/devel/misc/qi/src/fs/ext2.c:490: undefined reference to
 `__aeabi_idivmod'
 make: *** [image/qi-s3c6410-master_36bb5c03756268ff.udfu] Error 1
 }}}

 Hmm, intarwebs say we need libgcc, which is installed:

 {{{
 root at booph:~/devel/misc/qi (master)# ls -l /usr/lib/gcc/*/*/libgcc.a
 -rw-r--r-- 1 root root 139K Nov  5 15:21 /usr/lib/gcc/arm-linux-
 gnueabi/4.3.4/libgcc.a
 -rw-r--r-- 1 root root 139K Nov  5 15:21 /usr/lib/gcc/arm-linux-
 gnueabi/4.3/libgcc.a
 -rw-r--r-- 1 root root 156K Dec 16 23:11 /usr/lib/gcc/arm-linux-
 gnueabi/4.4.2/libgcc.a
 -rw-r--r-- 1 root root 156K Dec 16 23:11 /usr/lib/gcc/arm-linux-
 gnueabi/4.4.3/libgcc.a
 -rw-r--r-- 1 root root 156K Dec 16 23:11 /usr/lib/gcc/arm-linux-
 gnueabi/4.4/libgcc.a
 root at booph:~/devel/misc/qi (master)# gcc --version
 gcc (Debian 4.4.2-5) 4.4.2
 Copyright (C) 2009 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
 PURPOSE.

 }}}

 Aha, we need the right dir in COMPILER_LIB_PATH...

 {{{
 # make CPU=s3c6410 CROSS_PATH= CROSS_COMPILE= COMPILER_LIB_PATH_PRE=
 COMPILER_LIB_PATH=/usr/lib/gcc/arm-linux-gnueabi/4.4/mkdir -p image
 ===> DFU Trailer information:
 Trailer Vers.:  1
 Trailer Length: 16
 VendorID:       0x1d50
 ProductID:      0x5119
 HW Revision:    0x0350
 }}}

 Now lets try the next CPU:

 {{{
 root at booph:~/devel/misc/qi (master)# make clean && make CPU=s3c2442
 CROSS_PATH= CROSS_COMPILE= COMPILER_LIB_PATH_PRE=
 COMPILER_LIB_PATH=/usr/lib/gcc/arm-linux-gnueabi/4.4/
 make[1]: Entering directory `/home/root/devel/misc/qi/tools'
 make[1]: Leaving directory `/home/root/devel/misc/qi/tools'
 src/drivers/glamo-mmc.c: In function 'mmc_cmd':
 src/drivers/glamo-mmc.c:188: warning: suggest parentheses around operand
 of '!' or change '&' to '&&' or '!' to '~'
 src/cpu/s3c2442/s3c24xx-mci.c:362: error: expected '=', ',', ';', 'asm' or
 '__attribute__' before 'rca'
 src/cpu/s3c2442/s3c24xx-mci.c: In function 's3c24xx_mmc_init':
 src/cpu/s3c2442/s3c24xx-mci.c:539: error: 'rca' undeclared (first use in
 this function)
 src/cpu/s3c2442/s3c24xx-mci.c:539: error: (Each undeclared identifier is
 reported only once
 src/cpu/s3c2442/s3c24xx-mci.c:539: error: for each function it appears
 in.)
 make: *** [src/cpu/s3c2442/s3c24xx-mci.o] Error 1
 }}}

 Hmm, time to define u_int*_t in qi.h...

 {{{
 root at booph:~/devel/misc/qi (master)# make clean && make CPU=s3c2442
 CROSS_PATH= CROSS_COMPILE= COMPILER_LIB_PATH_PRE=
 COMPILER_LIB_PATH=/usr/lib/gcc/arm-linux-gnueabi/4.4/
 make[1]: Entering directory `/home/root/devel/misc/qi/tools'
 make[1]: Leaving directory `/home/root/devel/misc/qi/tools'
 src/drivers/glamo-mmc.c: In function 'mmc_cmd':
 src/drivers/glamo-mmc.c:188: warning: suggest parentheses around operand
 of '!' or change '&' to '&&' or '!' to '~'
 make -C tools
 make[1]: Entering directory `/home/root/devel/misc/qi/tools'
 gcc -Wall    mkudfu.c   -o mkudfu
 make[1]: Leaving directory `/home/root/devel/misc/qi/tools'
 mkdir -p image
 ===> DFU Trailer information:
 Trailer Vers.:  1
 Trailer Length: 16
 VendorID:       0x1d50
 ProductID:      0x5119
 HW Revision:    0x0350
 }}}

 Now onto the last CPU...

 {{{
 root at booph:~/devel/misc/qi (master)# make clean && make CPU=s3c2410
 CROSS_PATH= CROSS_COMPILE= COMPILER_LIB_PATH_PRE=
 COMPILER_LIB_PATH=/usr/lib/gcc/arm-linux-gnueabi/4.4/
 make[1]: Entering directory `/home/root/devel/misc/qi/tools'
 make[1]: Leaving directory `/home/root/devel/misc/qi/tools'
 src/drivers/glamo-mmc.c: In function 'mmc_cmd':
 src/drivers/glamo-mmc.c:188: warning: suggest parentheses around operand
 of '!' or change '&' to '&&' or '!' to '~'
 make -C tools
 make[1]: Entering directory `/home/root/devel/misc/qi/tools'
 gcc -Wall    mkudfu.c   -o mkudfu
 make[1]: Leaving directory `/home/root/devel/misc/qi/tools'
 mkdir -p image
 ===> DFU Trailer information:
 Trailer Vers.:  1
 Trailer Length: 16
 VendorID:       0x1457
 ProductID:      0x5119
 HW Revision:    0x0240
 }}}

 Nice, it finally built. Patch attached for the minor changes to fix the
 above and another to add a short note about how to build without a cross-
 compiler. The later could probably do with how to

 It would be nice if the Qi build system could automatically detect the
 right -L when building on armel with the native GCC.

-- 
Ticket URL: <https://docs.openmoko.org/trac/ticket/2325>
docs.openmoko.org <http://docs.openmoko.org/trac/>
openmoko trac


More information about the buglog mailing list