pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Oh, but to compile clang



$ uname -mpr
5.0.2 amd64 x86_64

My current adventure is to build clang in wip.  Because /usr/bin/c++
was generating bad object code, I upgraded to 4.6 in pkgsrc HEAD.   

Since upgrading clang is somehow using the preprocessor's definition of
"NetBSD" where it should be using its own enumerated type.  Here's the
cpp output:

const char *Triple::getOSTypeName(OSType Kind) {
  switch (Kind) {
  case UnknownOS: return "unknown";

  case AuroraUX: return "auroraux";
  case Cygwin: return "cygwin";
  case Darwin: return "darwin";
  case DragonFly: return "dragonfly";
  case FreeBSD: return "freebsd";
  case IOS: return "ios";
  case KFreeBSD: return "kfreebsd";
  case Linux: return "linux";
  case Lv2: return "lv2";
  case MacOSX: return "macosx";
  case MinGW32: return "mingw32";
  case 199905: return "netbsd";
  case OpenBSD: return "openbsd";
  case Solaris: return "solaris";
  case Win32: return "win32";
  case Haiku: return "haiku";
  case Minix: return "minix";
  case RTEMS: return "rtems";
  case NativeClient: return "nacl";
  case CNK: return "cnk";
  }

  __builtin_unreachable();
}

I'm not sure if this problem starts in clang or wip.  The value
definitely comes from the system headers.  This output is from 
cpp -dDI:

# 83 "/usr/include/sys/param.h" 3 4
#define NetBSD 199905

Suggestions welcome!  

--jkl



Home | Main Index | Thread Index | Old Index