設定環境變數
執行arm-setupenv.sh
內容為
#!/bin/bash
export ARCH=arm
export CROSS_COMPILE=/home/nelsonchung/Develop/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-
export PATH=/home/nelsonchung/Develop/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin:$PATH
follow
mkfs.ext4 for ARM (Android)
LDFLAGS=-static ./configure --host=arm-none-linux-gnueabi
make
可以build成功
查看一下版本 - 4.1.2
nelsonchung@ubuntu:~/Develop$ arm-none-linux-gnueabi-gcc -v
Reading
specs from
/home/nelsonchung/Develop/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/../lib/gcc/arm-none-linux-gnueabi/4.1.2/specs
Target: arm-none-linux-gnueabi
Configured
with: /usr/src/redhat/BUILD/cross-mlib/source/gcc-4.1.2/configure
--target=arm-none-linux-gnueabi --host=i686-host_pc-linux-gnu
--prefix=/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi
--with-sysroot=/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/arm-none-linux-gnueabi/sysroot
--enable-threads --enable-shared --disable-libssp --disable-libgomp
--disable-libmudflap --enable-languages=c,c++ --enable-__cxa_atexit
--disable-nls
Thread model: posix
gcc version 4.1.2
可以在misc找到mke2fs
--
使用buildroot-2010.11產生出來的cross-compile
. arm-buildroot-setupenv.sh
內容為
#!/bin/bash
export ARCH=arm
export CROSS_COMPILE=/home/nelsonchung/Develop/buildroot-2010.11/output/staging/usr/bin/arm-linux-
export PATH=/home/nelsonchung/Develop/buildroot-2010.11/output/staging/usr/bin:$PATH
LDFLAGS=-static ./configure --host=arm-linux
make
產生以下error
CC llseek.c
llseek.c: In function '_llseek':
llseek.c:65: error: expected declaration specifiers or '...' before '_llseek'
llseek.c:65: error: expected declaration specifiers or '...' before 'fd'
llseek.c:65: error: expected declaration specifiers or '...' before 'offset_high'
llseek.c:66: error: expected declaration specifiers or '...' before 'offset_low'
llseek.c:66: error: expected declaration specifiers or '...' before 'result'
llseek.c:67: error: expected declaration specifiers or '...' before 'origin'
llseek.c:67: error: storage class specified for parameter '_syscall5'
llseek.c:71: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
llseek.c:91: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
llseek.c:138: error: old-style parameter declarations in prototyped function definition
llseek.c:62: error: parameter name omitted
llseek.c:62: error: parameter name omitted
llseek.c:63: error: parameter name omitted
llseek.c:63: error: parameter name omitted
llseek.c:63: error: parameter name omitted
llseek.c:114: error: expected '{' at end of input
make[2]: *** [llseek.o] Error 1
make[2]: Leaving directory `/home/nelsonchung/Develop/e2fsprogs-1.41.14/lib/ext2fs'
make[1]: *** [all-libs-recursive] Error 1
make[1]: Leaving directory `/home/nelsonchung/Develop/e2fsprogs-1.41.14'
make: *** [all] Error 2
查一下版本-4.3.5
nelsonchung@ubuntu:~/Develop/buildroot-2010.11/output/staging/usr/bin$ arm-linux-gcc -v
Using built-in specs.
Target: arm-unknown-linux-uclibcgnueabi
Configured
with:
/home/nelsonchung/Develop/buildroot-2010.11/output/toolchain/gcc-4.3.5/configure
--prefix=/home/nelsonchung/Develop/buildroot-2010.11/output/staging/usr
--build=i686-pc-linux-gnu --host=i686-pc-linux-gnu
--target=arm-unknown-linux-uclibcgnueabi --enable-languages=c
--with-sysroot=/home/nelsonchung/Develop/buildroot-2010.11/output/staging
--with-build-time-tools=/home/nelsonchung/Develop/buildroot-2010.11/output/staging/usr/arm-unknown-linux-uclibcgnueabi/bin
--disable-__cxa_atexit --enable-target-optspace --with-gnu-ld
--disable-libssp --disable-multilib --disable-tls --enable-shared
--with-gmp=/home/nelsonchung/Develop/buildroot-2010.11/output/toolchain/gmp
--with-mpfr=/home/nelsonchung/Develop/buildroot-2010.11/output/toolchain/mpfr
--disable-nls --enable-threads --disable-decimal-float
--with-float=soft --with-abi=aapcs-linux --with-arch=armv4t
--with-tune=arm920t --disable-largefile --with-pkgversion='Buildroot
2010.11' --with-bugurl=http://bugs.buildroot.net/
Thread model: posix
gcc version 4.3.5 (Buildroot 2010.11)
修改位於
./lib/blkid/llseek.c
./lib/ext2fs/llseek.c
(改天寫完記得要出patch)
make
error message
make[2]: Entering directory `/home/nelsonchung/Develop/e2fsprogs-1.41.14/e2fsck'
LD e2fsck
../lib/libext2fs.a(tdb.o): In function `ext2fs_tdb_transaction_commit':
/home/nelsonchung/Develop/e2fsprogs-1.41.14/lib/ext2fs/tdb.c:2119:
warning: the use of OBSOLESCENT `utime' is discouraged, use `utimes'
profile.o: In function `profile_create_node':
/home/nelsonchung/Develop/e2fsprogs-1.41.14/e2fsck/profile.c:1088: undefined reference to `__strdup'
/home/nelsonchung/Develop/e2fsprogs-1.41.14/e2fsck/profile.c:1094: undefined reference to `__strdup'
profile.o: In function `skip_over_nonblanks':
/home/nelsonchung/Develop/e2fsprogs-1.41.14/e2fsck/profile.c:639: undefined reference to `__ctype_b_loc'
profile.o: In function `skip_over_blanks':
/home/nelsonchung/Develop/e2fsprogs-1.41.14/e2fsck/profile.c:626: undefined reference to `__ctype_b_loc'
profile.o: In function `parse_line':
/home/nelsonchung/Develop/e2fsprogs-1.41.14/e2fsck/profile.c:681: undefined reference to `__ctype_b_loc'
profile.o: In function `strtoul':
/home/nelsonchung/Develop/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/../arm-none-linux-gnueabi/sysroot/usr/include/stdlib.h:342:
undefined reference to `__strtoul_internal'
profile.o: In function `strtol':
/home/nelsonchung/Develop/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/../arm-none-linux-gnueabi/sysroot/usr/include/stdlib.h:336:
undefined reference to `__strtol_internal'
profile.o: In function `get_dirlist':
/home/nelsonchung/Develop/e2fsprogs-1.41.14/e2fsck/profile.c:300: undefined reference to `__ctype_b_loc'
profile.o: In function `stat':
/home/nelsonchung/Develop/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/../arm-none-linux-gnueabi/sysroot/usr/include/sys/stat.h:436:
undefined reference to `__xstat'
collect2: ld returned 1 exit status
make[2]: *** [e2fsck] Error 1
make[2]: Leaving directory `/home/nelsonchung/Develop/e2fsprogs-1.41.14/e2fsck'
make[1]: *** [all-progs-recursive] Error 1
make[1]: Leaving directory `/home/nelsonchung/Develop/e2fsprogs-1.41.14'
make: *** [all] Error 2