Bug#721880: clang-3.3: missing pre-processor macros for GNU/kFreeBSD

2013-09-05 Thread Robert Millan
Sylvestre Ledru:
 On 05/09/2013 01:25, Robert Millan wrote:

 clang-3.3 does not currently define the GNU/kFreeBSD pre-processor
 macros (such as __FreeBSD_kernel__) because it is missing the TargetInfo
 object class for this platform. This breaks software
 that attempts to use these macros to identify it.

 See upstream bug http://llvm.org/bugs/show_bug.cgi?id=17104

 The patch for clang-3.3 is slightly different than the one submitted
 upstream for trunk. See attachment.

 Thanks!
 
 Is it just a basic rebase or is there more differences ?

Well the constructor arguments are different, but I see you've already
noticed :-)

Thanks for the quick response!

-- 
Robert Millan


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#721880: clang-3.3: missing pre-processor macros for GNU/kFreeBSD

2013-09-04 Thread Robert Millan
Package: clang-3.3
Severity: important
Tags: patch upstream

Hi,

clang-3.3 does not currently define the GNU/kFreeBSD pre-processor
macros (such as __FreeBSD_kernel__) because it is missing the TargetInfo
object class for this platform. This breaks software
that attempts to use these macros to identify it.

See upstream bug http://llvm.org/bugs/show_bug.cgi?id=17104

The patch for clang-3.3 is slightly different than the one submitted
upstream for trunk. See attachment.

-- 
Robert Millan
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -283,6 +283,30 @@
 }
 };
 
+// GNU/kFreeBSD Target
+templatetypename Target
+class KFreeBSDTargetInfo : public OSTargetInfoTarget {
+protected:
+  virtual void getOSDefines(const LangOptions Opts, const llvm::Triple Triple,
+MacroBuilder Builder) const {
+// GNU/kFreeBSD defines; list based off of gcc output
+
+DefineStd(Builder, unix, Opts);
+Builder.defineMacro(__FreeBSD_kernel__);
+Builder.defineMacro(__GLIBC__);
+Builder.defineMacro(__ELF__);
+if (Opts.POSIXThreads)
+  Builder.defineMacro(_REENTRANT);
+if (Opts.CPlusPlus)
+  Builder.defineMacro(_GNU_SOURCE);
+  }
+public:
+  KFreeBSDTargetInfo(const std::string triple)
+: OSTargetInfoTarget(triple) {
+this-UserLabelPrefix = ;
+  }
+};
+
 // Minix Target
 templatetypename Target
 class MinixTargetInfo : public OSTargetInfoTarget {
@@ -5434,6 +5458,8 @@
   return new BitrigI386TargetInfo(T);
 case llvm::Triple::FreeBSD:
   return new FreeBSDTargetInfoX86_32TargetInfo(T);
+case llvm::Triple::KFreeBSD:
+  return new KFreeBSDTargetInfoX86_32TargetInfo(T);
 case llvm::Triple::Minix:
   return new MinixTargetInfoX86_32TargetInfo(T);
 case llvm::Triple::Solaris:
@@ -5473,6 +5499,8 @@
   return new BitrigX86_64TargetInfo(T);
 case llvm::Triple::FreeBSD:
   return new FreeBSDTargetInfoX86_64TargetInfo(T);
+case llvm::Triple::KFreeBSD:
+  return new KFreeBSDTargetInfoX86_64TargetInfo(T);
 case llvm::Triple::Solaris:
   return new SolarisTargetInfoX86_64TargetInfo(T);
 case llvm::Triple::MinGW32:


Bug#721880: clang-3.3: missing pre-processor macros for GNU/kFreeBSD

2013-09-04 Thread Sylvestre Ledru
On 05/09/2013 01:25, Robert Millan wrote:

 clang-3.3 does not currently define the GNU/kFreeBSD pre-processor
 macros (such as __FreeBSD_kernel__) because it is missing the TargetInfo
 object class for this platform. This breaks software
 that attempts to use these macros to identify it.

 See upstream bug http://llvm.org/bugs/show_bug.cgi?id=17104

 The patch for clang-3.3 is slightly different than the one submitted
 upstream for trunk. See attachment.

Thanks!

Is it just a basic rebase or is there more differences ?

Thanks
Sylvestre


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org