This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Re: libcpp.a bugs (and fixes)



  In message <199811040154.RAA13113@aldrington.ppp.cs.sfu.ca>you write:
  > In the 19981101 snapshot, there are some portability issues for libcpp.a
  > that prevent correct linking on some platforms (notably NEXTSTEP).
  > 
  > The gcc Makefile doesn't invoke ranlib on libcpp.a.
Yup.  I'll install this fix as soon as possible (I'm offline at the moment).

  > cppulp.c just contains a definition of the variable user_label_prefix,
  > but defines it as a common symbol. Some ranlib versions (notably NeXTs)
  > won't put common symbols in the archive table of contents to avoid
  > linking in a library member just because it uses an uninitialized global
  > that is undefined at that point in the linking. Thus user_label_prefix
  > ends up undefined. The fix is simple, have cppulp.c initialize
  > user_label_prefix.
Similarly.

  > cppfiles.c relies on the macros S_ISREG and S_ISDIR, which aren't defined
  > on all systems.
  > 
  > I've enclosed a patch for the first two of these issues. I don't know
  > enough about ``the proper way'' to fix cppfiles.c. I just applied a
  > bandaid of:
  > 
  >   #ifndef S_ISDIR
  >       #define S_ISDIR(mode)	(((mode) & (S_IFMT)) == (S_IFDIR))
  >       #define S_ISREG(mode)	(((mode) & (S_IFMT)) == (S_IFREG))
  >   #endif
  > 
  > ... in cppfiles.c, but I'm sure there is a proper fix involving autoconf,
  > etc.
Maybe it belongs in system.h.  Probably don't need an autoconf test since
we can check if S_ISDIR is defined before defining it in system.h

Similarly for S_ISREG.

jeff


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