1 | #!/bin/bash
|
---|
2 |
|
---|
3 | # cross-lfs temporary binutils build
|
---|
4 | # ----------------------------------
|
---|
5 | # $LastChangedBy$
|
---|
6 | # $LastChangedDate$
|
---|
7 | # $LastChangedRevision$
|
---|
8 | # $HeadURL$
|
---|
9 | #
|
---|
10 |
|
---|
11 | cd ${SRC}
|
---|
12 | LOG="binutils-temp.log"
|
---|
13 | set_libdirname
|
---|
14 | setup_multiarch
|
---|
15 | if [ ! "${libedirname}" = "lib" ]; then
|
---|
16 | extra_conf="--libdir=${TGT_TOOLS}/${libdirname}"
|
---|
17 | fi
|
---|
18 |
|
---|
19 | unpack_tarball binutils-${BINUTILS_VER} &&
|
---|
20 |
|
---|
21 | # Determine whether this binutils requires
|
---|
22 | # 'make configure-host' and whether
|
---|
23 | # ld search path can be set with --with-lib-path.
|
---|
24 | # Returned in ${BINUTILS_CONF_HOST} and
|
---|
25 | # ${BINUTILS_WITH_LIB_PATH} respectively
|
---|
26 |
|
---|
27 | # TODO: check for architecture specific patches in check_binutils
|
---|
28 | # ( alpha )
|
---|
29 | check_binutils
|
---|
30 |
|
---|
31 | cd ${SRC}/${PKGDIR}
|
---|
32 |
|
---|
33 | case ${BINUTILS_VER} in
|
---|
34 | # 20031015 - fix static linking issues during testsuite
|
---|
35 | # with current CVS glibc. kernel 2.5.68+
|
---|
36 | # Will only patch HJL 2.14.90.0.[6-7]
|
---|
37 | 2.14.90.0.[6-7] ) apply_patch binutils-2.14.90.0.7-fix-static-link ;;
|
---|
38 |
|
---|
39 | # Issue with HJL binutils 2.15.94.0.1 stripping needed information
|
---|
40 | # one manifestation is with stripping TLS info from libc.a
|
---|
41 | 2.15.94.0.1 ) apply_patch binutils-2.15.94.0.1-fix-strip-1 ;;
|
---|
42 | esac
|
---|
43 |
|
---|
44 | # TODO: This is not gonna cut it for biarch builds... rethink...
|
---|
45 | # UPDATE: Fixed with patch below to genscripts
|
---|
46 | test Y == "${BINUTILS_WITH_LIB_PATH}" &&
|
---|
47 | BINUTILS_LIB_PATH="--with-lib-path=/lib:/usr/lib" ||
|
---|
48 | BINUTILS_LIB_PATH=""
|
---|
49 |
|
---|
50 | case ${BINUTILS_VER} in
|
---|
51 | 2.14 )
|
---|
52 | apply_patch binutils-2.14-genscripts-multilib
|
---|
53 | ;;
|
---|
54 | 2.14.90.0.8 )
|
---|
55 | apply_patch binutils-2.14.90.0.8-genscripts-multilib
|
---|
56 | ;;
|
---|
57 | 2.15.9[0124].0.* | 2.15 )
|
---|
58 | apply_patch binutils-2.15.91.0.1-genscripts-multilib
|
---|
59 | ;;
|
---|
60 | 2.16* )
|
---|
61 | apply_patch binutils-2.15.91.0.1-genscripts-multilib
|
---|
62 | ;;
|
---|
63 | esac
|
---|
64 |
|
---|
65 | cd ${SRC}
|
---|
66 |
|
---|
67 | # Remove pre-existing build directory and recreate
|
---|
68 | test -d binutils-${BINUTILS_VER}-temp-build &&
|
---|
69 | rm -rf binutils-${BINUTILS_VER}-temp-build
|
---|
70 |
|
---|
71 | mkdir binutils-${BINUTILS_VER}-temp-build
|
---|
72 | cd binutils-${BINUTILS_VER}-temp-build
|
---|
73 |
|
---|
74 | max_log_init Binutils ${BINUTILS_VER} temp ${CONFLOGS} ${LOG}
|
---|
75 | CC="${CC-gcc} ${ARCH_CFLAGS}" ../${PKGDIR}/configure \
|
---|
76 | --prefix=${TGT_TOOLS} \
|
---|
77 | --host=${TARGET} \
|
---|
78 | --disable-nls ${extra_conf} \
|
---|
79 | --enable-shared \
|
---|
80 | --enable-64-bit-bfd ${BINUTILS_LIB_PATH} \
|
---|
81 | >> ${LOGFILE} 2>&1 &&
|
---|
82 | {
|
---|
83 | # Run make configure-host if required
|
---|
84 | test Y != "${BINUTILS_CONF_HOST}" ||
|
---|
85 | {
|
---|
86 | echo -e "\nmake configure-host\n${BRKLN}" >> ${LOGFILE}
|
---|
87 | make configure-host >> ${LOGFILE} 2>&1
|
---|
88 | }
|
---|
89 | } &&
|
---|
90 | echo " o Configure OK" &&
|
---|
91 |
|
---|
92 | min_log_init ${BUILDLOGS} &&
|
---|
93 | make ${PMFLAGS} LDFLAGS="-s" \
|
---|
94 | >> ${LOGFILE} 2>&1 &&
|
---|
95 | echo " o Build OK" || barf
|
---|
96 |
|
---|
97 | min_log_init ${INSTLOGS} &&
|
---|
98 | make install \
|
---|
99 | >> ${LOGFILE} 2>&1 &&
|
---|
100 | echo " o All OK" || barf
|
---|
101 |
|
---|
102 | # Copy over libiberty.h
|
---|
103 | cp -p ${SRC}/${PKGDIR}/include/libiberty.h ${TGT_TOOLS}/include/libiberty.h
|
---|