This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


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

Re: New (fake) functions to support libstdc++-v3 on mn10300-elf




Alexandre Oliva wrote:
> 
> Some functions in libstdc++-v3 call dup() and fcntl(), so I had to
> define them to get some programs linked, even though the functions are
> never actually called.  They're in the same translation unit of some
> other functions that are.  Perhaps they could be moved into separate
> ones?  It would at least solve the problem in case of static
> libraries.  Shared libraries would still be a problem, but I doubt any
> platform that supports shared libraries doesn't support dup() and
> fcntl().
> 
> Meanwhile, this patch gets the pass rate of C++ tests much better for
> mn10300-elf.  Ok to install?

Wouldn't it be better to put dummy dup and fcntl a directory level
higher in libgloss so other targets could get to them?

--joel

>   -------------------------------------------------------------------------------
> Index: libgloss/ChangeLog
> from  Alexandre Oliva  <aoliva@redhat.com>
> 
>         * mn10300/Makefile.in (GENOBJS): Added dup.o and fcntl.o.
>         * mn10300/dup.c, mn10300/fcntl.c: New files.
> 
> Index: libgloss/mn10300/Makefile.in
> ===================================================================
> RCS file: /cvs/src/src/libgloss/mn10300/Makefile.in,v
> retrieving revision 1.1
> diff -u -p -r1.1 Makefile.in
> --- libgloss/mn10300/Makefile.in 2000/03/17 22:48:51 1.1
> +++ libgloss/mn10300/Makefile.in 2001/04/26 13:33:31
> @@ -1,4 +1,4 @@
> -# Copyright (c) 1998 Cygnus Support
> +# Copyright (c) 1998, 2001 Cygnus Support
>  #
>  # The authors hereby grant permission to use, copy, modify, distribute,
>  # and license this software and its documentation for any purpose, provided
> @@ -67,7 +67,7 @@ CRT0 = crt0.o
> 
>  # Generic object files common to all targets.
>  GENOBJS = _exit.o access.o chmod.o close.o crt1.o \
> -       fstat.o getpid.o isatty.o \
> +       dup.o fcntl.o fstat.o getpid.o isatty.o \
>         kill.o lseek.o open.o read.o \
>         sbrk.o stat.o time.o trap.o unlink.o utime.o write.o
> 
> Index: libgloss/mn10300/dup.c
> ===================================================================
> RCS file: dup.c
> diff -N dup.c
> --- /dev/null   Tue May  5 13:32:27 1998
> +++ libgloss/mn10300/dup.c Thu Apr 26 06:33:31 2001
> @@ -0,0 +1,7 @@
> +/* Fake it by default, since libstdc++-v3 may call it.  */
> +
> +int
> +dup (int fd)
> +{
> +  return -1;
> +}
> Index: libgloss/mn10300/fcntl.c
> ===================================================================
> RCS file: fcntl.c
> diff -N fcntl.c
> --- /dev/null   Tue May  5 13:32:27 1998
> +++ libgloss/mn10300/fcntl.c Thu Apr 26 06:33:31 2001
> @@ -0,0 +1,7 @@
> +/* Fake it by default, since libstdc++-v3 may call it.  */
> +
> +int
> +_fcntl (int fd, int cmd)
> +{
> +  return -1;
> +}
> 
>   -------------------------------------------------------------------------------
> 
> --
> Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
> Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
> CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
> Free Software Evangelist    *Please* write to mailing lists, not to me

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel@OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985


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