[Clfs-support] Mini2440 W.I.P.
Andrew Bradford
andrew at bradfordembedded.com
Thu Jul 19 11:15:35 PDT 2012
On Thu, 19 Jul 2012 12:38:36 -0500
Ron McDowell <rcm at fuzzwad.org> wrote:
> All works fine up thru Ch 6.8 of CLFS-EMBEDDED-GIT-0.0.1-20110514,
> but then in Ch 6.9-6.10 I had to make the following changes...
>
> #
> # binutils-2.21 no longer available, used 2.21.1, which changed several
> lines.
> # also added AR and AS declarations
> # and --host
> tar xof Archives/binutils-2.21.1.tar || exit 1
> cd binutils-2.21.1/ || exit 1
> mkdir -v ../binutils-build || exit 1
> cd ../binutils-build || exit 1
> AR=ar AS=as ../binutils-2.21.1/configure --prefix=${CLFS}/cross-tools \
> --host=${CLFS_HOST} --target=${CLFS_TARGET} --with-sysroot=${CLFS} \
> --with-lib-path=${CLFS}/tools/lib --disable-nls --enable-shared \
> --disable-multilib || exit 1
> make configure-host || exit 1
> make || exit 1
> make install || exit 1
> cp -v ../binutils-2.21.1/include/libiberty.h ${CLFS}/usr/include || exit 1
> cd .. || exit 1
> rm -rf binutils-2.21.1/ || exit 1
> rm -rf binutils-build/ || exit 1
Did you find that not having --host, setting AR & AS, and using
binutils 2.21 wouldn't work? I hadn't seen that before and I believe
I've always built binutils without --host, AR, and AS...
I didn't realize 2.21 went away, to be replaced by 2.21.1...
2.22 should work as well. Eventually the online book will get updated...
[1]: http://git.cross-lfs.org/?p=abradford/clfs-embedded.git;a=summary
> #
> # ch 6.10
> #
> tar xof Archives/gcc-4.6.0.tar || exit 1
> cd gcc-4.6.0/ || exit 1
> #
> #next 6 lines brought forward from CLFS-1.2.0
> patch -Np1 -i ../Archives/gcc-4.6.0-branch_update-1.patch || exit 1
> patch -Np1 -i ../Archives/gcc-4.6.0-specs-1.patch || exit 1
> echo -en '#undef STANDARD_INCLUDE_DIR\n#define STANDARD_INCLUDE_DIR
> "/tools/include/"\n\n' >> gcc/config/rs6000/sysv4.h || exit 1
> echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define
> STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"\n' >>
> gcc/config/rs6000/sysv4.h || exit 1
> echo -en '\n#undef STANDARD_STARTFILE_PREFIX_2\n#define
> STANDARD_STARTFILE_PREFIX_2 ""\n' >> gcc/config/rs6000/sysv4.h || exit 1
> touch ${CLFS}/tools/include/limits.h || exit 1
> #
> # following patch had to be applied by hand...the patch looks fine but
> won't 'patch'...
> # patch -Np1 -i ../Local/gcc-4.6.0-uclibc-arm-softfloat.patch || exit 1
> #
Possibly the branch_update and specs patches you applied previously
caused the softfloat patch to not apply cleanly. It applies cleanly
for me following the embedded book (which doesn't apply the
branch_update or specs patches).
andrew at bradford:~/Downloads/gcc-4.6.0$ patch -Np1 -i ../gcc-4.6.0-uclibc-arm-softfloat-2.patch
patching file gcc/config/arm/linux-elf.h
patching file gcc/config/arm/t-linux
> # a combo of the above echos and hints from codemonkey's msg 001246, Aug
> 2011
> # gave rise to the following 8 lines.
> # currently a shotgun approach, see what hits if anything...
> # [it does compile thru this way, but several of these probably aren't
> needed]
I don't think they're *needed* but if you like them...
> echo -en '\n#undef STANDARD_INCLUDE_DIR\n#define STANDARD_INCLUDE_DIR
> "/tools/include/"\n' >> gcc/config/arm/linux-eabi.h || exit 1
> echo -en "\n#undef STARTFILE_PREFIX_SPEC\n#define STARTFILE_PREFIX_SPEC
> \"/tools/lib/\"\n" >> gcc/config/arm/linux-eabi.h || exit 1
> echo -en "\n#undef STANDARD_STARTFILE_PREFIX_1\n#define
> STANDARD_STARTFILE_PREFIX_1 \"/tools/lib/\"\n" >>
> gcc/config/arm/linux-eabi.h || exit 1
> echo -en "\n#undef STANDARD_STARTFILE_PREFIX_2\n#define
> STANDARD_STARTFILE_PREFIX_2 \"/tools/lib/\"\n" >>
> gcc/config/arm/linux-eabi.h || exit 1
> echo -en '\n#undef STANDARD_INCLUDE_DIR\n#define STANDARD_INCLUDE_DIR
> "/tools/include/"\n\n' >> gcc/config/arm/linux-eabi.h || exit 1
> echo -en "\n#undef STARTFILE_PREFIX_SPEC\n#define STARTFILE_PREFIX_SPEC
> \"/tools/lib/\"\n" >> gcc/config/arm/linux-elf.h || exit 1
> echo -en "\n#undef STANDARD_STARTFILE_PREFIX_1\n#define
> STANDARD_STARTFILE_PREFIX_1 \"/tools/lib/\"\n" >>
> gcc/config/arm/linux-elf.h || exit 1
> echo -en "\n#undef STANDARD_STARTFILE_PREFIX_2\n#define
> STANDARD_STARTFILE_PREFIX_2 \"/tools/lib/\"\n" >>
> gcc/config/arm/linux-elf.h || exit 1
<snip>
> ...and then in Ch 6.11 the build fails with...
>
> + tar xof Archives/uClibc-0.9.31.tar
> + cd uClibc-0.9.31/
> + patch -Np1 -i ../Archives/uClibc-0.9.31-configs-2.patch
> patching file clfs/config.arm.big
> patching file clfs/config.arm.little
> patching file clfs/config.i386.littlepatching file clfs/config.mips.big
> patching file clfs/config.mips.littlepatching file clfs/config.x86_64.little
> + cp -v clfs/config.arm.little .config
> `clfs/config.arm.little' -> `.config'
> + '[' aapcs == aapcs ']'
> + sed -i s/CONFIG_ARM_OABI/CONFIG_ARM_EABI/g .config
> + make oldconfig
> MKDIR include/config
> HOSTCC-o extra/config/conf.o
> GEN extra/config/zconf.tab.c
> GEN extra/config/lex.zconf.c
> GEN extra/config/zconf.hash.c
> HOSTCC-o extra/config/zconf.tab.o
> HOSTCC extra/config/conf
> ./.config:38:warning: override: reassigning to symbol CONFIG_ARM_EABI
> *
> * Restart config...
> *
> *
> * Target Architecture Features and Options
> *
> Target ABI
> 1. OABI (CONFIG_ARM_OABI) (NEW)
> > 2. EABI (CONFIG_ARM_EABI)
> choice[1-2?]: 2
> Target Processor Type
> > 1. Generic Arm (CONFIG_GENERIC_ARM)
> 2. Arm 610 (CONFIG_ARM610)
> 3. Arm 710 (CONFIG_ARM710)
> 4. Arm 7TDMI (CONFIG_ARM7TDMI)
> 5. Arm 720T (CONFIG_ARM720T)
> 6. Arm 920T (CONFIG_ARM920T)
> 7. Arm 922T (CONFIG_ARM922T)
> 8. Arm 926T (CONFIG_ARM926T)
> 9. Arm 10T (CONFIG_ARM10T)
> 10. Arm 1136JF-S (CONFIG_ARM1136JF_S)
> 11. Arm 1176JZ-S (CONFIG_ARM1176JZ_S)
> 12. Arm 1176JZF-S (CONFIG_ARM1176JZF_S)
> 13. Arm Cortex-M3 (CONFIG_ARM_CORTEX_M3)
> 14. Arm Cortex-M1 (CONFIG_ARM_CORTEX_M1)
> 15. Intel StrongArm SA-110 (CONFIG_ARM_SA110)
> 16. Intel StrongArm SA-1100 (CONFIG_ARM_SA1100)
> 17. Intel Xscale (CONFIG_ARM_XSCALE)
> 18. Intel Xscale With WMMX PXA27x (CONFIG_ARM_IWMMXT)
> choice[1-18?]: 1
> *
> * Using ELF file format
> *
> Target Processor Endianness
> 1. Big Endian (ARCH_WANTS_BIG_ENDIAN)
> > 2. Little Endian (ARCH_WANTS_LITTLE_ENDIAN)
> choice[1-2?]: 2
> Target CPU has a memory management unit (MMU) (ARCH_HAS_MMU) [Y/n/?] y
> Do you want to utilize the MMU? (ARCH_USE_MMU) [Y/n/?] y
> Enable floating point number support (UCLIBC_HAS_FLOATS) [Y/n/?] y
> Target CPU has a floating point unit (FPU) (UCLIBC_HAS_FPU) [Y/n/?] y
> Enable full C99 math library support (DO_C99_MATH) [Y/n/?] y
> Enable XSI math extensions to the ISO C standard (bessel)
> (DO_XSI_MATH) [N/y/?] n
> Enable C99 Floating-point environment (UCLIBC_HAS_FENV) [Y/n/?] y
> Linux kernel header location (KERNEL_HEADERS) [${CLFS}/usr/include]
> ${CLFS}/usr/include
> #
> # configuration written to ./.config
> #
> + make
> MKDIR include/bits
> GEN include/bits/sysnum.h
> GEN include/bits/uClibc_config.h
> LN include/pthread.h
> LN include/semaphore.h
> LN include/bits/pthreadtypes.h
> ...
> LN include/sys/ucontext.h
> LN include/sys/user.h
> AS lib/crt1.o
> AS lib/Scrt1.o
> AS lib/crti.o
> AS lib/crtn.o
> /tmp/cchgc7oK.s: Assembler messages:
> /tmp/cchgc7oK.s: Error: .size expression for _init does not evaluate to
> a constant
> /tmp/cchgc7oK.s: Error: .size expression for _fini does not evaluate to
> a constant
> make: *** [lib/crtn.o] Error 1
> + exit 1
>
> Any clues gratefully accepted.
>
> My build box is Ubuntu 10.04-LTS with current updates.
uClibc 0.9.32 should fix this. See git commit [2]. Use the
0.9.32-configs-1.patch [3] for it, I think there were a few small changes,
but maybe not... It's been a while. :)
[2]: http://git.uclibc.org/uClibc/commit/?id=3e68c52b941636714d2599ea8adda9520ec2de23
[3]: http://git.cross-lfs.org/?p=abradford/clfs-embedded.git;a=blob;f=patches/uClibc-0.9.32-configs-1.patch;h=59b639b1aef7bcb9cd03b2f89778493e25015958;hb=HEAD
Regards,
Andrew
More information about the Clfs-support
mailing list