After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 172179 - guard _POSIX_SOURCE in gmime-gpg-context.c for IRIX alone
guard _POSIX_SOURCE in gmime-gpg-context.c for IRIX alone
Status: RESOLVED FIXED
Product: gmime
Classification: Other
Component: general
unspecified
Other OSF/1
: Normal normal
: ---
Assigned To: Jeffrey Stedfast
Jeffrey Stedfast
Depends on:
Blocks:
 
 
Reported: 2005-03-30 23:34 UTC by Tim Mooney
Modified: 2006-06-23 00:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
only define _POSIX_SOURCE if we're on IRIX (1.01 KB, patch)
2005-03-30 23:35 UTC, Tim Mooney
none Details | Review

Description Tim Mooney 2005-03-30 23:34:46 UTC
Version details: 2.1.14

configure gmime 2.1.14 on a commercial UNIX, with the compiler set so that it
sees the "most modern" set of symbols (e.g. UNIX98).  In my particular case, I
configured gmime on Tru64 UNIX with the `-std' flag, which results in much more
than just the symbols defined by _POSIX_SOURCE being visible.

When the compile gets to gmime/gmime-gpg-context.c, it bombs out because
_POSIX_SOURCE is now defined, and that effectively hides some needed symbols in
the headers that are subsequently included.

Since the #define was added specifically for IRIX, the workaround is to guard
the define with tests for IRIX.  I believe I have done that, though I haven't
tested it on our IRIX boxes yet, since I don't have glib on any of them currently.

Patch is attached
Comment 1 Tim Mooney 2005-03-30 23:35:31 UTC
Created attachment 39467 [details] [review]
only define _POSIX_SOURCE if we're on IRIX
Comment 2 Jeffrey Stedfast 2005-04-14 19:56:24 UTC
how do you know it's only needed for IRIX? I don't have an IRIX machine either,
so without beign able to test I'm a bit nervous about committing.
Comment 3 Tim Mooney 2005-04-14 23:08:58 UTC
I do have IRIX, I just hadn't tested it when I submitted the initial report.

I don't know if only IRIX needs it; I do know that it causes harm on at least
one other platform.  Since hardcoding _POSIX_SOURCE seemed like kind of a hack
to pacify IRIX, I made the code conditional on being on IRIX.

I could reverse the sense, and make it only *not* defined on Tru64, but that's
also a hack.

Alternately, I could try come up with an autoconf test to tell where
_POSIX_SOURCE is needed to see the relevant symbols.  That's harder, and will
take more time, but is possible.

Which of the three options do you prefer?
Comment 4 Jeffrey Stedfast 2005-04-15 02:38:11 UTC
seems like the correct approach is to configure check for its need
Comment 5 Tim Mooney 2005-04-22 22:39:20 UTC
I'll see if I can come up with such a test, though I suspect it's going to be a
while before I get a chance to do so.
Comment 6 Tim Mooney 2005-07-21 03:59:03 UTC
I've spent a bunch of time building the prerequisites on IRIX with the vendor
toolchain, and then built gmime 2.1.14.

I turned up several unrelated build issues for gmime, which I'll report in
different bug reports (hopefully tomorrow).

I removed the #define _POSIX_SOURCE, to see how the gmime-gpg-context.c would
fail, so I could determine how best to test with autoconf. With the #deifine
gone, gmime-gpg-context.c built just fine with the MIPSPro 7.4 C compiler,
whether using

  CC=cc
  CFLAGS='-64 -xansi'

or using

  CC=c99
  CFLAGS='-64'

If I instead leave the #define _POSIX_SOURCE there and build, the build *fails*.
So, despite the comment above the #define, IRIX (at least recent IRIX) is much
better off without the #define.

At this point, I don't know why the #define was originally added, but it
actually causes build failures on at least two platforms I've tested on.

I could test on Solaris 8 with the Forte (commercial) compiler, if you like.
Other than that, I don't know how to proceed with this.
Comment 7 Jeffrey Stedfast 2005-07-21 14:54:10 UTC
I guess we might as well just remove it then.
Comment 8 Jeffrey Stedfast 2006-06-23 00:33:30 UTC
just removed the #define in CVS - will be included in 2.2.3