when the getcwd.c is compiled?

printk rtems at 21cn.com
Thu Apr 28 03:05:18 UTC 2016


On Wed, Apr 27, 2016 at 11:30:59AM -0500, Joel Sherrill wrote:
> On Apr 27, 2016 12:31 PM, "printk" <opentkernel at 163.com> wrote:
> >
> > Hello, I am translating Makefile.am(s) to kbuild
> >
> > > #
> > > # DIRECTORY_SCAN_C_FILES =
> > > # ## Newlib SHOULD have provided this one
> > > # DIRECTORY_SCAN_C_FILES += src/readdir_r.c
> > > # ## Comment out when using these from newlib's unix directory
> > > # DIRECTORY_SCAN_C_FILES += src/getcwd.c
> > > #
> > > # ID_C_FILES = src/getegid.c src/geteuid.c src/getgid.c src/getgroups.c
> \
> > > #     src/getlogin.c src/getpgrp.c src/getpid.c src/getppid.c
> src/getuid.c \
> > > #     src/seteuid.c src/setgid.c src/setuid.c src/setegid.c
> src/setpgid.c \
> > > #     src/setsid.c
> > >
> > > CONFIG_DIRECTORY_SCAN_C_FILES := y
> > > obj-$(CONFIG_DIRECTORY_SCAN_C_FILES) += readdir_r.o
> > > #ERROR obj-$(CONFIG_DIRECTORY_SCAN_C_FILES) += getcwd.o
> >
> > --> # ## Comment out when using these from newlib's unix directory
> > is this means when compiling with newlib, the getcwd.c is not needed?
> > now the arm-rtemsX.XX-gcc is with newlib. is this file not compiled?
> 
> That's how I would interpret it. Are the files sti present?
> 
> Are the methods really coming from newlib?

I pull the lastest(20160428) newlib, find getcwd.c there:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
> du at book:~/source/newlib-cygwin$ find -name getcwd.c
> ./newlib/libc/unix/getcwd.c
> ./libgloss/spu/getcwd.c
> 
> du at book:~/source/newlib-cygwin$ head -3 ./newlib/libc/unix/getcwd.c 
> #ifndef _NO_GETCWD
> /*
> * Copyright (c) 1989, 1991 The Regents of the University of California.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
in RTEMS, the getcwd.c is compiled by checking the build log.

so shall we remove this file or add a macro to control? like:

> ifdef NEWLIB
> # DIRECTORY_SCAN_C_FILES += src/getcwd.c
> endif
> not comment it out by hand.
> 
> by the way,(1) what is this libcsupport's goal?

is files exist in standar C lib(newlib) can be removed?
or mark as a option?

> 
> > ...
> > duhuanpeng.
> > u74147@gmail.com
> >
> >
> > _______________________________________________
> > devel mailing list
> > devel at rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel

> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


...
duhuanpeng.
u74147@gmail.com


More information about the devel mailing list