Feature Branch Windows Build Broken - lib/canonicalize.c - ELOOP & lstat

2005-05-24 Thread Conrad T. Pino
Hi All,

The new module "lib/canonicalize.c" fails to compile because it references
the symbolic error "ELOOP" which Windows does not define.

The new module "lib/canonicalize.c" calls the "lstat" function and there
is no prototype and no implementation on Windows platform we support.

We use "CVS_LSTAT" macro in the "src" directory which maps to "wnt_lstat"
which we implement in "windows-NT/filesubr.c".  We also have "lib/stat.c"
module.

Currently the Windows build doesn't use the "lib/stat.c" module.

The questions raised appear to be:

1. Where should an "ELOOP" definition be placed?

2. How should the "ELOOP" value be selected?

3. Which approach is best to resolve "lib/canonicalize.c" and "lstat"?

An incomplete patch set to the Windows build files is below to allow the
Visual Studio IDE build to complete up to the EXE link.  I plan to commit
a complete fix once a consensus on the above issues emerges.

Conrad Pino

Configuration: cvsnt - Win32 Debug
Linking...
libdiff.lib(canonicalize.obj) : error LNK2001: unresolved external symbol _lstat
.\WinDebug\cvs.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

cvs.exe - 2 error(s), 0 warning(s)


Index: cvsnt.dsp
===
RCS file: /cvs/ccvs/cvsnt.dsp,v
retrieving revision 1.30
diff -u -p -r1.30 cvsnt.dsp
--- cvsnt.dsp   8 Mar 2005 05:19:52 -   1.30
+++ cvsnt.dsp   24 May 2005 18:56:39 -
@@ -372,6 +372,10 @@ SOURCE=.\src\buffer.h
 # End Source File
 # Begin Source File
 
+SOURCE=.\lib\canonicalize.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\src\client.h
 # End Source File
 # Begin Source File
@@ -448,6 +452,10 @@ SOURCE=.\lib\gettext.h
 # End Source File
 # Begin Source File
 
+SOURCE=.\lib\glob.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\src\hardlink.h
 # End Source File
 # Begin Source File
Index: lib/libcvs.dsp
===
RCS file: /cvs/ccvs/lib/libcvs.dsp,v
retrieving revision 1.23
diff -u -p -r1.23 libcvs.dsp
--- lib/libcvs.dsp  17 May 2005 22:12:12 -  1.23
+++ lib/libcvs.dsp  24 May 2005 18:56:39 -
@@ -97,10 +97,18 @@ SOURCE=.\basename.c
 # End Source File
 # Begin Source File
 
+SOURCE=.\canonicalize.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\closeout.c
 # End Source File
 # Begin Source File
 
+SOURCE=".\cycle-check.c"
+# End Source File
+# Begin Source File
+
 SOURCE=.\dirname.c
 # End Source File
 # Begin Source File
@@ -308,6 +316,10 @@ SOURCE=.\allocsa.h
 # End Source File
 # Begin Source File
 
+SOURCE=.\canonicalize.h
+# End Source File
+# Begin Source File
+
 SOURCE=".\chdir-long.h"
 # End Source File
 # Begin Source File
@@ -320,6 +332,14 @@ SOURCE="..\windows-NT\config.h"
 # End Source File
 # Begin Source File
 
+SOURCE=".\cycle-check.h"
+# End Source File
+# Begin Source File
+
+SOURCE=".\dev-ino.h"
+# End Source File
+# Begin Source File
+
 SOURCE=.\dirname.h
 # End Source File
 # Begin Source File
@@ -426,6 +446,10 @@ SOURCE=.\gettext.h
 # End Source File
 # Begin Source File
 
+SOURCE=.\glob.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\glob_.h
 
 !IF  "$(CFG)" == "libcvs - Win32 Release"
@@ -457,6 +481,10 @@ SOURCE=.\md5.h
 # End Source File
 # Begin Source File
 
+SOURCE=.\mempcpy.h
+# End Source File
+# Begin Source File
+
 SOURCE="..\windows-NT\ndir.h"
 # End Source File
 # Begin Source File
@@ -465,6 +493,10 @@ SOURCE=.\pagealign_alloc.h
 # End Source File
 # Begin Source File
 
+SOURCE=".\path-concat.h"
+# End Source File
+# Begin Source File
+
 SOURCE=.\pathmax.h
 # End Source File
 # Begin Source File
@@ -497,6 +529,10 @@ SOURCE=.\setenv.h
 # End Source File
 # Begin Source File
 
+SOURCE=".\stat-macros.h"
+# End Source File
+# Begin Source File
+
 SOURCE="..\windows-NT\stdbool.h"
 # End Source File
 # Begin Source File
@@ -505,6 +541,10 @@ SOURCE="..\windows-NT\stdint.h"
 # End Source File
 # Begin Source File
 
+SOURCE=.\strdup.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\system.h
 # End Source File
 # Begin Source File
Index: windows-NT/config.h
===
RCS file: /cvs/ccvs/windows-NT/config.h,v
retrieving revision 1.144
diff -u -p -r1.144 config.h
--- windows-NT/config.h 24 May 2005 16:38:08 -  1.144
+++ windows-NT/config.h 24 May 2005 18:56:40 -
@@ -1314,3 +1314,5 @@ char *sock_strerror (int errnum);
 /* getpagesize is missing on Windows, but 4096 seems to do the right
thing. */
 #define getpagesize() 4096
+
+#define ELOOP -22


___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

We have a new "lib/glob.c" error today which I hope to
understand before committing "#include "
addition to "lib/glob_.h" you suggested.

The 3 new errors (see below) are all a single error
occurring in 3 places:

storage size of `st' isn't known

I'm throwing this out for comment while continuing
to investigate.

Conrad

/export/home/cvsusr/ccvs/cvs-1.12:$ make
make  all-recursive
Making all in lib
make  all-am
source='glob.c' object='glob.o' libtool=no \
DEPDIR=.deps depmode=gcc /bin/bash ../build-aux/depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I..-Ino/include  -g -O2 -c glob.c
glob.c: In function `rpl_glob':
glob.c:700: storage size of `st' isn't known
glob.c: In function `is_dir_p':
glob.c:1046: storage size of `st' isn't known
glob.c: In function `glob_in_dir':
glob.c:1094: storage size of `st' isn't known
*** Error code 1
make: Fatal error: Command failed for target `glob.o'
Current working directory /export/home/cvsusr/ccvs/cvs-1.12/lib
*** Error code 1
make: Fatal error: Command failed for target `all'
Current working directory /export/home/cvsusr/ccvs/cvs-1.12/lib
*** Error code 1
make: Fatal error: Command failed for target `all-recursive'
Current working directory /export/home/cvsusr/ccvs/cvs-1.12
*** Error code 1
make: Fatal error: Command failed for target `all'
/export/home/cvsusr/ccvs/cvs-1.12:$ 


___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


Re: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Derek Price
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Conrad T. Pino wrote:

>Hi Derek,
>
>We have a new "lib/glob.c" error today which I hope to
>understand before committing "#include "
>addition to "lib/glob_.h" you suggested.


Adding "#include " to glob_.h doesn't help with this new
error?  I wouldn't expect this error in glob.c anyhow, since it includes
 &  unconditionally.  According to POSIX.2,
struct stat should be defined in .  This same code, short of
a few recent changes, was compiling and passing tests on Solaris 8 the
other night.

Regards,

Derek
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCk3f2LD1OTBfyMaQRAtuHAJ98+uXWGRexlVslLWvfCE1+yCbMQQCgqvo6
JgiejX7f4tv94fJ5EEAz1Rk=
=9D5+
-END PGP SIGNATURE-




___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


Re: [bug-gnulib] New GNULIB glob module?

2005-05-24 Thread Paul Eggert
Derek Price <[EMAIL PROTECTED]> writes:

> +#else
> +/* Is there really a case where the getlogin or getlogin_r proto can come 
> from
> +   somewhere other than ?  */
> +# ifdef HAVE_GETLOGIN_R
> +extern int getlogin_r (char *, size_t);
> +# else
> +extern char *getlogin (void);
> +# endif
> +#endif

This comment is somewhat odd, and suggests that you're as troubled by the
code as I am.  How about if you replace the above by the following:

   #if ! HAVE_DECL_GETLOGIN_R
   # if ! HAVE_DECL_GETLOGIN
   char *getlogin (void);
   # endif
   static int
   getlogin_r (char *name, size_t size)
   {
 char *n = getlogin ();
 if (n)
   {
 size_t nlen = strlen (n);
 if (nlen < size)
   {
 memcpy (name, n, nlen + 1);
 return 0;
   }
 errno = ERANGE;
   }
 return -1;
   }
   #endif

and modify the rest of the code to assume that getlogin_r works, and
modify glob.m4 to check for whether getlogin and getlogin_r are
declared, rather than whether they exist.  Or, perhaps better, you can
create a getlogin_r module with the above code, and have the glob
module depend on that.

> +# ifdef HAVE___POSIX_GETPWNAM_R
> +   /* Solaris.  */
> +#  define getpwnam_r(name, bufp, buf, len, res) \
> +__posix_getpwnam_r (name, bufp, buf, len, res)
> +# endif

I don't see why this is needed.  The Solaris include files already
contain the magic necessary to convert getpwnam_r to
__posix_getpwnam_r, right?  Or is it because that depends on
_POSIX_PTHREAD_SEMANTICS?  If so, why not define that, as follows?  I
don't see why any gnulib-using application would want the nonstandard
Solaris versions of the *_r functions.

--- extensions.m4.~1.6.~2005-02-23 05:49:36 -0800
+++ extensions.m4   2005-05-24 12:35:48 -0700
@@ -21,6 +21,10 @@ AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS], [
 [/* Enable extensions on Solaris.  */
 #ifndef __EXTENSIONS__
 # undef __EXTENSIONS__
+#endif
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
 #endif])
   AC_DEFINE([__EXTENSIONS__])
+  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
 ])


> +#if defined _DIRENT_HAVE_D_TYPE || defined HAVE_STRUCT_DIRENT_D_TYPE
>  # define HAVE_D_TYPE 1
> -#endif

At this point it would be simpler and clearer if we removed these
lines, and removed all uses of HAVE_D_TYPE.  We can simply substitute
"#ifdef _DIRENT_HAVE_D_TYPE" for "#ifdef HAVE_D_TYPE" later.
(HAVE_STRUCT_DIRENT_D_TYPE isn't relevant for that ifdef.)


Now turning to glob_.h:

> +#if defined _LIBC || HAVE_SYS_CDEFS_H
> +# include 
> +#endif

Ouch.  I just noticed that this isn't right for the case where glob.h
is installed into /usr/include/glob.h as part of a typical C library
installation.  First, _LIBC won't be defined there.  Second, glibc
can't infringe on the user's name space by depending on HAVE_SYS_CDEFS_H.

One way to work around this is to rewrite it as follows:

#ifndef _SYS_CDEFS_H
# include 
#endif

where glob.m4 defines _SYS_CDEFS_H if sys/cdefs.h is missing.
This differs from the usual gnulib convention, but it might
be simplest.

Another possibility is to do "mkdir sys; echo '' >sys/cdefs.h" if
 is missing, so that "#include " always
works.  This is a bit yucky on the build side, though it simplifies
the source code.


> +/* We need `size_t' for the following definitions.  */
> +#ifdef _LIBC
> +__BEGIN_DECLS

The comment seems a bit misplaced now.

How about if we build on my previous suggestion above, as follows?

#ifndef _SYS_CDEFS_H
# include 
#endif
#ifndef __BEGIN_DECLS
# define __BEGIN_DECLS
# define __END_DECLS
# define __THROW
#endif

and remove the existing "define __THROW".  This makes it clearer that
these three macros are defined by sys/cdefs.h.  Then we can keep the
__BEGIN_DECLS, __THROW, etc. stuff just the way that glibc has it.


> +#if defined _LIBC && defined __USE_LARGEFILE64
> +# ifdef __USE_GNU
> +struct stat64;
> +# endif

This isn't right, since glob.h can't depend on _LIBC (as mentioned above).
Please replace "defined _LIBC" with "!defined GLOB_PREFIX", everywhere
that you see _LIBC used (other than the changes already mentioned above).

> -# if defined __GNUC__ && __GNUC__ >= 2

This doesn't look right, since when installed as a part of glibc, the
header must be useable by GCC 1, or by non-GCC compilers.  Shouldn't
we leave this stuff in?  You might want to change it to

  # if defined __GNUC__ && __GNUC__ >= 2 && !defined GLOB_PREFIX

> -#if __USE_FILE_OFFSET64 && __GNUC__ < 2
> -# define glob glob64
> -# define globfree globfree64

Similarly, this code should be left in, with the first line changed to

  #if __USE_FILE_OFFSET64 && __GNUC__ < 2 && !defined GLOB_PREFIX

> -#if !defined __USE_FILE_OFFSET64 || __GNUC__ < 2
> +#if !defined _LIBC || !defined __USE_FILE_OFFSET64

Similarly, this should be:

  #if !defined __USE_FILE_OFFSET64 || __GNUC__ < 2 || defined GLOB_PREFIX


___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.o

RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

> From: Derek Price [mailto:[EMAIL PROTECTED]
> 
> Adding "#include " to glob_.h doesn't help with this new
> error?  ...

That is correct.  

Neither of (1) uncondition inclusion nor (2) inclusion conditioned upon
"__USE_GNU" made a difference.

> ...  I wouldn't expect this error in glob.c anyhow, since it includes
>  &  unconditionally.  According to POSIX.2,
> struct stat should be defined in .  This same code, short of
> a few recent changes, was compiling and passing tests on Solaris 8 the
> other night.

This platform's "sys/stat.h" uses a *lot* of conditional compilation and
we may have triggered a case where no "struct stat" definition compiles.
I haven't proved this yet and testing this hypothesis is my next line of
investigation unless you favor another.

Can you take a quick look at this platform's "sys/stat.h" (below) to see
if there's something obvious to your greater experience?

> Regards,

Ditto,

> Derek

Conrad

/export/home/cvsusr:$ cat /usr/include/sys/stat.h
/*
 * Copyright (c) 1995-1999 by Sun Microsystems, Inc.
 * All rights reserved.
 */

/*  Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
/*  Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T   */
/*  All Rights Reserved */

/*  THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF  */
/*  UNIX System Laboratories, Inc.  */
/*  The copyright notice above does not evidence any*/
/*  actual or intended publication of such source code. */

#ifndef _SYS_STAT_H
#define _SYS_STAT_H

#pragma ident   "@(#)stat.h 1.2 99/05/19 SMI"

#include 
#include 

#ifdef  __cplusplus
extern "C" {
#endif

/*
 * The implementation specific header  includes a
 * definition for timestruc_t needed by the stat structure.  However,
 * including either , which includes , or
 * including  directly will break both X/Open and
 * POSIX namespace. Preceeding tag, structure, and structure member
 * names with underscores eliminates the namespace breakage and at the
 * same time, with unique type names, eliminates the possibility of
 * timespec_t or timestruct_t naming conflicts that could otherwise
 * result based on the order of inclusion of  and
 * .  The header  contains the
 * standards namespace safe versions of these definitions.
 */
#if !defined(_XOPEN_SOURCE) && !defined(_POSIX_C_SOURCE) || \
defined(__EXTENSIONS__)
#include 
#else
#include 
#endif /* !defined(_XOPEN_SOURCE) && !defined(_POSIX_C_SOURCE) || ... */

#define _ST_FSTYPSZ 16  /* array size for file system type name */

/*
 * stat structure, used by stat(2) and fstat(2)
 */

#if defined(_KERNEL)

/* Old SVID stat struct (SVR3.x) */

struct  o_stat {
o_dev_t st_dev;
o_ino_t st_ino;
o_mode_tst_mode;
o_nlink_t   st_nlink;
o_uid_t st_uid;
o_gid_t st_gid;
o_dev_t st_rdev;
off32_t st_size;
time32_tst_atime;
time32_tst_mtime;
time32_tst_ctime;
};

/* Expanded stat structure */

#if defined(_LP64)

struct stat {
dev_t   st_dev;
ino_t   st_ino;
mode_t  st_mode;
nlink_t st_nlink;
uid_t   st_uid;
gid_t   st_gid;
dev_t   st_rdev;
off_t   st_size;
timestruc_t st_atim;
timestruc_t st_mtim;
timestruc_t st_ctim;
blksize_t   st_blksize;
blkcnt_tst_blocks;
charst_fstype[_ST_FSTYPSZ];
};

struct stat64 {
dev_t   st_dev;
ino_t   st_ino;
mode_t  st_mode;
nlink_t st_nlink;
uid_t   st_uid;
gid_t   st_gid;
dev_t   st_rdev;
off_t   st_size;
timestruc_t st_atim;
timestruc_t st_mtim;
timestruc_t st_ctim;
blksize_t   st_blksize;
blkcnt_tst_blocks;
charst_fstype[_ST_FSTYPSZ];
};

#else   /* _LP64 */

struct  stat {
dev_t   st_dev;
longst_pad1[3]; /* reserve for dev expansion, */
/* sysid definition */
ino_t   st_ino;
mode_t  st_mode;
nlink_t st_nlink;
uid_t   st_uid;
gid_t   st_gid;
dev_t   st_rdev;
longst_pad2[2];
off_t   st_size;
longst_pad3;/* pad for future off_t expansion */
timestruc_t st_atim;
timestruc_t st_mtim;
timestruc_t st_ctim;
blksize_t   st_blksize;
blkcnt_tst_blocks;
charst_fstype[_ST_FSTYPSZ];
longst_pad4[8]; /* expansion area */
};

struct  stat64 {

RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

> From: Derek Price
> 
> >1. #include  within glob_.h file.
> 
> This would be the way to go.  You may commit this if you wish.

I committed an inclusion immediately before "struct stat" forward
declaration to assure the Solaris "stat" macro is used but on 2nd
reflection the forward declaration is moot.  I'm considering it's
removal.  Any objection on your part?

> >2. Move #include  below #include  in glob.c file.
> 
> This is incorrect.  The GNULIB convention is to include a module's
> header immediately following the include of  in its associated
> source file (i.e. glob.c first including config.h then immediately
> including glob.h) to test the module's interface.

Thank you.

> Regards,

Ditto,

> Derek

Conrad


___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


Re: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Derek Price
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

It looks like your header is using some sort of #pragma to redefine the
function names, which I would hope would make them look less like macros
and actually remap the functions, allowing us to use the macros in
glob.c as they stand.

You are still encountering this problem with the latest glob.c?  We were
encountering problems using the *64 structs and functions on HP-UX and I
rewrote the file this morning to attempt to let compiler magic take care
of the 64 bit conversion, which is supposed to work transparently on all
systems.

Regards,

Derek


Conrad T. Pino wrote:

>Hi Derek,
>
>This platform's "sys/stat.h" implementation in this case
>defines macros for "stat", "fstat" and "lstat" to be the
>tokens "stat64", "fstat64" and "lstat64" respectively.
>My analysis of "sys/stat.h" relevent section is below.
>
>These macro definitions are in effect when "struct stat"
>definition is encountered which becomes "struct stat64".
>
>Line 187 of "lib/glob.c" redefines "stat64" as:
>
> # define stat64 stat
>
>which causes later "struct stat" references to be become
>"struct stat64" which becomes "struct stat" which is an
>empty forward declaration at best.
>
>It seems defining macros for "stat", "fstat", "lstat",
>"stat64", "fstat64" and "lstat64" on this platform is
>a risky proposition.
>
>Conrad
>
>/*
> * large file compilation environment setup
> */
>#if !defined(_LP64) && _FILE_OFFSET_BITS == 64
>// This is true #error Die
>#ifdef __PRAGMA_REDEFINE_EXTNAME
>// This is false #error Die
>#pragma redefine_extname fstat fstat64
>#pragma redefine_extname stat stat64
>
>#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || \
> defined(_XPG4_2) || defined(__EXTENSIONS__)
>// This is false #error Die
>#pragma redefine_extname lstat lstat64
>#endif
>#else /* __PRAGMA_REDEFINE_EXTNAME */
>// This is true #error Die
>#define fstat fstat64
>#define stat stat64
>#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || \
> defined(_XPG4_2) || defined(__EXTENSIONS__)
>// This is true #error Die
>#define lstat lstat64
>#endif
>#endif /* __PRAGMA_REDEFINE_EXTNAME */
>#endif /* !_LP64 && _FILE_OFFSET_BITS == 64 */
>

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCk5rLLD1OTBfyMaQRAhbVAJ4weUVLak0/PGsMQUPYxK+mVgy91gCeMJSV
Z/A53LJrStIsU8S9irOFLlY=
=MgP1
-END PGP SIGNATURE-




___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


Re: Feature Branch Windows Build Broken - lib/canonicalize.c - ELOOP & lstat

2005-05-24 Thread Derek Price
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Conrad T. Pino wrote:

>Hi All,
>
>The new module "lib/canonicalize.c" fails to compile because it references
>the symbolic error "ELOOP" which Windows does not define.
>
>The new module "lib/canonicalize.c" calls the "lstat" function and there
>is no prototype and no implementation on Windows platform we support.
>
>We use "CVS_LSTAT" macro in the "src" directory which maps to "wnt_lstat"
>which we implement in "windows-NT/filesubr.c". We also have "lib/stat.c"
>module.


I've just checked in a patch which replaces all references to "CVS_STAT"
with "stat" and all references to "CVS_LSTAT" with "lstat".  I've made
changes to the GNULIB modules to support this and submitted the changes
back to GNULIB.  I also checked them into CVS to speed up our resolution
of this issue.

>Currently the Windows build doesn't use the "lib/stat.c" module.


I think it shouldn't.  the GNULIB stat and lstat modules replace stat
and lstat when some specific UNIX bugs are encountered, but rely on the
underlying stat & lstat to work.  The simplest thing to do at this point
would probably just be to #define stat wnt_stat and #define lstat
wnt_lstat in windows-NT/config.h.in.in.

If you are feeling particularly motivated to ramp up the Windows support
in GNULIB, you could try to package the work wnt_stat and wnt_lstat do
on Windows into the GNULIB stat module and submit the whole back to
bug-gnulib@gnu.org, but it shouldn't be necessary and there has been
serious resistance there to adding anything to GNULIB modules like the
GetUTCFileModTime Windows system call that check_statbuf appears to be
making.

>The questions raised appear to be:
>
>1. Where should an "ELOOP" definition be placed?
>
>2. How should the "ELOOP" value be selected?


These are good questions.  Is there any similar errno macro on Windows
to ELOOP?  ELOOP happens on UNIX when a program encounters symbolic
links like this:

ln -s dir2 dir1(dir1 --> dir2)
ln -s dir1 dir2(dir2 --> dir1)

and then a function is asked to evaluate a path containing one of these
elements, like `./dir1/sdir/file'.  Is something similar possible with
Windows links?  If so, there should be a "correct" substitute for ELOOP
on Windows.

>An incomplete patch set to the Windows build files is below to allow the
>Visual Studio IDE build to complete up to the EXE link. I plan to commit
>a complete fix once a consensus on the above issues emerges.


The ELOOP definition in your patch may not be the best, but your build
file changes should be fine.

Cheers,

Derek
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCk5i/LD1OTBfyMaQRAmpzAKCtKaFhT+SCkBBAyBiZqVdDMh8oqACgngpx
VyNsMm+TNZhbrpY6s6CKUs8=
=BD3e
-END PGP SIGNATURE-




___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

This platform's "sys/stat.h" implementation in this case
defines macros for "stat", "fstat" and "lstat" to be the
tokens "stat64", "fstat64" and "lstat64" respectively.
My analysis of "sys/stat.h" relevent section is below.

These macro definitions are in effect when "struct stat"
definition is encountered which becomes "struct stat64".

Line 187 of "lib/glob.c" redefines "stat64" as:

# define stat64 stat

which causes later "struct stat" references to be become
"struct stat64" which becomes "struct stat" which is an
empty forward declaration at best.

It seems defining macros for "stat", "fstat", "lstat",
"stat64", "fstat64" and "lstat64" on this platform is
a risky proposition.

Conrad

/*
 * large file compilation environment setup
 */
#if !defined(_LP64) && _FILE_OFFSET_BITS == 64
// This is true #error Die
#ifdef  __PRAGMA_REDEFINE_EXTNAME
// This is false #error Die
#pragma redefine_extnamefstat   fstat64
#pragma redefine_extnamestatstat64

#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || \
defined(_XPG4_2) || defined(__EXTENSIONS__)
// This is false #error Die
#pragma redefine_extnamelstat   lstat64
#endif
#else   /* __PRAGMA_REDEFINE_EXTNAME */
// This is true #error Die
#define fstat   fstat64
#define statstat64
#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || \
defined(_XPG4_2) || defined(__EXTENSIONS__)
// This is true #error Die
#define lstat   lstat64
#endif
#endif  /* __PRAGMA_REDEFINE_EXTNAME */
#endif  /* !_LP64 && _FILE_OFFSET_BITS == 64 */



___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

> From: Derek Price [mailto:[EMAIL PROTECTED]
> 
> It looks like your header is using some sort of #pragma to redefine the
> function names, which I would hope would make them look less like macros
> and actually remap the functions, allowing us to use the macros in
> glob.c as they stand.

The header file contains "#pragma redefine_extname ..." but they're not in
use because macro "__PRAGMA_REDEFINE_EXTNAME" is not defined.

A test compile with "__PRAGMA_REDEFINE_EXTNAME" defined on the command line
completes with no errors and no warnings.

> You are still encountering this problem with the latest glob.c?  We were
> encountering problems using the *64 structs and functions on HP-UX and I
> rewrote the file this morning to attempt to let compiler magic take care
> of the 64 bit conversion, which is supposed to work transparently on all
> systems.

Yes.

I updated before starting this morning.  I update as CVS commit messages
are noticed when downloading my email.

> Regards,

Ditto,

> Derek

Conrad



___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


Re: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Derek Price
Conrad T. Pino wrote:

>Hi Derek,
>
>  
>
>>From: Derek Price
>>
>>
>>
>>>1. #include  within glob_.h file.
>>>  
>>>
>>This would be the way to go.  You may commit this if you wish.
>>
>>
>
>I committed an inclusion immediately before "struct stat" forward
>declaration to assure the Solaris "stat" macro is used but on 2nd
>reflection the forward declaration is moot.  I'm considering it's
>removal.  Any objection on your part?
>  
>

No objections here.  Please do so.  Also, please shorten this comment to
something like "get struct stat":

/* Solaris may "#define stat stat64" in some cases */

Thanks,

Derek



___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

> From: Derek Price [mailto:[EMAIL PROTECTED]
> >
> >I committed an inclusion immediately before "struct stat" forward
> >declaration to assure the Solaris "stat" macro is used but on 2nd
> >reflection the forward declaration is moot.  I'm considering it's
> >removal.  Any objection on your part?
> 
> No objections here.  Please do so.  Also, please shorten this comment to
> something like "get struct stat":
> 
> /* Solaris may "#define stat stat64" in some cases */

Done.

We have a new warning in "lib/glob.c" compile:

In file included from glob.h:100,
 from glob.c:23:
/usr/include/sys/stat.h:175: warning: `lstat' redefined
../config.h:1135: warning: this is the location of the previous 
definition

and prior "storage size of `st' isn't known" are still true.

Defining macro "__PRAGMA_REDEFINE_EXTNAME" on the command line stops all errors
and warnings in "lib/glob.c" compile.

> Thanks,

You're welcome,

> Derek

Conrad

/export/home/cvsusr/ccvs/cvs-1.12:$ make
make  all-recursive
Making all in lib
make  all-am
source='glob.c' object='glob.o' libtool=no \
DEPDIR=.deps depmode=gcc /bin/bash ../build-aux/depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I..-Ino/include  -g -O2 -c glob.c
In file included from glob.h:100,
 from glob.c:23:
/usr/include/sys/stat.h:175: warning: `lstat' redefined
../config.h:1135: warning: this is the location of the previous definition
glob.c: In function `rpl_glob':
glob.c:700: storage size of `st' isn't known
glob.c: In function `is_dir_p':
glob.c:1046: storage size of `st' isn't known
glob.c: In function `glob_in_dir':
glob.c:1094: storage size of `st' isn't known
*** Error code 1
make: Fatal error: Command failed for target `glob.o'
Current working directory /export/home/cvsusr/ccvs/cvs-1.12/lib
*** Error code 1
make: Fatal error: Command failed for target `all'
Current working directory /export/home/cvsusr/ccvs/cvs-1.12/lib
*** Error code 1
make: Fatal error: Command failed for target `all-recursive'
Current working directory /export/home/cvsusr/ccvs/cvs-1.12
*** Error code 1
make: Fatal error: Command failed for target `all'
/export/home/cvsusr/ccvs/cvs-1.12:$ 


___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Windows Build Broken - lib/canonicalize.c - ELOOP & lstat

2005-05-24 Thread Conrad T. Pino
Hi Derek,

> From: Derek Price
> 
> I've just checked in a patch which replaces all references to "CVS_STAT"
> with "stat" and all references to "CVS_LSTAT" with "lstat".  I've made
> changes to the GNULIB modules to support this and submitted the changes
> back to GNULIB.  I also checked them into CVS to speed up our resolution
> of this issue.

I'm sorry to see CVS_STAT and CVS_LSTAT go.  They provided an abstraction
that made CVS less platform bound.  The change makes us consistent with
GNU Lib which wouldn't be a problem if they were open to Windows native
API calls in GNU Lib code.

> >Currently the Windows build doesn't use the "lib/stat.c" module.
> 
> I think it shouldn't.  the GNULIB stat and lstat modules replace stat
> and lstat when some specific UNIX bugs are encountered, but rely on the
> underlying stat & lstat to work.  The simplest thing to do at this point
> would probably just be to #define stat wnt_stat and #define lstat
> wnt_lstat in windows-NT/config.h.in.in.

I agree this is simpler given the removal of CVS_STAT and CVS_LSTAT and
GNULIB Windows support state.

> If you are feeling particularly motivated to ramp up the Windows support
> in GNULIB, you could try to package the work wnt_stat and wnt_lstat do
> on Windows into the GNULIB stat module and submit the whole back to
> bug-gnulib@gnu.org, but it shouldn't be necessary and there has been
> serious resistance there to adding anything to GNULIB modules like the
> GetUTCFileModTime Windows system call that check_statbuf appears to be
> making.

I'm willing to take on only what's possible and your opinion counts:

Does GNULIB include the Windows platform in it's charter?

If yes, what's your take on the resistance to Windows native API calls?

> These are good questions.  Is there any similar errno macro on Windows
> to ELOOP?  ELOOP happens on UNIX when a program encounters symbolic
> links like this:
> 
> ln -s dir2 dir1(dir1 --> dir2)
> ln -s dir1 dir2(dir2 --> dir1)
> 
> and then a function is asked to evaluate a path containing one of these
> elements, like `./dir1/sdir/file'.  Is something similar possible with
> Windows links?  If so, there should be a "correct" substitute for ELOOP
> on Windows.

The short answers are "no" and long answers follow:

The Windows "errno.h" file is below.

No Windows file system I'm aware of supports symbolic links.  The closest
Windows concepts are the "Shortcut" which is a special binary file with a
"*.lnk" extension and the "reparse point".  I can't say how they look to
the native file API.

The Windows NTFS supports hard links which I assume are supported in the
native API since MKS "ln" utility can creates them but their use is rare
since the Windows user interface provides no support to create them.

http://msdn.microsoft.com/library/en-us/fileio/fs/hard_links_and_junctions.asp

Microsoft doesn't support directory hard links.
I'm don't know if reparse point loops are possible.

Since our Windows support is "client" mode only do loops matter?

> Cheers,

Ditto,

> Derek

Conrad

/***
*errno.h - system wide error numbers (set by system calls)
*
*   Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
*
*Purpose:
*   This file defines the system-wide error numbers (set by
*   system calls).  Conforms to the XENIX standard.  Extended
*   for compatibility with Uniforum standard.
*   [System V]
*
*   [Public]
*
/

#if _MSC_VER > 1000
#pragma once
#endif

#ifndef _INC_ERRNO
#define _INC_ERRNO

#if !defined(_WIN32) && !defined(_MAC)
#error ERROR: Only Mac or Win32 targets supported!
#endif


#ifdef  __cplusplus
extern "C" {
#endif



/* Define _CRTIMP */

#ifndef _CRTIMP
#ifdef  _DLL
#define _CRTIMP __declspec(dllimport)
#else   /* ndef _DLL */
#define _CRTIMP
#endif  /* _DLL */
#endif  /* _CRTIMP */


/* Define __cdecl for non-Microsoft compilers */

#if ( !defined(_MSC_VER) && !defined(__cdecl) )
#define __cdecl
#endif

/* Define _CRTAPI1 (for compatibility with the NT SDK) */

#ifndef _CRTAPI1
#if _MSC_VER >= 800 && _M_IX86 >= 300
#define _CRTAPI1 __cdecl
#else
#define _CRTAPI1
#endif
#endif


/* declare reference to errno */

#if (defined(_MT) || defined(_DLL)) && !defined(_MAC)
_CRTIMP extern int * __cdecl _errno(void);
#define errno   (*_errno())
#else   /* ndef _MT && ndef _DLL */
_CRTIMP extern int errno;
#endif  /* _MT || _DLL */

/* Error Codes */

#define EPERM   1
#define ENOENT  2
#define ESRCH   3
#define EINTR   4
#define EIO 5
#define ENXIO   6
#define E2BIG   7
#define ENOEXEC 8
#define EBADF   9
#define ECHILD  10
#define EAGAIN  11
#define ENOMEM  12
#define EACCES  13
#define EFAULT  14
#define EBUSY   16
#define EEXIST  17
#define EXDEV   18
#define ENODEV  19
#define ENOTDIR 20
#define EISDIR  21
#define EINVAL  22
#define ENFILE

RE: Feature Branch Windows Build Broken - lib/canonicalize.c - ELOOP & lstat

2005-05-24 Thread Conrad T. Pino
Hi Derek,

Here's a rough draft of a patch that allows Windows build to complete.
The draft includes edited files only and ignores generated files and
Windows build projects files are also omitted.

Briefly the plan is:

#define stat wnt_stat
#define lstat wnt_stat

int wnt_stat (const char *file, struct wnt_stat *sb);

Delete wnt_lstat definition

Prevent "lib/system.h" from redefining "lstat".

Please review and revise the concept and I'll commit the results.

Conrad

Index: lib/system.h
===
RCS file: /cvs/ccvs/lib/system.h,v
retrieving revision 1.76
diff -u -p -r1.76 system.h
--- lib/system.h24 May 2005 21:05:37 -  1.76
+++ lib/system.h25 May 2005 01:20:36 -
@@ -371,7 +371,7 @@ extern int errno;
otherwise return it unchanged. */
 #define convert_blocks(b, k) ((k) ? ((b) + 1) / 2 : (b))
 
-#ifndef S_ISLNK
+#if !defined(lstat) && !defined(S_ISLNK)
 # define lstat stat
 #endif
 
Index: windows-NT/config.h.in.footer
===
RCS file: /cvs/ccvs/windows-NT/config.h.in.footer,v
retrieving revision 1.4
diff -u -p -r1.4 config.h.in.footer
--- windows-NT/config.h.in.footer   1 Mar 2005 14:37:39 -   1.4
+++ windows-NT/config.h.in.footer   25 May 2005 01:20:37 -
@@ -11,11 +11,7 @@
 #define CVS_MKDIR wnt_mkdir
 int wnt_mkdir (const char *PATH, int MODE);
 
-#define CVS_STAT wnt_stat
-int wnt_stat ();
-
-#define CVS_LSTAT wnt_lstat
-int wnt_lstat ();
+int wnt_stat (const char *file, struct wnt_stat *sb);
 
 #define CVS_RENAME wnt_rename
 int wnt_rename (const char *, const char *);
@@ -95,3 +91,6 @@ char *sock_strerror (int errnum);
 /* getpagesize is missing on Windows, but 4096 seems to do the right
thing. */
 #define getpagesize() 4096
+
+/* Windows has no ELOOP value in errno.h */
+#define ELOOP 1

Index: windows-NT/config.h.in.in
===
RCS file: /cvs/ccvs/windows-NT/config.h.in.in,v
retrieving revision 1.30
diff -u -p -r1.30 config.h.in.in
--- windows-NT/config.h.in.in   2 May 2005 14:08:18 -   1.30
+++ windows-NT/config.h.in.in   25 May 2005 01:20:37 -
@@ -92,8 +92,9 @@
message to be appended to the temp file when the editor is started. */
 #undef FORCE_USE_EDITOR
 
-/* Define if gettimeofday clobbers localtime's static buffer. */
-#undef GETTIMEOFDAY_CLOBBERS_LOCALTIME_BUFFER
+/* Define to rpl_ if the glob replacement functions and variables should be
+   used. */
+#define GLOB_PREFIX rpl_
 
 /* Define to an alternative value if GSS_C_NT_HOSTBASED_SERVICE isn't defined
in the gssapi.h header file. MIT Kerberos 1.2.1 requires this. Only
@@ -1083,6 +1084,9 @@
 /* Define to rpl_localtime if the replacement function should be used. */
 #undef localtime
 
+/* Define to a substitute for the `lstat' function. */
+#define lstat wnt_stat
+
 /* Define to rpl_malloc if the replacement function should be used. */
 #undef malloc
 
@@ -1132,6 +1136,9 @@
 /* Define as a signed type of the same size as size_t. */
 #define ssize_t int
 
+/* Define to a substitute for the stat function. */
+#define stat wnt_stat
+
 /* Define to rpl_tzset if the wrapper function should be used. */
 #undef tzset
 
Index: windows-NT/filesubr.c
===
RCS file: /cvs/ccvs/windows-NT/filesubr.c,v
retrieving revision 1.56
diff -u -p -r1.56 filesubr.c
--- windows-NT/filesubr.c   23 May 2005 22:56:16 -  1.56
+++ windows-NT/filesubr.c   25 May 2005 01:20:40 -
@@ -970,26 +970,17 @@ static void check_statbuf (const char *f
error (1, 0, "Failed to retrieve modification time for %s", file);
 }
 
-/* see CVS_STAT */
-int
-wnt_stat (const char *file, struct stat *sb)
-{
-int retval;
+/* undo config.h macros */
+#undef stat
+extern int stat (const char *file, struct wnt_stat *sb);
 
-retval = stat (file, sb);
-if (retval < 0)
-   return retval;
-check_statbuf (file, sb);
-return retval;
-}
-
-/* see CVS_LSTAT */
+/* see stat macro */
 int
-wnt_lstat (const char *file, struct stat *sb)
+wnt_stat (const char *file, struct wnt_stat *sb)
 {
 int retval;
 
-retval = lstat (file, sb);
+retval = stat (file, sb);
 if (retval < 0)
return retval;
 check_statbuf (file, sb);


___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


Re: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Derek Price
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Conrad T. Pino wrote:

>Defining macro "__PRAGMA_REDEFINE_EXTNAME" on the command line stops all
errors
>and warnings in "lib/glob.c" compile.


(For those new to this thread, this is because the Solaris headers
#define stat stat64 when the __PRAGMA_REDEFINE_EXTNAME macro is not
defined).

Why isn't gcc defining this value?  According to what I could find on
the web, the compiler should define "__PRAGMA_REDEFINE_EXTNAME" if it
supports the redefine_extname pragma, which this compiler apparently does.

.

Why haven't we seen this error before?  Is this a common problem on
Solaris 10?  Is this problem true of any gcc on any Solaris?  Is it
specific to your setup?  What happens if you use a native Soalris compiler?

A quick google search on "__PRAGMA_REDEFINE_EXTNAME Solaris 10 gcc"
brings up a few discussions of this.  The gist of the first few I read
is that some people ocassionally end up with broken GCCs which do not
properly define this macro, but most GCCs should.  The reason for the
difference was not apparent in the first several pages I scanned.

Digging a little deeper, this is even documented in the Linux info
manual for gcc:

> Solaris Pragmas
> ---
>
> For compatibility with the SunPRO compiler, the following pragma is
> supported.
>
> `redefine_extname OLDNAME NEWNAME'
> This pragma gives the C function OLDNAME the assembler label
> NEWNAME. The pragma must appear before the function declaration.
> This pragma is equivalent to the asm labels extension (*note Asm
> Labels::). The preprocessor defines `__PRAGMA_REDEFINE_EXTNAME'
> if the pragma is available.


Perhaps the problem is in your GCC installation or usage?

Regards,

Derek
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCk+etLD1OTBfyMaQRAs9VAJ9KrtbzdH5ikvAiviVanqIfsSQOZwCglN4c
RbnHOR4yXu7wBbG9E9s5P4U=
=78Ar
-END PGP SIGNATURE-




___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

> From: Conrad T. Pino [mailto:[EMAIL PROTECTED]
> I choose a broken gcc as the likely culprit. I'll run a test and report.

Test program and results are below.

Conrad

/export/home/cvsusr/ccvs/cvs-1.12:$ cat test00.c; gcc -o test00 test00.c; test00
#include 

#ifdef __PRAGMA_REDEFINE_EXTNAME
#define p0value "defined"
#else
#define p0value "undefined"
#endif

#ifdef _PRAGMA_REDEFINE_EXTNAME
#define p1value "defined"
#else
#define p1value "undefined"
#endif

#ifdef PRAGMA_REDEFINE_EXTNAME
#define p2value "defined"
#else
#define p2value "undefined"
#endif

int main( int argc, char *argv[ ] )
{
printf( "__PRAGMA_REDEFINE_EXTNAME is %s\n", p0value );
printf( "_PRAGMA_REDEFINE_EXTNAME is %s\n", p1value );
printf( "PRAGMA_REDEFINE_EXTNAME is %s\n", p2value );

return 0;
}
__PRAGMA_REDEFINE_EXTNAME is undefined
_PRAGMA_REDEFINE_EXTNAME is undefined
PRAGMA_REDEFINE_EXTNAME is undefined
/export/home/cvsusr/ccvs/cvs-1.12:$ 


___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

> From: Derek Price [mailto:[EMAIL PROTECTED]
> 
> (For those new to this thread, this is because the Solaris headers
> #define stat stat64 when the __PRAGMA_REDEFINE_EXTNAME macro is not
> defined).
> 
> Why isn't gcc defining this value?  According to what I could find on
> the web, the compiler should define "__PRAGMA_REDEFINE_EXTNAME" if it
> supports the redefine_extname pragma, which this compiler apparently does.
> 
> .

That compiler costs money.  I'm using gcc distribution supplied on the
free software CD distrubuted with Solaris i.e. the 2.95.2 version.

> Why haven't we seen this error before?  Is this a common problem on
> Solaris 10?  Is this problem true of any gcc on any Solaris?  Is it
> specific to your setup?  What happens if you use a native Soalris compiler?

Because we've never "#define stat ..." and "#define lstat ..." before.

I haven't tried another gcc version.  Must I and must it be on Solaris?

I don't know if it's specific to this setup.  What should I test?

A native Solaris compiler costs money and I don't have one.

> A quick google search on "__PRAGMA_REDEFINE_EXTNAME Solaris 10 gcc"
> brings up a few discussions of this.  The gist of the first few I read
> is that some people ocassionally end up with broken GCCs which do not
> properly define this macro, but most GCCs should.  The reason for the
> difference was not apparent in the first several pages I scanned.

This looks promising even though I have Solaris 8 Intel Edition.

> Digging a little deeper, this is even documented in the Linux info
> manual for gcc:
> 
> > Solaris Pragmas
> > ---
> >
> > For compatibility with the SunPRO compiler, the following pragma is
> > supported.
> >
> > `redefine_extname OLDNAME NEWNAME'
> > This pragma gives the C function OLDNAME the assembler label
> > NEWNAME. The pragma must appear before the function declaration.
> > This pragma is equivalent to the asm labels extension (*note Asm
> > Labels::). The preprocessor defines `__PRAGMA_REDEFINE_EXTNAME'
> > if the pragma is available.
> 
> 
> Perhaps the problem is in your GCC installation or usage?

/export/home/cvsusr/ccvs/cvs-1.12/windows-NT:$ gcc -v
Reading specs from /opt/sfw/lib/gcc-lib/i386-pc-solaris2.8/2.95.2/specs
gcc version 2.95.2 19991024 (release)

Isn't "usage" controlled by CVS make process or did I misunderstand?

I choose a broken gcc as the likely culprit. I'll run a test and report.

> Regards,

Ditto,

> Derek

Conrad



___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

We have the same behavior with gcc 3.3.5 on Debian Linux 2.6.8-2-686 platform.

Conrad

[EMAIL PROTECTED]:~$ cat test00.c; uname -a; gcc -v; gcc -o test00 test00.c; 
./test00
#include 

#ifdef __PRAGMA_REDEFINE_EXTNAME
#define p0value "defined"
#else
#define p0value "undefined"
#endif

#ifdef _PRAGMA_REDEFINE_EXTNAME
#define p1value "defined"
#else
#define p1value "undefined"
#endif

#ifdef PRAGMA_REDEFINE_EXTNAME
#define p2value "defined"
#else
#define p2value "undefined"
#endif

int main( int argc, char *argv[ ] )
{
printf( "__PRAGMA_REDEFINE_EXTNAME is %s\n", p0value );
printf( "_PRAGMA_REDEFINE_EXTNAME is %s\n", p1value );
printf( "PRAGMA_REDEFINE_EXTNAME is %s\n", p2value );

return 0;
}
Linux debzfp 2.6.8-2-686 #1 Mon Jan 24 03:58:38 EST 2005 i686 GNU/Linux
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.5/specs
Configured with:
../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang 
--prefix=/usr --mandir=/usr/share/man --infodir=/usr/
share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared 
--enable-__cxa_atexit --with-system-zlib --enable-nls --witho
ut-included-gettext --enable-clocale=gnu --enable-debug --enable-java-gc=boehm 
--enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.5 (Debian 1:3.3.5-12)
__PRAGMA_REDEFINE_EXTNAME is undefined
_PRAGMA_REDEFINE_EXTNAME is undefined
PRAGMA_REDEFINE_EXTNAME is undefined
[EMAIL PROTECTED]:~$



___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

We have the same behavior with gcc 2.95.3 on NetBSD 1.6.1 platform.

Conrad

/usr/home/conrad:$ cat test00.c; uname -a; gcc -v; gcc -o test00 test00.c; 
./test00
#include 

#ifdef __PRAGMA_REDEFINE_EXTNAME
#define p0value "defined"
#else
#define p0value "undefined"
#endif

#ifdef _PRAGMA_REDEFINE_EXTNAME
#define p1value "defined"
#else
#define p1value "undefined"
#endif

#ifdef PRAGMA_REDEFINE_EXTNAME
#define p2value "defined"
#else
#define p2value "undefined"
#endif

int main( int argc, char *argv[ ] )
{
printf( "__PRAGMA_REDEFINE_EXTNAME is %s\n", p0value );
printf( "_PRAGMA_REDEFINE_EXTNAME is %s\n", p1value );
printf( "PRAGMA_REDEFINE_EXTNAME is %s\n", p2value );

return 0;
}
NetBSD heron.skyline.pino.net 1.6.1 NetBSD 1.6.1 (PinoFICdev) #0: Fri May 13 
02:26:01 PDT 2005
[EMAIL PROTECTED]:/usr/src/sys/arch/i386/compile/PinoFICdev i386
Using builtin specs.
gcc version 2.95.3 20010315 (release) (NetBSD nb3)
__PRAGMA_REDEFINE_EXTNAME is undefined
_PRAGMA_REDEFINE_EXTNAME is undefined
PRAGMA_REDEFINE_EXTNAME is undefined
/usr/home/conrad:$



___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

> From: Derek Price
> 
> > Solaris Pragmas
> > ---
> >
> > For compatibility with the SunPRO compiler, the following pragma is
> > supported.
> >
> > `redefine_extname OLDNAME NEWNAME'
> > This pragma gives the C function OLDNAME the assembler label
> > NEWNAME. The pragma must appear before the function declaration.
> > This pragma is equivalent to the asm labels extension (*note Asm
> > Labels::). The preprocessor defines `__PRAGMA_REDEFINE_EXTNAME'
> > if the pragma is available.
> 
> Perhaps the problem is in your GCC installation or usage?

This link is similar to what you've found:
http://gcc.gnu.org/onlinedocs/gcc-3.3.3/gcc/Solaris-Pragmas.html#Solaris%20Pragmas

but this one is different and possibly later:
http://gcc.gnu.org/onlinedocs/gcc/Symbol_002dRenaming-Pragmas.html#Symbol_002dRenaming-Pragmas
which reads, "These pragmas are only available on platforms whose system 
headers need them."
and perhaps by implication the corresponding macros are there either.

This raises an interesting question.  By adding "__PRAGMA_REDEFINE_EXTNAME" to 
the
command line "sys/stat.h" did NOT "#define stat,fstat,lstat ..." since the 
issue is
CVS and Solaris are both attempting to #define the same tokens and don't 
compilers
quietly ignore #pragma statements they don't understand?

See the test program below which compiles and runs with no errors.  If we 
believe
the test program the redefine_extname pragma is just not implemented.  If so I'm
sorry as I sent us barking up the wrong tree.

> Regards,

Ditto,

> Derek

Conrad

/export/home/cvsusr/ccvs/cvs-1.12:$ cat test01.c fidofifi.?; rm test01; gcc -o 
test01 test01.c fidofifi.c; ./test01
=== test01.c follows ===
#include "fidofifi.h"

void test0( void )
{
printf( "test0 fido is %s\n", fido( ) );
printf( "test0 fifi is %s\n", fifi( ) );
}

#pragma redefine_extname fido fifi

#pragma garbage_junk radar run

void test1( void )
{
printf( "test1 fido is %s\n", fido( ) );
printf( "test1 fifi is %s\n", fifi( ) );
}

int main( int argc, char *argv[ ] )
{
test0( );
test1( );

return 0;
}
=== fidofifi.c follows ===
#include "fidofifi.h"

char * fido( void ) { return "fido"; }
=== fidofifi.h follows ===
char * fifi( void ) { return "fifi"; }
#ifndef _FIDOFIFO_H
#define _FIDOFIFO_H 1

#include 

extern char * fido( void );
extern char * fifi( void );
#endif
=== test01 output ===
test0 fido is fido
test0 fifi is fifi
test1 fido is fido
test1 fifi is fifi
/export/home/cvsusr/ccvs/cvs-1.12:$   


___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


RE: Feature Branch Solaris Build Broken - lib/glob.c errors

2005-05-24 Thread Conrad T. Pino
Hi Derek,

> From: Conrad T. Pino
>
> > From: Derek Price
> >
> > Perhaps the problem is in your GCC installation or usage?

A gcc upgrade sure helps.  I installed gcc 3.4.2 binary from SunFreeWare.

Program test00 works as expected and results are below.
Program test01 compile files with #pragma ... error and results are below.
Program test02 works proving the #pragma ... works and results are below.

We have a clean "lib/glob.c" compile and sucessful build with the results below.

Conrad

/export/home/cvsusr/ccvs/cvs-1.12:$ cat test00.c; rm test00; gcc -v; gcc -o 
test00 test00.c; ./test00
#include 

#ifdef __PRAGMA_REDEFINE_EXTNAME
#define p0value "defined"
#else
#define p0value "undefined"
#endif

#ifdef _PRAGMA_REDEFINE_EXTNAME
#define p1value "defined"
#else
#define p1value "undefined"
#endif

#ifdef PRAGMA_REDEFINE_EXTNAME
#define p2value "defined"
#else
#define p2value "undefined"
#endif

int main( int argc, char *argv[ ] )
{
printf( "__PRAGMA_REDEFINE_EXTNAME is %s\n", p0value );
printf( "_PRAGMA_REDEFINE_EXTNAME is %s\n", p1value );
printf( "PRAGMA_REDEFINE_EXTNAME is %s\n", p2value );

return 0;
}
Reading specs from 
/export/home/usr/local/bin/../lib/gcc/i386-pc-solaris2.8/3.4.2/specs
Configured with:
../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls 
--disable-libgcj --enable-languages=c,c+ :
(reconfigured)
../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls 
--disable-libgcj --enable-languages=c,c++
Thread model: posix
gcc version 3.4.2
__PRAGMA_REDEFINE_EXTNAME is defined
_PRAGMA_REDEFINE_EXTNAME is undefined
PRAGMA_REDEFINE_EXTNAME is undefined
/export/home/cvsusr/ccvs/cvs-1.12:$

/export/home/cvsusr/ccvs/cvs-1.12:$ cat test01.c; rm test01; gcc -o test01 
test01.c fidofifo.c; ./test01
#include "fidofifi.h"

void test0( void )
{
printf( "test0 fido is %s\n", fido( ) );
printf( "test0 fifi is %s\n", fifi( ) );
}

#pragma redefine_extname fido fifi

#pragma garbage_junk radar run

void test1( void )
{
printf( "test1 fido is %s\n", fido( ) );
printf( "test1 fifi is %s\n", fifi( ) );
}

int main( int argc, char *argv[ ] )
{
test0( );
test1( );

return 0;
}
gcc: fidofifo.c: No such file or directory
test01.c:9: warning: #pragma redefine_extname conflicts with declaration
test01.c:9: warning: fido renamed after being referenced in assembly
test01.c:9: internal compiler error: in change_decl_assembler_name, at 
cgraph.c:532
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html> for instructions.
ksh: ./test01:  not found
/export/home/cvsusr/ccvs/cvs-1.12:$

/export/home/cvsusr/ccvs/cvs-1.12:$ cat test02.c; rm test02; gcc -o test02 
test02.c fidofifi.c; ./test02
#include "fidofifi.h"

#pragma redefine_extname fido fifi

#pragma garbage_junk radar run

void test1( void )
{
printf( "test1 fido is %s\n", fido( ) );
printf( "test1 fifi is %s\n", fifi( ) );
}

int main( int argc, char *argv[ ] )
{
test1( );

return 0;
}
test02.c:3: warning: #pragma redefine_extname conflicts with declaration
test1 fido is fifi
test1 fifi is fifi
/export/home/cvsusr/ccvs/cvs-1.12:$

/export/home/cvsusr/ccvs/cvs-1.12:$ rm lib/glob.o
/export/home/cvsusr/ccvs/cvs-1.12:$ make
make  all-recursive
Making all in lib
make  all-am
if gcc -DHAVE_CONFIG_H -I. -I. -I..-Ino/include  -g -O2 -MT glob.o -MD -MP 
-MF ".deps/glob.Tpo" -c -o glob.o glob.c; \
then mv -f ".deps/glob.Tpo" ".deps/glob.Po"; else rm -f ".deps/glob.Tpo"; exit 
1; fi
rm -f libcvs.a
ar cru libcvs.a sighandle.o allocsa.o  cycle-check.o basename.o stripslash.o  
getnline.o xalloc-die.o xgetcwd.o  xgethostname.o
xreadlink.o save-cwd.o lstat.o mktime.o strftime.o canonicalize.o chdir-long.o 
mempcpy.o openat.o memrchr.o closeout.o dirname.o
exitfail.o getcwd.o getdate.o getline.o getndelim2.o getopt.o getopt1.o 
getpass.o gettime.o md5.o pagealign_alloc.o path-concat.o
quotearg.o regex.o rpmatch.o setenv.o unsetenv.o dup-safer.o fd-safer.o 
vasnprintf.o printf-args.o printf-parse.o asnprintf.o
vasprintf.o asprintf.o xmalloc.o yesno.o glob.o
ranlib libcvs.a
Making all in zlib
Making all in diff
Making all in src
gcc  -g -O2  -Lno/lib -o cvs  add.o admin.o annotate.o  buffer.o checkin.o 
checkout.o  classify.o client.o commit.o  create_adm.o
cvsrc.o diff.o  edit.o entries.o error.o  exithandle.o expand_path.o fileattr.o 
 filesubr.o find_names.o hardlink.o  hash.o
history.o ignore.o  import.o lock.o log.o  log-buffer.o login.o logmsg.o  ls.o 
main.o mkmodules.o  modules.o ms-buffer.o myndbm.o
no_diff.o parseinfo.o patch.o  rcs.o rcscmds.o recurse.o  release.o remove.o 
repos.o  root.o rsh-client.o run.o  scramble.o server.o
socket-client.o  sta