This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: mip64el, RHEL6, sendfile64 not implemented


On Thu, Nov 15, 2012 at 11:45:57AM -0500, Carlos O'Donell wrote:
> Yili,
> 
> Please keep libc-help@sourceware.org in the CC,
> this is a community, not a free support service.
> 

(1) I'm sorry.
> (1) Don't rebuild glibc if you don't have to.
> 
> Why are you rebuilding glibc for nginx? Why not use the glibc already
> provided by your distribution?
> 
> Unless you have a very very strong reason I highly recommend using the
> glibc from your distribution.
> 
> Building core parts of the distribution is not an easy task and requires
> significant knowledge about these pieces. You are definitely free to do
> as you wish, but if your goal is to run nginx, then you may be in for a
> long learning session.
I'm fix some bug, not only nginx, but also a mail server, both of which 
used sendfile64, so I must fix the bug of glibc in case of more and more
application programs use sendfile64.
> (2) Why use a 2.12 src rpm?
> 
> Why do you want to build from the 2.12 src rpm?
Because I used RHEL 6, glibc-2.12 src rpm is from the RHEL6, I'm afraid of
some compatible problem if I use other version.
 
> If you need to build a toolchain for MIPS I would suggest using
> crosstool-ng to do the build and using sources that they have tested
> together.
Iâve build mips64el-unknown-linux-gnu from crosstool-ng, but when I use
sendfile64, gcc still report the the same warning.

this is the config of mips64el-unkown-linux-gnu:
#
# Automatically generated make config: don't edit
# crosstool-NG hg+default-08aecbc69f12 Configuration
# Tue Nov 13 17:29:24 2012
#
CT_CONFIGURE_has_xz=y
CT_CONFIGURE_has_cvs=y
CT_CONFIGURE_has_svn=y
CT_MODULES=y

#
# Paths and misc options
#

#
# crosstool-NG behavior
#
# CT_OBSOLETE is not set
CT_EXPERIMENTAL=y
# CT_DEBUG_CT is not set

#
# Paths
#
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_CUSTOM_LOCATION_ROOT_DIR=""
CT_WORK_DIR="${CT_TOP_DIR}/.build"
CT_PREFIX_DIR="${HOME}/x-tools/${CT_TARGET}"
CT_INSTALL_DIR="${CT_PREFIX_DIR}"
CT_RM_RF_PREFIX_DIR=y
CT_REMOVE_DOCS=y
CT_INSTALL_DIR_RO=y
CT_STRIP_ALL_TOOLCHAIN_EXECUTABLES=y

#
# Downloading
#
CT_CONNECT_TIMEOUT=10

#
# Extracting
#
CT_OVERIDE_CONFIG_GUESS_SUB=y
CT_PATCH_BUNDLED=y
CT_PATCH_ORDER="bundled"

#
# Build behavior
#
CT_PARALLEL_JOBS=0
CT_LOAD=0
CT_USE_PIPES=y
CT_EXTRA_FLAGS_FOR_HOST=""
CT_CONFIG_SHELL_BASH=y
CT_CONFIG_SHELL="${bash}"

......
#
# Target options
#
CT_ARCH="mips"
CT_ARCH_SUPPORTS_BOTH_ENDIAN=y
CT_ARCH_SUPPORTS_32=y
CT_ARCH_SUPPORTS_64=y
CT_ARCH_SUPPORTS_WITH_ARCH=y
CT_ARCH_SUPPORTS_WITH_TUNE=y
CT_ARCH_SUPPORTS_WITH_FLOAT=y
CT_ARCH_DEFAULT_BE=y
CT_ARCH_DEFAULT_32=y
CT_ARCH_ARCH=""
CT_ARCH_TUNE=""
# CT_ARCH_BE is not set
CT_ARCH_LE=y
# CT_ARCH_32 is not set
CT_ARCH_64=y
CT_ARCH_BITNESS=64
# CT_ARCH_FLOAT_HW is not set
CT_ARCH_FLOAT_SW=y
CT_TARGET_CFLAGS=""
CT_TARGET_LDFLAGS=""
CT_ARCH_mips=y
CT_ARCH_alpha_AVAILABLE=y
CT_ARCH_arm_AVAILABLE=y
CT_ARCH_avr32_AVAILABLE=y
CT_ARCH_blackfin_AVAILABLE=y
CT_ARCH_m68k_AVAILABLE=y
CT_ARCH_microblaze_AVAILABLE=y
CT_ARCH_mips_AVAILABLE=y
CT_ARCH_powerpc_AVAILABLE=y
CT_ARCH_s390_AVAILABLE=y
CT_ARCH_sh_AVAILABLE=y
CT_ARCH_sparc_AVAILABLE=y
CT_ARCH_x86_AVAILABLE=y

#
# Generic target options
#
# CT_MULTILIB is not set
CT_ARCH_USE_MMU=y
CT_ARCH_ENDIAN="little"

#
# Target optimisations
#
CT_ARCH_FLOAT="soft"

#
# mips other options
#
# CT_ARCH_mips_n32 is not set
CT_ARCH_mips_n64=y
CT_ARCH_mips_ABI="64"

#
# Toolchain options
#

#
# General toolchain options
#
CT_FORCE_SYSROOT=y
CT_USE_SYSROOT=y
CT_SYSROOT_NAME="sysroot"
CT_SYSROOT_DIR_PREFIX=""
CT_WANTS_STATIC_LINK=y
# CT_STATIC_TOOLCHAIN is not set
CT_TOOLCHAIN_PKGVERSION=""
CT_TOOLCHAIN_BUGURL=""

#
# Tuple completion and aliasing
#
CT_TARGET_VENDOR="unknown"
CT_TARGET_ALIAS_SED_EXPR=""
CT_TARGET_ALIAS=""

#
# Toolchain type
#
# CT_NATIVE is not set
CT_CROSS=y
# CT_CROSS_NATIVE is not set
# CT_CANADIAN is not set
CT_TOOLCHAIN_TYPE="cross"

#
# Build system
#
CT_BUILD=""
CT_BUILD_PREFIX=""
CT_BUILD_SUFFIX=""

#
# Misc options
#
# CT_TOOLCHAIN_ENABLE_NLS is not set

#
# Operating System
#
CT_KERNEL_SUPPORTS_SHARED_LIBS=y
CT_KERNEL="linux"
CT_KERNEL_VERSION="2.6.32.60"
# CT_KERNEL_bare_metal is not set
CT_KERNEL_linux=y
CT_KERNEL_bare_metal_AVAILABLE=y
CT_KERNEL_linux_AVAILABLE=y
CT_KERNEL_V_2_6_32_60=y
CT_KERNEL_mingw32_AVAILABLE=y

#
# Common kernel options
#
CT_SHARED_LIBS=y

#
# linux other options
#
CT_KERNEL_LINUX_VERBOSITY_0=y
CT_KERNEL_LINUX_VERBOSE_LEVEL=0
CT_KERNEL_LINUX_INSTALL_CHECK=y

#
# Binary utilities
#
CT_ARCH_BINFMT_ELF=y

#
# GNU binutils
#
CT_BINUTILS_V_2_19_1a=y
CT_BINUTILS_VERSION="2.19.1a"
CT_BINUTILS_2_19_or_later=y
CT_BINUTILS_2_18_or_later=y
CT_BINUTILS_HAS_HASH_STYLE=y
CT_BINUTILS_HAS_PKGVERSION_BUGURL=y
CT_BINUTILS_FORCE_LD_BFD=y
CT_BINUTILS_LINKER_LD=y
CT_BINUTILS_LINKERS_LIST="ld"
CT_BINUTILS_LINKER_DEFAULT="bfd"
CT_BINUTILS_EXTRA_CONFIG_ARRAY=""
# CT_BINUTILS_FOR_TARGET is not set

#
# C compiler
#
CT_CC="gcc"
CT_CC_VERSION="4.4.0"
CT_CC_gcc=y
CT_CC_V_4_4_0=y
CT_CC_GCC_4_2_or_later=y
CT_CC_GCC_4_3_or_later=y
CT_CC_GCC_4_4=y
CT_CC_GCC_4_4_or_later=y
CT_CC_GCC_HAS_GRAPHITE=y
CT_CC_GCC_HAS_PKGVERSION_BUGURL=y
CT_CC_GCC_USE_GMP_MPFR=y
# CT_CC_LANG_FORTRAN is not set
CT_CC_SUPPORT_CXX=y
CT_CC_SUPPORT_FORTRAN=y
CT_CC_SUPPORT_JAVA=y
CT_CC_SUPPORT_ADA=y
CT_CC_SUPPORT_OBJC=y
CT_CC_SUPPORT_OBJCXX=y

#
# Additional supported languages:
#
CT_CC_LANG_CXX=y
CT_CC_LANG_OTHERS=""

#
# gcc other options
#
CT_CC_ENABLE_CXX_FLAGS=""
CT_CC_CORE_EXTRA_CONFIG_ARRAY=""
CT_CC_EXTRA_CONFIG_ARRAY=""
CT_CC_STATIC_LIBSTDCXX=y
# CT_CC_GCC_SYSTEM_ZLIB is not set

#
# Optimisation features
#
# CT_CC_GCC_USE_GRAPHITE is not set

#
# Settings for libraries running on target
#
CT_CC_GCC_ENABLE_TARGET_OPTSPACE=y

#
# Misc. obscure options.
#
CT_CC_CXA_ATEXIT=y
# CT_CC_GCC_DISABLE_PCH is not set
CT_CC_GCC_SJLJ_EXCEPTIONS=m
CT_CC_GCC_LDBL_128=m
CT_CC_GCC_HAS_ARCH_OPTIONS=y

#
# archictecture-specific options
#
CT_CC_GCC_mips_llsc=m
CT_CC_GCC_mips_synci=m

#
# C-library
#
CT_LIBC="eglibc"
CT_LIBC_VERSION="2_12"
CT_LIBC_eglibc=y
CT_LIBC_eglibc_AVAILABLE=y
CT_LIBC_EGLIBC_V_2_12=y
CT_LIBC_EGLIBC_2_12_or_later=y
CT_LIBC_EGLIBC_2_11_or_later=y
CT_LIBC_EGLIBC_2_10_or_later=y
CT_LIBC_EGLIBC_2_9_or_later=y
CT_LIBC_EGLIBC_HAS_PKGVERSION_BUGURL=y
CT_EGLIBC_REVISION="HEAD"
CT_LIBC_glibc_AVAILABLE=y
CT_LIBC_mingw_AVAILABLE=y
CT_LIBC_newlib_AVAILABLE=y
CT_LIBC_none_AVAILABLE=y
CT_LIBC_uClibc_AVAILABLE=y
CT_LIBC_SUPPORT_THREADS_ANY=y
CT_LIBC_SUPPORT_NPTL=y
CT_LIBC_SUPPORT_LINUXTHREADS=y
CT_THREADS="nptl"

#
# Common C library options
#
CT_THREADS_NPTL=y
# CT_THREADS_LINUXTHREADS is not set
CT_LIBC_XLDD=y

#
# eglibc other options
#
CT_LIBC_GLIBC_MAY_FORCE_PORTS=y
CT_LIBC_glibc_familly=y
CT_LIBC_GLIBC_EXTRA_CONFIG_ARRAY=""
CT_LIBC_GLIBC_CONFIGPARMS=""
CT_LIBC_GLIBC_EXTRA_CFLAGS=""
CT_LIBC_EXTRA_CC_ARGS=""
# CT_LIBC_ENABLE_FORTIFIED_BUILD is not set
# CT_LIBC_DISABLE_VERSIONING is not set
CT_LIBC_OLDEST_ABI=""
CT_LIBC_GLIBC_FORCE_UNWIND=y
CT_LIBC_GLIBC_USE_PORTS=y
CT_LIBC_ADDONS_LIST=""

......
CT_LIBC_GLIBC_KERNEL_VERSION_AS_HEADERS=y
CT_LIBC_GLIBC_MIN_KERNEL="2.6.32.60"

#
# Debug facilities
#
# CT_DEBUG_dmalloc is not set
# CT_DEBUG_duma is not set
CT_DEBUG_gdb=y
CT_GDB_CROSS=y
CT_GDB_CROSS_PYTHON=y
CT_GDB_CROSS_EXTRA_CONFIG_ARRAY=""
# CT_GDB_NATIVE is not set
CT_GDB_GDBSERVER=y
CT_GDB_GDBSERVER_HAS_IPA_LIB=y
CT_GDB_GDBSERVER_STATIC=y

#
# gdb version
#
# CT_DEBUG_GDB_SHOW_LINARO is not set
CT_GDB_V_7_4_1=y
CT_GDB_7_2_or_later=y
CT_GDB_7_0_or_later=y
CT_GDB_HAS_PKGVERSION_BUGURL=y
CT_GDB_INSTALL_GDBINIT=y
CT_GDB_VERSION="7.4.1"

#
# Companion libraries
#
CT_COMPLIBS_NEEDED=y
CT_GMP_NEEDED=y
CT_MPFR_NEEDED=y
CT_COMPLIBS=y
CT_GMP=y
CT_MPFR=y
CT_GMP_V_4_3_2=y
CT_GMP_VERSION="4.3.2"
CT_MPFR_V_2_4_2=y
CT_MPFR_VERSION="2.4.2"

> (3) Why doesn't glibc build correctly?
> 
> If you are determined to build from the 2.12 src rpm, and you *need* it
> for some reason, then ...
> 
> This looks like a bug in the source that you are using, or a configuration
> issue that caused the build not to recognize you are building for MIPS64.
> 
> The error means that sendfile64 was not created as a wrapper
> for the sendfile64 syscall and that instead the io/sendfile64.c stub
> was used. The stub is designed to issue a warning if any application
> tries to use a file that has a stub. Thus when you try to use gcc to
> link against your newly built glibc you get a warning about calling
> the stub which will do nothing.
> 
> The only way that the stub gets used is if
> sysdeps/unix/sysv/linux/wordsize-64/sendfile64.c is not built.
 sysdeps/unix/sysv/linux/wordsize-64/sendfile64.c is only one line:
 /* sendfile64 is alias of sendfile syscall.  */
> Can you confirm that sysdeps/unix/sysv/linux/wordsize-64/sendfile64.c
> was built, and that sysdeps/unix/sysv/linux/wordsize-64/ shows up as
> one of the sysdep dirs after `checking sysdep dirs...' in the output
> of the configuration step?
> 
Joseph S. Myers (joseph@codesourcery.com) says:
MIPS n64 does not use sysdeps/unix/sysv/linux/wordsize-64 because of
differences between struct stat and struct stat64.  To determine whether
some aspect of the sysdeps/unix/sysv/linux/wordsize-64 implementation of
some function should be copied for n64 you need to examine the interface
to the function, and the associated underlying syscall in the Linux
kernel, to determine whether such copying is correct in the particular
case.  Depending on the userspace interface to the function, and the
kernel syscall interface, in the particular case, it may or may not be
appropriate to handle n32 like n64 as well.

It would make sense for someone to go through everything in
sysdeps/unix/sysv/linux/wordsize-64, with reference to the MIPS syscall
interface, to work out what is correct and what is optimal for both n64
and n32 for each function.

I've test the interface of sendfile64 and sendfiel used with assembly 
language, which works well.

> Cheers,
> Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]