This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.
See the CrossGCC FAQ for lots more information.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Mon, Jun 20, 2011 at 12:44 AM, Bryan Hundven <bryanhundven@gmail.com> wrote: > # HG changeset patch > # User Bryan Hundven <bryanhundven@gmail.com> > # Date 1308555696 25200 > # Node ID b25856d9153785d0f711206383480f0190aec363 > # Parent Â2377be750e83defa6d764bcb8cf6dbaf098a19f6 > glibc: Refactor startfiles/headers into do_libc > > The 'do_libc_start_files()' function was configuring libc differently then > 'do_libc()'. This might be fine for arm(eb) or powerpc(64), but not for > mips(64). > > Move the building of the libc start files and headers into do_libc, much like > how gcc handles stage1, stage2, and final toolchains. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com> > > diff -r 2377be750e83 -r b25856d91537 scripts/build/libc/glibc-eglibc.sh-common > --- a/scripts/build/libc/glibc-eglibc.sh-common Mon Jun 13 22:54:29 2011 +0400 > +++ b/scripts/build/libc/glibc-eglibc.sh-common Mon Jun 20 00:41:36 2011 -0700 > @@ -51,128 +51,30 @@ > > Â# Build and install headers and start files > Âdo_libc_start_files() { > -  Âlocal src_dir="${CT_SRC_DIR}/${CT_LIBC}-${CT_LIBC_VERSION}" > - > -  ÂCT_DoStep INFO "Installing C library headers & start files" > - > -  Âmkdir -p "${CT_BUILD_DIR}/build-libc-startfiles" > -  Âcd "${CT_BUILD_DIR}/build-libc-startfiles" > - > -  ÂCT_DoLog EXTRA "Configuring C library" > - > -  Âcase "${CT_LIBC}" in > -    Âeglibc) > -      Âif [ "${CT_EGLIBC_CUSTOM_CONFIG}" = "y" ]; then > -        ÂCT_DoExecLog ALL cp "${CT_CONFIG_DIR}/eglibc.config" option-groups.config > -      Âfi > -      Â;; > -  Âesac > - > -  Âcross_cc=$(CT_Which "${CT_TARGET}-gcc") > -  Âcross_cxx=$(CT_Which "${CT_TARGET}-g++") > -  Âcross_ar=$(CT_Which "${CT_TARGET}-ar") > -  Âcross_ranlib=$(CT_Which "${CT_TARGET}-ranlib") > - > -  ÂCT_DoLog DEBUG "Using gcc for target: '${cross_cc}'" > -  ÂCT_DoLog DEBUG "Using g++ for target: '${cross_cxx}'" > -  ÂCT_DoLog DEBUG "Using ar for target: '${cross_ar}'" > -  ÂCT_DoLog DEBUG "Using ranlib for target: '${cross_ranlib}'" > - > -  Âtouch config.cache > -  Âif [ "${CT_LIBC_GLIBC_FORCE_UNWIND}" = "y" ]; then > -    Âecho "libc_cv_forced_unwind=yes" >>config.cache > -    Âecho "libc_cv_c_cleanup=yes" >>config.cache > -  Âfi > - > -  Â# Pre-seed the configparms file with values from the config option > -  Âprintf "${CT_LIBC_GLIBC_CONFIGPARMS}\n" > configparms > - > -  ÂCT_DoExecLog CFG                  Â\ > -  ÂBUILD_CC="${CT_BUILD}-gcc"             Â\ > -  ÂCC=${cross_cc}                   Â\ > -  ÂCXX=${cross_cxx}                  Â\ > -  ÂAR=${cross_ar}                   Â\ > -  ÂRANLIB=${cross_ranlib}               Â\ > -  Â"${src_dir}/configure"               Â\ > -    Â--prefix=/usr                  \ > -    Â--with-headers="${CT_HEADERS_DIR}"       Â\ > -    Â--build="${CT_BUILD}"              \ > -    Â--host="${CT_TARGET}"              \ > -    Â--cache-file="$(pwd)/config.cache"       Â\ > -    Â--disable-profile                \ > -    Â--without-gd                  Â\ > -    Â--without-cvs                  \ > -    Â--enable-add-ons > - > -  ÂCT_DoLog EXTRA "Installing C library headers" > - > -  Â# use the 'install-headers' makefile target to install the > -  Â# headers > -  ÂCT_DoExecLog ALL make ${JOBSFLAGS}       Â\ > -           install_root=${CT_SYSROOT_DIR} \ > -           install-bootstrap-headers=yes Â\ > -           install-headers > - > -  Â# For glibc, a few headers need to be manually installed > -  Âif [ "${CT_LIBC}" = "glibc" ]; then > -    Â# Two headers -- stubs.h and features.h -- aren't installed by install-headers, > -    Â# so do them by hand. ÂWe can tolerate an empty stubs.h for the moment. > -    Â# See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html > -    Âmkdir -p "${CT_HEADERS_DIR}/gnu" > -    ÂCT_DoExecLog ALL touch "${CT_HEADERS_DIR}/gnu/stubs.h" > -    ÂCT_DoExecLog ALL cp -v "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/include/features.h" Â\ > -                "${CT_HEADERS_DIR}/features.h" > - > -    Â# Building the bootstrap gcc requires either setting inhibit_libc, or > -    Â# having a copy of stdio_lim.h... see > -    Â# http://sources.redhat.com/ml/libc-alpha/2003-11/msg00045.html > -    ÂCT_DoExecLog ALL cp -v bits/stdio_lim.h "${CT_HEADERS_DIR}/bits/stdio_lim.h" > - > -    Â# Following error building gcc-4.0.0's gcj: > -    Â# Âerror: bits/syscall.h: No such file or directory > -    Â# solved by following copy; see http://sourceware.org/ml/crossgcc/2005-05/msg00168.html > -    Â# but it breaks arm, see http://sourceware.org/ml/crossgcc/2006-01/msg00091.html > -    Âcase "${CT_ARCH}" in > -      Âarm)  Â;; > -      Â*) ÂCT_DoExecLog ALL cp -v "misc/syscall-list.h"      Â\ > -                    "${CT_HEADERS_DIR}/bits/syscall.h" > -        Â;; > -    Âesac > -  Âfi > - > -  Âif [ "${CT_THREADS}" = "nptl" ]; then > -    ÂCT_DoLog EXTRA "Installing C library start files" > - > -    Â# there are a few object files needed to link shared libraries, > -    Â# which we build and install by hand > -    ÂCT_DoExecLog ALL mkdir -p "${CT_SYSROOT_DIR}/usr/lib" > -    ÂCT_DoExecLog ALL make ${JOBSFLAGS} csu/subdir_lib > -    ÂCT_DoExecLog ALL cp csu/crt1.o csu/crti.o csu/crtn.o \ > -              Â"${CT_SYSROOT_DIR}/usr/lib" > - > -    Â# Finally, 'libgcc_s.so' requires a 'libc.so' to link against. > -    Â# However, since we will never actually execute its code, > -    Â# it doesn't matter what it contains. ÂSo, treating '/dev/null' > -    Â# as a C source file, we produce a dummy 'libc.so' in one step > -    ÂCT_DoExecLog ALL "${cross_cc}" -nostdlib    Â\ > -                    -nostartfiles  Â\ > -                    -shared     Â\ > -                    -x c /dev/null  \ > -                    -o "${CT_SYSROOT_DIR}/usr/lib/libc.so" > -  Âfi # threads == nptl > - > -  ÂCT_EndStep > +  Â# Start files and Headers should be configured the same way as the > +  Â# final libc, but built and installed differently. > +  Âdo_libc startfile_mode=yes > Â} > > Â# This function builds and install the full C library > Âdo_libc() { >   local src_dir="${CT_SRC_DIR}/${CT_LIBC}-${CT_LIBC_VERSION}" > +  Âlocal startfile_mode=no >   local extra_cc_args >   local -a extra_config >   local -a extra_make_args >   local glibc_cflags > > -  ÂCT_DoStep INFO "Installing C library" > +  Âwhile [ $# -ne 0 ]; do > +    Âeval "${1}" > +    Âshift > +  Âdone > + > +  Âif [ "${startfile_mode}" = "yes" ]; then > +    ÂCT_DoStep INFO "Installing C library headers & start files" > +  Âelse > +    ÂCT_DoStep INFO "Installing C library" > +  Âfi > >   mkdir -p "${CT_BUILD_DIR}/build-libc" >   cd "${CT_BUILD_DIR}/build-libc" > @@ -316,16 +218,75 @@ >       ;; >   esac > > -  ÂCT_DoLog EXTRA "Building C library" > -  ÂCT_DoExecLog ALL make ${JOBSFLAGS}           Â\ > -             Â"${extra_make_args[@]}"      \ > -             Âall > +  Âif [ "${startfile_mode}" = "yes" ]; then > +    ÂCT_DoLog EXTRA "Installing C library headers" > > -  ÂCT_DoLog EXTRA "Installing C library" > -  ÂCT_DoExecLog ALL make ${JOBSFLAGS}           Â\ > -             Â"${extra_make_args[@]}"      \ > -             Âinstall_root="${CT_SYSROOT_DIR}" Â\ > -             Âinstall > +    Â# use the 'install-headers' makefile target to install the > +    Â# headers > +    ÂCT_DoExecLog ALL make ${JOBSFLAGS}       Â\ > +             install_root=${CT_SYSROOT_DIR} \ > +             install-bootstrap-headers=yes Â\ > +             install-headers > + > +    Â# For glibc, a few headers need to be manually installed > +    Âif [ "${CT_LIBC}" = "glibc" ]; then > +      Â# Two headers -- stubs.h and features.h -- aren't installed by install-headers, > +      Â# so do them by hand. ÂWe can tolerate an empty stubs.h for the moment. > +      Â# See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html > +      Âmkdir -p "${CT_HEADERS_DIR}/gnu" > +      ÂCT_DoExecLog ALL touch "${CT_HEADERS_DIR}/gnu/stubs.h" > +      ÂCT_DoExecLog ALL cp -v "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}/include/features.h" Â\ > +                  "${CT_HEADERS_DIR}/features.h" > + > +      Â# Building the bootstrap gcc requires either setting inhibit_libc, or > +      Â# having a copy of stdio_lim.h... see > +      Â# http://sources.redhat.com/ml/libc-alpha/2003-11/msg00045.html > +      ÂCT_DoExecLog ALL cp -v bits/stdio_lim.h "${CT_HEADERS_DIR}/bits/stdio_lim.h" > + > +      Â# Following error building gcc-4.0.0's gcj: > +      Â# Âerror: bits/syscall.h: No such file or directory > +      Â# solved by following copy; see http://sourceware.org/ml/crossgcc/2005-05/msg00168.html > +      Â# but it breaks arm, see http://sourceware.org/ml/crossgcc/2006-01/msg00091.html > +      Âcase "${CT_ARCH}" in > +        Âarm)  Â;; > +        Â*) ÂCT_DoExecLog ALL cp -v "misc/syscall-list.h"      Â\ > +                      "${CT_HEADERS_DIR}/bits/syscall.h" > +          Â;; > +      Âesac > +    Âfi > + > +    Âif [ "${CT_THREADS}" = "nptl" ]; then > +      ÂCT_DoLog EXTRA "Installing C library start files" > + > +      Â# there are a few object files needed to link shared libraries, > +      Â# which we build and install by hand > +      ÂCT_DoExecLog ALL mkdir -p "${CT_SYSROOT_DIR}/usr/lib" > +      ÂCT_DoExecLog ALL make ${JOBSFLAGS} csu/subdir_lib > +      ÂCT_DoExecLog ALL cp csu/crt1.o csu/crti.o csu/crtn.o \ > +                Â"${CT_SYSROOT_DIR}/usr/lib" > + > +      Â# Finally, 'libgcc_s.so' requires a 'libc.so' to link against. > +      Â# However, since we will never actually execute its code, > +      Â# it doesn't matter what it contains. ÂSo, treating '/dev/null' > +      Â# as a C source file, we produce a dummy 'libc.so' in one step > +      ÂCT_DoExecLog ALL "${cross_cc}" -nostdlib    Â\ > +                      -nostartfiles  Â\ > +                      -shared     Â\ > +                      -x c /dev/null  \ > +                      -o "${CT_SYSROOT_DIR}/usr/lib/libc.so" > +    Âfi # threads == nptl > +  Âelse # startfile_mode = no > +    ÂCT_DoLog EXTRA "Building C library" > +    ÂCT_DoExecLog ALL make ${JOBSFLAGS}           Â\ > +               Â"${extra_make_args[@]}"      \ > +               Âall > + > +    ÂCT_DoLog EXTRA "Installing C library" > +    ÂCT_DoExecLog ALL make ${JOBSFLAGS}           Â\ > +               Â"${extra_make_args[@]}"      \ > +               Âinstall_root="${CT_SYSROOT_DIR}" Â\ > +               Âinstall > +  Âfi > >   CT_EndStep > Â} > @@ -384,3 +345,5 @@ >       ;; >   esac > Â} > + > +# vim: ts=4 sw=4 et ai syn=sh >
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |