Ticket #782 (closed bug: worksforme)

Opened 5 years ago

Last modified 5 years ago

src/pmc/env.t confuses compiler specific and platform specific macros

Reported by: moritz Owned by:
Priority: normal Milestone:
Component: core Version: 1.3.0
Severity: medium Keywords: build, macos, clang
Cc: Language:
Patch status: Platform: linux

Description

From src/pmc/env.pmc (lines 23 and onwards)

/* array of environment variables,
   speced in POSIX.1, but not in ISO-C
   MS C compilers know about environ, as it is declared in stdlib.h.
   OS X doesn't allow access to "environ" from within shared libraries.
*/
#ifndef WIN32
#  ifdef __APPLE_CC__
#    include <crt_externs.h>
#    define environ (*_NSGetEnviron())
#  else /* !__APPLE_CC__ */
extern char **environ;
#  endif /* __APPLE_CC__ */
#endif /* !WIN32 */

This causes build failures on linux with clang (a llvm frontend) which sets the APPLE_CC macro, but doesn't provide crt_externs.h

It seems that it would be more appropriate to check for being on MacOS than checking a vendor specific macro.

Change History

Changed 5 years ago by moritz

  • status changed from new to closed
  • resolution set to worksforme

The clang people wrote that it was actually a bug in their software and have fixed it, so I don't think it's an issue for parrot anymore. (I can't test it because their svn version is currently borked, but I'll do that as soon as it's fixed again).

Note: See TracTickets for help on using tickets.