scripts/build/internals.sh
author "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Wed Dec 14 16:55:22 2011 +0100 (2011-12-14)
branch1.13
changeset 2848 1ff89596dab0
parent 2544 751c3f735ada
child 3044 c79d55b27724
permissions -rw-r--r--
libc/eglibc: fix localedef 2.14 build

The localedef of eglibc 2.14 requires NOT_IN_libc to be defined in order to
compile intl/l10nflist.c.

This is because localedef is built separately from eglibc and uses some parts of
eglibc that don't compile in standalone without this preprocessor definition.

This fixes the following error:

[ALL ] gcc -g -O2 -DNO_SYSCONF -DNO_UNCOMPRESS
-DLOCALE_PATH='"/usr/lib/locale:/usr/share/i18n"'
-DLOCALEDIR='"/usr/lib/locale"' -DLOCALE_ALIAS_PATH='"/usr/share/locale"'
-DCHARMAP_PATH='"/usr/share/i18n/charmaps"'
-DREPERTOIREMAP_PATH='"/usr/share/i18n/repertoiremaps"'
-DLOCSRCDIR='"/usr/share/i18n/locales"' -Iglibc/locale/programs -Iglibc/locale
-I/<snip>/.build/src/eglibc-localedef-2_14/include
-I/<snip>/.build/src/eglibc-localedef-2_14 -I.
-include /<snip>/.build/src/eglibc-localedef-2_14/include/always.h -Wall
-Wno-format -c -o locarchive.o glibc/locale/programs/locarchive.c
[ALL ] glibc/locale/programs/locarchive.c: In function 'enlarge_archive':
[ALL ] glibc/locale/programs/locarchive.c:303:21: warning: variable
'oldlocrectab' set but not used [-Wunused-but-set-variable]
[ALL ] In file included from glibc/locale/programs/locarchive.c:651:0:
[ALL ] glibc/locale/programs/../../intl/l10nflist.c: In function
'_nl_normalize_codeset':
[ERROR] glibc/locale/programs/../../intl/l10nflist.c:342:9: error:
'_nl_C_locobj_ptr' undeclared (first use in this function)
[ALL ] glibc/locale/programs/../../intl/l10nflist.c:342:9: note: each
undeclared identifier is reported only once for each function it appears in
[ALL ] glibc/locale/programs/locarchive.c: In function
'add_locales_to_archive':
[ALL ] glibc/locale/programs/locarchive.c:1450:7: warning: passing argument
1 of '__xpg_basename' discards 'const' qualifier from pointer target type
[enabled by default]
[ALL ] /usr/include/libgen.h:35:14: note: expected 'char *' but argument is
of type 'const char *'
[ERROR] make[1]: *** [locarchive.o] Error 1

Signed-off-by: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
(transplanted from 4cd9134739b594451794cf61a6e1b137422cdafd)
     1 # This file contains crosstool-NG internal steps
     2 
     3 # This step is called once all components were built, to remove
     4 # un-wanted files, to add tuple aliases, and to add the final
     5 # crosstool-NG-provided files.
     6 do_finish() {
     7     local _t
     8     local _type
     9     local strip_args
    10     local gcc_version
    11 
    12     CT_DoStep INFO "Cleaning-up the toolchain's directory"
    13 
    14     if [ "${CT_STRIP_ALL_TOOLCHAIN_EXECUTABLES}" = "y" ]; then
    15         case "$CT_HOST" in
    16             *darwin*)
    17                 strip_args=""
    18                 ;;
    19             *)
    20                 strip_args="--strip-all -v"
    21                 ;;
    22         esac
    23         CT_DoLog INFO "Stripping all toolchain executables"
    24         CT_Pushd "${CT_PREFIX_DIR}"
    25         # We can not use the version in CT_CC_VERSION because
    26         # of the Linaro stuff. So, harvest the version string
    27         # directly from the gcc sources...
    28         # All gcc 4.x seem to have the version in gcc/BASE-VER
    29         # while version prior to 4.x have the version in gcc/version.c
    30         # Of course, here is not the better place to do that...
    31         if [ -f "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER" ]; then
    32             gcc_version=$( cat "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER" )
    33         else
    34             gcc_version=$( sed -r -e '/version_string/!d; s/^.+= "([^"]+)".*$/\1/;' \
    35                                "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/version.c"   \
    36                          )
    37         fi
    38         for _t in "bin/${CT_TARGET}-"*                                      \
    39                   "${CT_TARGET}/bin/"*                                      \
    40                   "libexec/gcc/${CT_TARGET}/${gcc_version}/"*               \
    41                   "libexec/gcc/${CT_TARGET}/${gcc_version}/install-tools/"* \
    42         ; do
    43             _type="$( file "${_t}" |cut -d ' ' -f 2- )"
    44             case "${_type}" in
    45                 *script*executable*)
    46                     ;;
    47                 *executable*)
    48                     CT_DoExecLog ALL ${CT_HOST}-strip ${strip_args} "${_t}"
    49                     ;;
    50             esac
    51         done
    52         CT_Popd
    53     fi
    54 
    55     if [ "${CT_BARE_METAL}" != "y" ]; then
    56         CT_DoLog EXTRA "Installing the populate helper"
    57         sed -r -e 's|@@CT_TARGET@@|'"${CT_TARGET}"'|g;' \
    58                -e 's|@@CT_install@@|'"${install}"'|g;'  \
    59                -e 's|@@CT_bash@@|'"${bash}"'|g;'        \
    60                -e 's|@@CT_grep@@|'"${grep}"'|g;'        \
    61                -e 's|@@CT_make@@|'"${make}"'|g;'        \
    62                -e 's|@@CT_sed@@|'"${sed}"'|g;'          \
    63                "${CT_LIB_DIR}/scripts/populate.in"      \
    64                >"${CT_PREFIX_DIR}/bin/${CT_TARGET}-populate"
    65         CT_DoExecLog ALL chmod 755 "${CT_PREFIX_DIR}/bin/${CT_TARGET}-populate"
    66     fi
    67 
    68     if [ "${CT_LIBC_XLDD}" = "y" ]; then
    69         CT_DoLog EXTRA "Installing a cross-ldd helper"
    70         sed -r -e 's|@@CT_VERSION@@|'"${CT_VERSION}"'|g;'   \
    71                -e 's|@@CT_TARGET@@|'"${CT_TARGET}"'|g;'     \
    72                -e 's|@@CT_BITS@@|'"${CT_ARCH_BITNESS}"'|g;' \
    73                -e 's|@@CT_install@@|'"${install}"'|g;'      \
    74                -e 's|@@CT_bash@@|'"${bash}"'|g;'            \
    75                -e 's|@@CT_grep@@|'"${grep}"'|g;'            \
    76                -e 's|@@CT_make@@|'"${make}"'|g;'            \
    77                -e 's|@@CT_sed@@|'"${sed}"'|g;'              \
    78                "${CT_LIB_DIR}/scripts/xldd.in"              \
    79                >"${CT_PREFIX_DIR}/bin/${CT_TARGET}-ldd"
    80         CT_DoExecLog ALL chmod 755 "${CT_PREFIX_DIR}/bin/${CT_TARGET}-ldd"
    81     fi
    82 
    83     # Create the aliases to the target tools
    84     CT_DoLog EXTRA "Creating toolchain aliases"
    85     CT_Pushd "${CT_PREFIX_DIR}/bin"
    86     for t in "${CT_TARGET}-"*; do
    87         if [ -n "${CT_TARGET_ALIAS}" ]; then
    88             _t=$(echo "$t" |sed -r -e 's/^'"${CT_TARGET}"'-/'"${CT_TARGET_ALIAS}"'-/;')
    89             CT_DoExecLog ALL ln -sfv "${t}" "${_t}"
    90         fi
    91         if [ -n "${CT_TARGET_ALIAS_SED_EXPR}" ]; then
    92             _t=$(echo "$t" |sed -r -e "${CT_TARGET_ALIAS_SED_EXPR}")
    93             if [ "${_t}" = "${t}" ]; then
    94                 CT_DoLog WARN "The sed expression '${CT_TARGET_ALIAS_SED_EXPR}' has no effect on '${t}'"
    95             else
    96                 CT_DoExecLog ALL ln -sfv "${t}" "${_t}"
    97             fi
    98         fi
    99     done
   100     CT_Popd
   101 
   102     CT_DoLog EXTRA "Removing access to the build system tools"
   103     CT_DoExecLog DEBUG rm -rf "${CT_PREFIX_DIR}/buildtools"
   104 
   105     # Remove the generated documentation files
   106     if [ "${CT_REMOVE_DOCS}" = "y" ]; then
   107         CT_DoLog EXTRA "Removing installed documentation"
   108         CT_DoForceRmdir "${CT_PREFIX_DIR}/"{,usr/}{,share/}{man,info}
   109         CT_DoForceRmdir "${CT_SYSROOT_DIR}/"{,usr/}{,share/}{man,info}
   110         CT_DoForceRmdir "${CT_DEBUGROOT_DIR}/"{,usr/}{,share/}{man,info}
   111     fi
   112 
   113     # Remove the lib* symlinks, now:
   114     # The symlinks are needed only during the build process.
   115     # The final gcc will still search those dirs, but will also search
   116     # the standard lib/ dirs, so we can get rid of the symlinks
   117     CT_DoExecLog ALL rm -f "${CT_PREFIX_DIR}/lib32"
   118     CT_DoExecLog ALL rm -f "${CT_PREFIX_DIR}/lib64"
   119 
   120     CT_EndStep
   121 }