# --- T2-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # T2 SDE: package/.../glibc/glibc.conf # Copyright (C) 2004 - 2010 The T2 SDE Project # # More information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. A copy of the # GNU General Public License can be found in the file COPYING. # --- T2-COPYRIGHT-NOTE-END --- # overwrite prefix to not point to the tools, but the real root for the headers if atstage toolchain; then # hack due to sane variable not available and prefix is tools prefix # -ReneR confopt="--prefix=$base/build/$SDECFG_ID/usr \ --with-headers=$base/build/$SDECFG_ID/usr/include \$extraconfopt" includedir="/../../usr/include" # MIPS injects -mabi - the host CC does not know about it for header gen var_append SYSCC_WRAPPER_REMOVE ' ' '-mabi*' var_append SYSCPP_WRAPPER_REMOVE ' ' '-mabi*' else var_append confopt " " "--with-headers=$root/usr/include" fi # TODO: bind to linux-header version, .22 breaks ppc due private_futex var_append confopt " " "--enable-kernel=2.6.16" # TODO: wire up "--without-fp" # use at least "-O" when build without optimisation for debugging ... var_remove GCC_WRAPPER_INSERT ' ' '-O0' var_insert GCC_WRAPPER_INSERT ' ' '-O' var_remove SYSGCC_WRAPPER_INSERT ' ' '-O0' # On Mips64 and ARM the following fails unless we build with: -fgnu89-inline # "sysdeps/ieee754/dbl-64/s_copysign.c:27: error: redefinition of '__copysign'" [ $arch = mips64 -o $arch = arm ] && var_insert GCC_WRAPPER_INSERT ' ' '-fgnu89-inline' # does currently not inline all necessary with -Os # glibc-2.7/objdir/libc_pic.os: In function `faccessat': (.text+0x7bfaf): undefined reference to `fstatat64' GCC_WRAPPER_INSERT="${GCC_WRAPPER_INSERT//-Os/-O2}" # glibc does not like -ffast-math var_remove GCC_WRAPPER_APPEND ' ' '-ffast-math' var_remove GCC_WRAPPER_INSERT ' ' '-ffast-math' # We must use an 'objdir' directory for building glibc # Disable glibc internal debuging but build debuging and profile # code so we can use this glibc to debug other programs. hook_add preconf 3 "mkdir -p objdir; cd objdir" configprefix='CFLAGS="$CFLAGS -g -DNDEBUG=1"' configscript="../configure" var_append confopt " " "--with-gnu-binutils --build=${arch_build} --host=${arch_target}" # toolchain and cross needs some guidance if ! atstage native; then hook_add preconf 3 "echo 'libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes libc_cv_gcc_exceptions=yes ac_cv_header_cpuid_h=yes' >> config.cache" fi if ! atstage native; then var_append confopt " " "--without-gd" elif pkginstalled libgd; then var_append confopt " " "--with-gd=/usr --with-gd-lib=/usr/lib --with-gd-include=/usr/include" fi # control whether to use nptl - if supported by the architecture ... if [ $SDECFG_PKG_GLIBC_TLS = 1 ]; then var_append extraconfopt " " \ "--enable-add-ons=nptl,ports --with-tls --with-__thread" #,libidn else var_append extraconfopt " " \ "--enable-add-ons=linuxthreads --without-__thread --disable-sanity-checks" [[ $arch = mips* ]] && var_append extraconfopt " " "--without-tls" fi # control whether to include profiling support if [ $SDECFG_PKG_GLIBC_ENABLE_PROFILE = 1 ] ; then var_append extraconfopt " " "--enable-profile" else var_append extraconfopt " " "--disable-profile" fi var_append makeopt " " "slibdir=/\$slibdir" var_append makeinstopt " " "slibdir=/\$slibdir install_root=\$root" glibc_prepatch() { for tarball in `match_source_file -p ports` \ `match_source_file -p linuxthread` \ `match_source_file -p libidn` do tar $taropt $tarball # rename without surrounding glibc-*-version tarball=${tarball##*/}; tarball=${tarball#*-}; tarball=${tarball%%-*} mv glibc-${tarball}-* ${tarball} # remove CVS from the newly extracted files, glibc tries to # automatically commit newly generated files :-! find $tarball -name CVS | xargs rm -rfv done mkdir -p $root$includedir/gnu/ if [ $pkg == glibc ]; then # touch is not enough to add it, "echo -n "" >>" neither addStub() { for f; do dd if=/dev/null of="$f" count=0; done } addStub $root$includedir/gnu/stubs.h if [ $slibdir = lib64 ]; then addStub $root$includedir/gnu/stubs{,-32,-64}.h fi fi } glibc_postmake() { if atstage toolchain; then cp -v ../include/features.h $root$includedir mkdir -p $includedir/{bits,gnu} [ -e $root$includedir/bits/stdio_lim.h ] || touch $root$includedir/bits/stdio_lim.h return fi ln -sf libbsd-compat.a $root/usr/$slibdir/libbsd.a # Misc. stuff # if atstage native; then # install locales and linuxthread manpages eval $MAKE localedata/install-locales cp ../localedata/SUPPORTED $root/usr/share/i18n/ if [ $SDECFG_PKG_GLIBC_TLS != 1 ]; then mkdir -p $root/usr/share/man/man3 if [ -f /usr/bin/perl ] ; then eval $MAKE -C ../linuxthreads/man \ MANDIR=$root/usr/share/man/man3 all install fi # copy linuxthreads and crypt documentation cp ../linuxthreads/ChangeLog $docdir/ChangeLog.threads cp ../linuxthreads/Changes $docdir/Changes.threads cp ../linuxthreads/README $docdir/README.threads cp ../linuxthreads/FAQ.html $docdir/FAQ-threads.html cp -r ../linuxthreads/Examples $docdir/examples.threads fi else # at least prepare the locale dir mkdir -p $root$libdir/locale fi cp ../crypt/README.ufc-crypt $root$docdir/README.crypt # NSCD Init script and config # cp $confdir/{nscd,nsswitch}.conf $root/etc/ # Install ld.so.conf # if [ $slibdir = lib64 ] ; then cat > $root/etc/ld.so.conf <<-EOT /lib64 /lib /usr/lib64 /usr/lib /usr/X11/lib64 /usr/X11/lib /opt/*/lib64 /opt/*/lib /usr/local/lib64 /usr/local/lib EOT else cat > $root/etc/ld.so.conf <<-EOT /lib /usr/lib /usr/X11/lib /opt/*/lib /usr/local/lib EOT fi # Move 'ldconfig' and 'sln' binaries # if [ -f "$root/usr/sbin/ldconfig" ] ; then mv -v $root/usr/sbin/ldconfig $root/sbin/ldconfig fi if [ -f "$root/usr/sbin/sln" ] ; then mv -v $root/usr/sbin/sln $root/sbin/sln fi # Create /lib/ld-lsb.so.1 symlink # if [ -f $root/$slibdir/ld-linux-$arch_machine.so.2 ] ; then ln -vfs ld-linux-$arch_machine.so.2 $root/$slibdir/ld-lsb.so.1 elif [ -f $root/$slibdir/ld-linux.so.2 ] ; then ln -vfs ld-linux.so.2 $root/$slibdir/ld-lsb.so.1 fi } # in stage 0 we only extract the headers and all is a bit easier ... if atstage toolchain; then makeopt= makeinstopt="-k cross-compiling=yes install-headers" fi [[ $libdir = *lib64 ]] && slibdir=lib64 || slibdir=lib #if atstage cross; then # var_append patchfiles " " $confdir/no_path_in_glibcso.diff #fi hook_add prepatch 3 "glibc_prepatch" hook_add postmake 5 "glibc_postmake"