Ticket #2325 (closed defect: fixed)

Opened 9 years ago

Last modified 2 years ago

adventures in building Qi on Debian armel

Reported by: pabs Owned by: openmoko-kernel
Priority: normal Milestone:
Component: kernel Version:
Severity: normal Keywords: qi
Cc: Blocked By:
Blocking: Estimated Completion (week):
HasPatchForReview: yes PatchReviewResult:
Reproducible:

Description

First try with a fresh checkout of master:

root@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@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@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@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@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@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@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@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.

Attachments

0001-Fix-some-build-issues-on-Debian-armel.patch (1.3 KB) - added by pabs 9 years ago.
native compiler patch
0002-Document-how-to-build-without-a-cross-compiler-and-f.patch (1.3 KB) - added by pabs 9 years ago.
documentation update

Change History

Changed 9 years ago by pabs

native compiler patch

Changed 9 years ago by pabs

documentation update

comment:1 Changed 9 years ago by pabs

I was also able to boot both Debian and SHR fine after using flash_eraseall and nandwrite to write the GTA02 image to /dev/mtd1.

comment:2 Changed 9 years ago by PaulFertser

  • Status changed from new to closed
  • Resolution set to fixed

Thanks for reporting.

Fixed in HEAD. I did it a little bit differently, hope you're ok with
that :)

(FYI: the warning wasn't bogus)

comment:3 Changed 9 years ago by pabs

Your version looks better, thanks.

Could you also remove the -Werror flag? It will probably cause FTBFS bugs if GCC is updated and gets more whiny as is usually the case for newer versions of GCC.

comment:4 Changed 9 years ago by PaulFertser

Well, it's the warning that helped to catch the error in handling a
flag. I'm not sure i want to remove -Werror though i understand your
reasoning.

comment:5 Changed 9 years ago by lindi

Did you nandwrite the udfu image or the one without udfu in the name?

Not sure if it helps anybody but I build a cross-compiler with

# debian lenny
# i386
# normal user (with sudo access)

mkdir armel-cross
cd armel-cross/

sudo aptitude install dpkg-cross apt-cross fakeroot dpatch gawk flex realpath automake1.7 debhelper cdbs 
apt-get source gcc-4.2 binutils glibc

cd binutils-2.18.1~cvs20080103/
TARGET=arm-linux-gnueabi fakeroot debian/rules binary-cross 
sudo dpkg -i ../binutils-arm-linux-gnueabi_2.18.1~cvs20080103-7_i386.deb
cd ..

apt-cross -a armel -v -i libdb1-compat
apt-cross -a armel -v -i libc6
apt-cross -a armel -v -i libc6-dev
apt-cross -a armel -v -i linux-libc-dev

cd gcc-4.2-4.2.4/
export GCC_TARGET=armel
debian/rules control
dpkg-buildpackage -b -rfakeroot
sudo dpkg -i ../libstdc++6-4.2-dev-armel-cross_4.2.4-6_all.deb  ../gcc-4.2-arm-linux-gnueabi_4.2.4-6_i386.deb ../gcc-4.2-arm-linux-gnueabi-base_4.2.4-6_i386.deb  ../g++-4.2-arm-linux-gnueabi_4.2.4-6_i386.deb ../cpp-4.2-arm-linux-gnueabi_4.2.4-6_i386.deb ../libstdc++6-armel-cross_4.2.4-6_all.deb
cd ..

cd ..

and then built Qi with

sudo aptitude install uboot-mkimage
git clone git://git.openmoko.org/git/qi
cd qi
make CPU=s3c2442 CROSS_COMPILE=arm-linux-gnueabi- COMPILER_LIB_PATH_PRE=/usr/lib/gcc/arm-linux-gnueabi 
dfu-util -a u-boot -R -U backup.udfu
dfu-util -a u-boot -R -D image/qi-s3c2442-master_36bb5c03756268ff.udfu

comment:6 Changed 2 years ago by RoberMync

Cialis 20 Mg Mitad <a href=http://accutane.ccrpdc.com/isotretinoin-accutane.php>Isotretinoin Accutane</a> Viagra Without A Doctor Prescription Apply Keflex <a href=http://kama1.xyz/buy-kamagra-oral-jelly.php>Buy Kamagra Oral Jelly</a> For Sale Stendra On Line Dose Amoxicillin Child <a href=http://viag1.xyz>Buy Viagra</a> Filitra Vardenafil Tablets Acheter cialis 5mg ligne <a href=http://kama1.xyz/order-kamagra-tablets.php>Order Kamagra Tablets</a> Amoxicillin Anti Amoxicillin Raises Blood Pressure <a href=http://cial1.xyz/cialis-online-pharmacy.php>Cialis Online Pharmacy</a> Online Pharmacies That Sell Misoprostol buy roche accutane online uk <a href=http://cial1.xyz/cheap-cialis-online.php>Cheap Cialis Online</a> Can You Sell Viagra On Ebay 60 Viagra Bestellen Met Ideal <a href=http://priligy.ccrpdc.com/buy-priligy-usa.php>Buy Priligy Usa</a> Meshashringi Best Cheapest Way To Get Cialis <a href=http://kama1.xyz/purchase-kamagra-usa.php>Purchase Kamagra Usa</a> Buy Viagra Cialis Online Canada Caratteristiche Levitra In Farmacia <a href=http://kama1.xyz/buy-kamagra-online-cheap.php>Buy Kamagra Online Cheap</a> Propecia Pesetas Canadian Pharmacy Propecia 20mg <a href=http://kama1.xyz/kamagra-jelly-forum.php>Kamagra Jelly Forum</a> Viagra Kaufen Cialis Cialis O Viagra Dove Comprare <a href=http://viag1.xyz/map.php>Sildenafil</a> Kamagra Online Review Effects Of Long Term Amoxicillin <a href=http://viagra.ccrpdc.com/sildenafil-dosage.php>Sildenafil Dosage</a> Generic Propecia 1 Ml Top Pills <a href=http://viag1.xyz/order-cheap-viagra.php>Order Cheap Viagra</a> Lumigan Cialis Generique Gratuit <a href=http://cial1.xyz/shop-cialis-online.php>Shop Cialis Online</a> Propecia Inem Viagra Sans En Avoir Besoin <a href=http://kama1.xyz/cost-of-kamagra.php>Cost Of Kamagra</a> Propecia Herz Viagra Cialis Levitra Effetti Collaterali <a href=http://cial1.xyz/cialis-online-buy.php>Cialis Online Buy</a> Amoxil Rats Cialis 20mg Tunisie <a href=http://viag1.xyz/buy-cheap-viagra.php>Buy Cheap Viagra</a> Propecia Indicaciones 272 Can I Trust Canadian Viagra Online <a href=http://cial5mg.xyz/generic-cialis-pricing.php>Generic Cialis Pricing</a> Dove Comprare Cialis In Italia Nolvadex Medicaments Et Remedes <a href=http://zol1.xyz/zoloft-online.php>Zoloft Online</a> Kamagra Oral Jelly Australia Opinion Propecia Finasteride <a href=http://zol1.xyz/buy-online-zoloft.php>Buy Online Zoloft</a> Healthy Man Viagra Offer Precio Kamagra <a href=http://cial1.xyz/generic-cialis-usa.php>Generic Cialis Usa</a> Propecia Shed Amoxil Duo <a href=http://doxycycline.ccrpdc.com/vibramycin-online.php>Vibramycin Online</a> Kamagra Sun Definicionpatente De Propecia <a href=http://cial1.xyz/tadalafil-online.php>Tadalafil Online</a> Xm Radio Generic Cialis Medscom Bewertung <a href=http://cial5mg.xyz/order-cialis-online.php>Order Cialis Online</a> Comprar Levitra Generico Propecia Clasificacion <a href=http://priligy.ccrpdc.com/where-to-buy-priligy-in-usa.php>Where To Buy Priligy In Usa</a> Sildenafil Generique France Dutasteride Australia Mastercard Accepted With Overnight Delivery Pharmacy <a href=http://strattera.ccrpdc.com/buy-strattera-cheap.php>Buy Strattera Cheap</a> Ou Acheter Cialis En Ligne Forum Achat Viagra Sans Ordonnance Pharmacie En Venissieux <a href=http://viag1.xyz/viagra-100mg.php>Viagra 100mg</a> Propecia Partir Viagra Flugzeug Mitnehmen <a href=http://cial1.xyz/buy-generic-cialis.php>Buy Generic Cialis</a> Cialis Legal Deutschland Vendita Viagra Originale <a href=http://zol1.xyz/cheapest-zoloft-online.php>Cheapest Zoloft Online</a> Online Drugstore No Prescription Viagra Zihuatanejo <a href=http://zol1.xyz/zoloft-to-buy.php>Zoloft To Buy</a> Cialis Fertilita

Note: See TracTickets for help on using tickets.