On Wed, 2019-02-20 at 09:21 +0100, Sylvestre Ledru wrote:
> Le 20/02/2019 à 09:19, Dun Hum a écrit :
> > > Would you have a testcase which shows the issue? This to make sure we
> > > don't regress again
> > > in the future.
> > The simplest test case is the following one, it only checks that the enum
> > value exist and has the correct
> > name.
> > 
> > ```
> > #include <llvm/ADT/Triple.h>
> > 
> > int main()
> > {
> >      (void)llvm::Triple::KFreeBSD;
                             ^
                             kFreeBSD;
> >      return 0;
> > }
> > ```
> > 
> > Compile with `g++ $(llvm-config --cflags) test.cpp` and make sure `$?` is
> > zero.
> 
> Thanks but I was more thinking about ABI compatibility testing. :)

The problem with the code is indicated above. It is defined in the enum OSType{}
of Class Triple{}.

>From what I've learned upstream use the convention that all names should be
starting with uppercase (called Upper Camel Case, see 
http://wiki.c2.com/?CamelCase) In fact Using KFreeBSD is not strictly Upper
Camel Case, since no two upper case letters are allowed in the beginning of the
word) In my opinion this convention is extremely stupid, e.g. iOS is named as
IOS etc. Additionally, llvm-toolchain does not build since version -3.6 so there
is no problem for later versions of llvm-toolchain.

However, I could change back to using KFreeBSD since for acceptance by upstream
all occurrences of defined(__FreeBSD_kernel__) in the patches should read
defined(__FreeBSD_kernel__) && !defined(__FreeBSD__) to make the builds on other
FreeBSD systems unharmed.

I'll do that in due time. In the meanwhile, can you add the attached patch and
release llvm-toolchain-7_7.0.1-7?

Thanks!

Index: llvm-toolchain-7-7.0.1/include/llvm/MC/MCELFObjectWriter.h
===================================================================
--- llvm-toolchain-7-7.0.1.orig/include/llvm/MC/MCELFObjectWriter.h
+++ llvm-toolchain-7-7.0.1/include/llvm/MC/MCELFObjectWriter.h
@@ -75,6 +75,7 @@ public:
         return ELF::ELFOSABI_CLOUDABI;
       case Triple::PS4:
       case Triple::FreeBSD:
+      case Triple::kFreeBSD:
         return ELF::ELFOSABI_FREEBSD;
       default:
         return ELF::ELFOSABI_NONE;

Reply via email to