[PATCH] D19854: Define Contiki OS toolchain
This revision was automatically updated to reflect the committed changes. Closed by commit rL284278: Define Contiki OS toolchain (authored by dlkreitz). Changed prior to commit: https://reviews.llvm.org/D19854?vs=70076=74741#toc Repository: rL LLVM https://reviews.llvm.org/D19854 Files: cfe/trunk/lib/Driver/Driver.cpp cfe/trunk/lib/Driver/ToolChains.cpp cfe/trunk/lib/Driver/ToolChains.h cfe/trunk/test/Driver/fsanitize.c Index: cfe/trunk/test/Driver/fsanitize.c === --- cfe/trunk/test/Driver/fsanitize.c +++ cfe/trunk/test/Driver/fsanitize.c @@ -397,6 +397,7 @@ // RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -fstack-protector-all -### %s 2>&1 | FileCheck %s -check-prefix=SP // RUN: %clang -target arm-linux-androideabi -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP // RUN: %clang -target aarch64-linux-android -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP +// RUN: %clang -target i386-contiki-unknown -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP // NO-SP-NOT: stack-protector // NO-SP: "-fsanitize=safe-stack" // SP: "-fsanitize=safe-stack" Index: cfe/trunk/lib/Driver/ToolChains.h === --- cfe/trunk/lib/Driver/ToolChains.h +++ cfe/trunk/lib/Driver/ToolChains.h @@ -1249,6 +1249,14 @@ Tool *buildLinker() const override; }; +class LLVM_LIBRARY_VISIBILITY Contiki : public Generic_ELF { +public: + Contiki(const Driver , const llvm::Triple , + const llvm::opt::ArgList ); + + SanitizerMask getSupportedSanitizers() const override; +}; + } // end namespace toolchains } // end namespace driver } // end namespace clang Index: cfe/trunk/lib/Driver/ToolChains.cpp === --- cfe/trunk/lib/Driver/ToolChains.cpp +++ cfe/trunk/lib/Driver/ToolChains.cpp @@ -5305,3 +5305,14 @@ Res |= SanitizerKind::Vptr; return Res; } + +Contiki::Contiki(const Driver , const llvm::Triple , const ArgList ) +: Generic_ELF(D, Triple, Args) {} + +SanitizerMask Contiki::getSupportedSanitizers() const { + const bool IsX86 = getTriple().getArch() == llvm::Triple::x86; + SanitizerMask Res = ToolChain::getSupportedSanitizers(); + if (IsX86) +Res |= SanitizerKind::SafeStack; + return Res; +} Index: cfe/trunk/lib/Driver/Driver.cpp === --- cfe/trunk/lib/Driver/Driver.cpp +++ cfe/trunk/lib/Driver/Driver.cpp @@ -3120,6 +3120,9 @@ case llvm::Triple::PS4: TC = new toolchains::PS4CPU(*this, Target, Args); break; +case llvm::Triple::Contiki: + TC = new toolchains::Contiki(*this, Target, Args); + break; default: // Of these targets, Hexagon is the only one that might have // an OS of Linux, in which case it got handled above already. Index: cfe/trunk/test/Driver/fsanitize.c === --- cfe/trunk/test/Driver/fsanitize.c +++ cfe/trunk/test/Driver/fsanitize.c @@ -397,6 +397,7 @@ // RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -fstack-protector-all -### %s 2>&1 | FileCheck %s -check-prefix=SP // RUN: %clang -target arm-linux-androideabi -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP // RUN: %clang -target aarch64-linux-android -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP +// RUN: %clang -target i386-contiki-unknown -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP // NO-SP-NOT: stack-protector // NO-SP: "-fsanitize=safe-stack" // SP: "-fsanitize=safe-stack" Index: cfe/trunk/lib/Driver/ToolChains.h === --- cfe/trunk/lib/Driver/ToolChains.h +++ cfe/trunk/lib/Driver/ToolChains.h @@ -1249,6 +1249,14 @@ Tool *buildLinker() const override; }; +class LLVM_LIBRARY_VISIBILITY Contiki : public Generic_ELF { +public: + Contiki(const Driver , const llvm::Triple , + const llvm::opt::ArgList ); + + SanitizerMask getSupportedSanitizers() const override; +}; + } // end namespace toolchains } // end namespace driver } // end namespace clang Index: cfe/trunk/lib/Driver/ToolChains.cpp === --- cfe/trunk/lib/Driver/ToolChains.cpp +++ cfe/trunk/lib/Driver/ToolChains.cpp @@ -5305,3 +5305,14 @@ Res |= SanitizerKind::Vptr; return Res; } + +Contiki::Contiki(const Driver , const llvm::Triple , const ArgList ) +: Generic_ELF(D, Triple, Args) {} + +SanitizerMask Contiki::getSupportedSanitizers() const { + const bool IsX86 = getTriple().getArch() == llvm::Triple::x86; + SanitizerMask Res = ToolChain::getSupportedSanitizers(); + if (IsX86) +Res |= SanitizerKind::SafeStack; + return Res; +} Index: cfe/trunk/lib/Driver/Driver.cpp
Re: [PATCH] D19854: Define Contiki OS toolchain
mlemay-intel added a comment. In https://reviews.llvm.org/D19854#551260, @Eugene.Zelenko wrote: > Looks like patch was not committed. This patch is only useful in combination with https://reviews.llvm.org/D19852, so I was waiting for that one to be approved so these can be committed at the same time. I can go ahead and request that this one be committed now if you prefer, though. https://reviews.llvm.org/D19854 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D19854: Define Contiki OS toolchain
Eugene.Zelenko added a subscriber: Eugene.Zelenko. Eugene.Zelenko added a comment. Looks like patch was not committed. https://reviews.llvm.org/D19854 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D19854: Define Contiki OS toolchain
mlemay-intel updated this revision to Diff 70076. mlemay-intel added a comment. Fixed indentation of Contiki constructor in ToolChains.h. https://reviews.llvm.org/D19854 Files: lib/Driver/Driver.cpp lib/Driver/ToolChains.cpp lib/Driver/ToolChains.h test/Driver/fsanitize.c Index: test/Driver/fsanitize.c === --- test/Driver/fsanitize.c +++ test/Driver/fsanitize.c @@ -391,6 +391,7 @@ // RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -fstack-protector-all -### %s 2>&1 | FileCheck %s -check-prefix=SP // RUN: %clang -target arm-linux-androideabi -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP // RUN: %clang -target aarch64-linux-android -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP +// RUN: %clang -target i386-contiki-unknown -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP // NO-SP-NOT: stack-protector // NO-SP: "-fsanitize=safe-stack" // SP: "-fsanitize=safe-stack" Index: lib/Driver/ToolChains.h === --- lib/Driver/ToolChains.h +++ lib/Driver/ToolChains.h @@ -1215,6 +1215,14 @@ Tool *buildLinker() const override; }; +class LLVM_LIBRARY_VISIBILITY Contiki : public Generic_ELF { +public: + Contiki(const Driver , const llvm::Triple , + const llvm::opt::ArgList ); + + SanitizerMask getSupportedSanitizers() const override; +}; + } // end namespace toolchains } // end namespace driver } // end namespace clang Index: lib/Driver/ToolChains.cpp === --- lib/Driver/ToolChains.cpp +++ lib/Driver/ToolChains.cpp @@ -5185,3 +5185,14 @@ Res |= SanitizerKind::Vptr; return Res; } + +Contiki::Contiki(const Driver , const llvm::Triple , const ArgList ) +: Generic_ELF(D, Triple, Args) {} + +SanitizerMask Contiki::getSupportedSanitizers() const { + const bool IsX86 = getTriple().getArch() == llvm::Triple::x86; + SanitizerMask Res = ToolChain::getSupportedSanitizers(); + if (IsX86) +Res |= SanitizerKind::SafeStack; + return Res; +} Index: lib/Driver/Driver.cpp === --- lib/Driver/Driver.cpp +++ lib/Driver/Driver.cpp @@ -2715,6 +2715,9 @@ case llvm::Triple::PS4: TC = new toolchains::PS4CPU(*this, Target, Args); break; +case llvm::Triple::Contiki: + TC = new toolchains::Contiki(*this, Target, Args); + break; default: // Of these targets, Hexagon is the only one that might have // an OS of Linux, in which case it got handled above already. Index: test/Driver/fsanitize.c === --- test/Driver/fsanitize.c +++ test/Driver/fsanitize.c @@ -391,6 +391,7 @@ // RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -fstack-protector-all -### %s 2>&1 | FileCheck %s -check-prefix=SP // RUN: %clang -target arm-linux-androideabi -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP // RUN: %clang -target aarch64-linux-android -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP +// RUN: %clang -target i386-contiki-unknown -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP // NO-SP-NOT: stack-protector // NO-SP: "-fsanitize=safe-stack" // SP: "-fsanitize=safe-stack" Index: lib/Driver/ToolChains.h === --- lib/Driver/ToolChains.h +++ lib/Driver/ToolChains.h @@ -1215,6 +1215,14 @@ Tool *buildLinker() const override; }; +class LLVM_LIBRARY_VISIBILITY Contiki : public Generic_ELF { +public: + Contiki(const Driver , const llvm::Triple , + const llvm::opt::ArgList ); + + SanitizerMask getSupportedSanitizers() const override; +}; + } // end namespace toolchains } // end namespace driver } // end namespace clang Index: lib/Driver/ToolChains.cpp === --- lib/Driver/ToolChains.cpp +++ lib/Driver/ToolChains.cpp @@ -5185,3 +5185,14 @@ Res |= SanitizerKind::Vptr; return Res; } + +Contiki::Contiki(const Driver , const llvm::Triple , const ArgList ) +: Generic_ELF(D, Triple, Args) {} + +SanitizerMask Contiki::getSupportedSanitizers() const { + const bool IsX86 = getTriple().getArch() == llvm::Triple::x86; + SanitizerMask Res = ToolChain::getSupportedSanitizers(); + if (IsX86) +Res |= SanitizerKind::SafeStack; + return Res; +} Index: lib/Driver/Driver.cpp === --- lib/Driver/Driver.cpp +++ lib/Driver/Driver.cpp @@ -2715,6 +2715,9 @@ case llvm::Triple::PS4: TC = new toolchains::PS4CPU(*this, Target, Args); break; +case llvm::Triple::Contiki: + TC = new toolchains::Contiki(*this, Target, Args); + break; default: // Of these targets,
Re: [PATCH] D19854: Define Contiki OS toolchain
eugenis accepted this revision. eugenis added a comment. This revision is now accepted and ready to land. LGTM http://reviews.llvm.org/D19854 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D19854: Define Contiki OS toolchain
mlemay-intel updated this revision to Diff 60357. mlemay-intel added a comment. Added driver test. http://reviews.llvm.org/D19854 Files: lib/Driver/Driver.cpp lib/Driver/ToolChains.cpp lib/Driver/ToolChains.h test/Driver/fsanitize.c Index: test/Driver/fsanitize.c === --- test/Driver/fsanitize.c +++ test/Driver/fsanitize.c @@ -386,6 +386,7 @@ // RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -fstack-protector-all -### %s 2>&1 | FileCheck %s -check-prefix=SP // RUN: %clang -target arm-linux-androideabi -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP // RUN: %clang -target aarch64-linux-android -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP +// RUN: %clang -target i386-contiki-unknown -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP // NO-SP-NOT: stack-protector // NO-SP: "-fsanitize=safe-stack" // SP: "-fsanitize=safe-stack" Index: lib/Driver/ToolChains.h === --- lib/Driver/ToolChains.h +++ lib/Driver/ToolChains.h @@ -1191,6 +1191,14 @@ Tool *buildLinker() const override; }; +class LLVM_LIBRARY_VISIBILITY Contiki : public Generic_ELF { +public: + Contiki(const Driver , const llvm::Triple , + const llvm::opt::ArgList ); + + SanitizerMask getSupportedSanitizers() const override; +}; + } // end namespace toolchains } // end namespace driver } // end namespace clang Index: lib/Driver/ToolChains.cpp === --- lib/Driver/ToolChains.cpp +++ lib/Driver/ToolChains.cpp @@ -4984,3 +4984,14 @@ Res |= SanitizerKind::Vptr; return Res; } + +Contiki::Contiki(const Driver , const llvm::Triple , const ArgList ) +: Generic_ELF(D, Triple, Args) {} + +SanitizerMask Contiki::getSupportedSanitizers() const { + const bool IsX86 = getTriple().getArch() == llvm::Triple::x86; + SanitizerMask Res = ToolChain::getSupportedSanitizers(); + if (IsX86) +Res |= SanitizerKind::SafeStack; + return Res; +} Index: lib/Driver/Driver.cpp === --- lib/Driver/Driver.cpp +++ lib/Driver/Driver.cpp @@ -2512,6 +2512,9 @@ case llvm::Triple::PS4: TC = new toolchains::PS4CPU(*this, Target, Args); break; +case llvm::Triple::Contiki: + TC = new toolchains::Contiki(*this, Target, Args); + break; default: // Of these targets, Hexagon is the only one that might have // an OS of Linux, in which case it got handled above already. Index: test/Driver/fsanitize.c === --- test/Driver/fsanitize.c +++ test/Driver/fsanitize.c @@ -386,6 +386,7 @@ // RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -fstack-protector-all -### %s 2>&1 | FileCheck %s -check-prefix=SP // RUN: %clang -target arm-linux-androideabi -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP // RUN: %clang -target aarch64-linux-android -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP +// RUN: %clang -target i386-contiki-unknown -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP // NO-SP-NOT: stack-protector // NO-SP: "-fsanitize=safe-stack" // SP: "-fsanitize=safe-stack" Index: lib/Driver/ToolChains.h === --- lib/Driver/ToolChains.h +++ lib/Driver/ToolChains.h @@ -1191,6 +1191,14 @@ Tool *buildLinker() const override; }; +class LLVM_LIBRARY_VISIBILITY Contiki : public Generic_ELF { +public: + Contiki(const Driver , const llvm::Triple , + const llvm::opt::ArgList ); + + SanitizerMask getSupportedSanitizers() const override; +}; + } // end namespace toolchains } // end namespace driver } // end namespace clang Index: lib/Driver/ToolChains.cpp === --- lib/Driver/ToolChains.cpp +++ lib/Driver/ToolChains.cpp @@ -4984,3 +4984,14 @@ Res |= SanitizerKind::Vptr; return Res; } + +Contiki::Contiki(const Driver , const llvm::Triple , const ArgList ) +: Generic_ELF(D, Triple, Args) {} + +SanitizerMask Contiki::getSupportedSanitizers() const { + const bool IsX86 = getTriple().getArch() == llvm::Triple::x86; + SanitizerMask Res = ToolChain::getSupportedSanitizers(); + if (IsX86) +Res |= SanitizerKind::SafeStack; + return Res; +} Index: lib/Driver/Driver.cpp === --- lib/Driver/Driver.cpp +++ lib/Driver/Driver.cpp @@ -2512,6 +2512,9 @@ case llvm::Triple::PS4: TC = new toolchains::PS4CPU(*this, Target, Args); break; +case llvm::Triple::Contiki: + TC = new toolchains::Contiki(*this, Target, Args); + break; default: // Of these targets, Hexagon is the only one that might have
Re: [PATCH] D19854: Define Contiki OS toolchain
eugenis added a comment. This needs a driver test. http://reviews.llvm.org/D19854 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D19854: Define Contiki OS toolchain
mlemay-intel created this revision. mlemay-intel added reviewers: pcc, eugenis. mlemay-intel added a subscriber: cfe-commits. It is defined with support for the SafeStack sanitizer on x86. http://reviews.llvm.org/D19854 Files: lib/Driver/Driver.cpp lib/Driver/ToolChains.cpp lib/Driver/ToolChains.h Index: lib/Driver/ToolChains.h === --- lib/Driver/ToolChains.h +++ lib/Driver/ToolChains.h @@ -1175,6 +1175,14 @@ Tool *buildLinker() const override; }; +class LLVM_LIBRARY_VISIBILITY Contiki : public Generic_ELF { +public: + Contiki(const Driver , const llvm::Triple , + const llvm::opt::ArgList ); + + SanitizerMask getSupportedSanitizers() const override; +}; + } // end namespace toolchains } // end namespace driver } // end namespace clang Index: lib/Driver/ToolChains.cpp === --- lib/Driver/ToolChains.cpp +++ lib/Driver/ToolChains.cpp @@ -4624,3 +4624,14 @@ Res |= SanitizerKind::Vptr; return Res; } + +Contiki::Contiki(const Driver , const llvm::Triple , const ArgList ) +: Generic_ELF(D, Triple, Args) {} + +SanitizerMask Contiki::getSupportedSanitizers() const { + const bool IsX86 = getTriple().getArch() == llvm::Triple::x86; + SanitizerMask Res = ToolChain::getSupportedSanitizers(); + if (IsX86) +Res |= SanitizerKind::SafeStack; + return Res; +} Index: lib/Driver/Driver.cpp === --- lib/Driver/Driver.cpp +++ lib/Driver/Driver.cpp @@ -2499,6 +2499,9 @@ case llvm::Triple::PS4: TC = new toolchains::PS4CPU(*this, Target, Args); break; +case llvm::Triple::Contiki: + TC = new toolchains::Contiki(*this, Target, Args); + break; default: // Of these targets, Hexagon is the only one that might have // an OS of Linux, in which case it got handled above already. Index: lib/Driver/ToolChains.h === --- lib/Driver/ToolChains.h +++ lib/Driver/ToolChains.h @@ -1175,6 +1175,14 @@ Tool *buildLinker() const override; }; +class LLVM_LIBRARY_VISIBILITY Contiki : public Generic_ELF { +public: + Contiki(const Driver , const llvm::Triple , + const llvm::opt::ArgList ); + + SanitizerMask getSupportedSanitizers() const override; +}; + } // end namespace toolchains } // end namespace driver } // end namespace clang Index: lib/Driver/ToolChains.cpp === --- lib/Driver/ToolChains.cpp +++ lib/Driver/ToolChains.cpp @@ -4624,3 +4624,14 @@ Res |= SanitizerKind::Vptr; return Res; } + +Contiki::Contiki(const Driver , const llvm::Triple , const ArgList ) +: Generic_ELF(D, Triple, Args) {} + +SanitizerMask Contiki::getSupportedSanitizers() const { + const bool IsX86 = getTriple().getArch() == llvm::Triple::x86; + SanitizerMask Res = ToolChain::getSupportedSanitizers(); + if (IsX86) +Res |= SanitizerKind::SafeStack; + return Res; +} Index: lib/Driver/Driver.cpp === --- lib/Driver/Driver.cpp +++ lib/Driver/Driver.cpp @@ -2499,6 +2499,9 @@ case llvm::Triple::PS4: TC = new toolchains::PS4CPU(*this, Target, Args); break; +case llvm::Triple::Contiki: + TC = new toolchains::Contiki(*this, Target, Args); + break; default: // Of these targets, Hexagon is the only one that might have // an OS of Linux, in which case it got handled above already. ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits