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


Yili,

Please keep libc-help@sourceware.org in the CC,
this is a community, not a free support service.

On Thu, Nov 15, 2012 at 7:57 AM,  <yili0568@gmail.com> wrote:
> I build from glibc-2.12-1.7.el6.4.src.rpm
> There is some fragments of the glibc.spec
> ......
> %ifarch mips64el
> BuildFlags="-Wp,-D_FORTIFY_SOURCE=0"
> GCC="gcc -march=mips3 -mabi=64 -mplt -fPIC -fexceptions"
> GXX="g++ -march=mips3 -mabi=64 -mplt -fPIC -fexceptions"
> %endif
> ......
> EnableKernel="--enable-kernel=%{enablekernel}"
> echo "$GCC" > Gcc
> AddOns=`echo */configure | sed -e 's!/configure!!g;s!\(linuxthreads\|nptl\|rtkaio\|powerpc-cpu\)\( \|$\)!!g;s! \+$!!;s! !,!g;s!^!,!;/^,\*$/d'`
> %ifarch %{rtkaioarches}
> AddOns=,rtkaio$AddOns
> %endif
> AddOns=,ports$AddOns
>
> build_nptl()
> {
> builddir=build-%{nptl_target_cpu}-$1
> shift
> rm -rf $builddir
> mkdir $builddir ; cd $builddir
> build_CFLAGS="$BuildFlags -g -O3 $*"
> ../configure CC="$GCC" CXX="$GXX" CFLAGS="$build_CFLAGS" \
>         --prefix=%{_prefix} \
>         --enable-add-ons=nptl$AddOns --without-cvs $EnableKernel \
>         --with-headers=%{_prefix}/include --enable-bind-now \
>         --with-tls --with-__thread --build %{nptl_target_cpu}-redhat-linux \
>         --host %{nptl_target_cpu}-redhat-linux \
> %ifarch %{multiarcharches}
>         --enable-multi-arch \
> %endif
>         --disable-profile --enable-experimental-malloc --enable-nss-crypt \
>         libc_cv_slibdir='/lib'
>
> if I used sendfile64 in my application program. Gcc report that:
> warning: warning: sendfile64 is no implemented and will always fial.
> If I run the program, which will exit immediately and report the same
> warning.
>
> I build nginx in x86 and mips64 use the same configure, x86 works
> well, but mips64 can't work because of the sendfile64.

(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.

(2) Why use a 2.12 src rpm?

Why do you want to build from the 2.12 src rpm?

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.

(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.

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?

Cheers,
Carlos.


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