On Fri, Sep 16, 2016 at 09:04:58PM +0200, Mark Kettenis wrote: > On OpenBSD we use a consistent set of typedefs across platforms for > the types specified by the C standard. In some cases these deviate > from what the processor-specific ABI says. The diff below fixes the > ones relevant for arm, pretty much by following NetBSD. > > ok?
ok patrick@ > > Oh, and how do we handle upstreaming these kind of diffs? Good question. LLVM folks seem receptive to diffs, but you need to create a test. They also seem to like that Phabricator thing, but I'm not sure if that is really needed and instead you could just send the diff (+ test) to the mailing list... > > > Index: gnu/llvm/tools/clang/lib/Basic/Targets.cpp > =================================================================== > RCS file: /cvs/src/gnu/llvm/tools/clang/lib/Basic/Targets.cpp,v > retrieving revision 1.1.1.1 > diff -u -p -r1.1.1.1 Targets.cpp > --- gnu/llvm/tools/clang/lib/Basic/Targets.cpp 3 Sep 2016 22:46:57 > -0000 1.1.1.1 > +++ gnu/llvm/tools/clang/lib/Basic/Targets.cpp 16 Sep 2016 18:58:59 > -0000 > @@ -4275,8 +4275,10 @@ class ARMTargetInfo : public TargetInfo > DoubleAlign = LongLongAlign = LongDoubleAlign = SuitableAlign = 64; > const llvm::Triple &T = getTriple(); > > - // size_t is unsigned long on MachO-derived environments, NetBSD and > Bitrig. > + // size_t is unsigned long on MachO-derived environments, NetBSD, > + // OpenBSD and Bitrig. > if (T.isOSBinFormatMachO() || T.getOS() == llvm::Triple::NetBSD || > + T.getOS() == llvm::Triple::OpenBSD || > T.getOS() == llvm::Triple::Bitrig) > SizeType = UnsignedLong; > else > @@ -4284,6 +4286,7 @@ class ARMTargetInfo : public TargetInfo > > switch (T.getOS()) { > case llvm::Triple::NetBSD: > + case llvm::Triple::OpenBSD: > WCharType = SignedInt; > break; > case llvm::Triple::Win32: > @@ -4475,6 +4478,7 @@ public: > > switch (getTriple().getOS()) { > case llvm::Triple::NetBSD: > + case llvm::Triple::OpenBSD: > PtrDiffType = SignedLong; > break; > default: >