Patch to enable -fPIE and -fstack-protector by default on OpenBSD

Rafael EspĂ­ndola rafael.espindola at gmail.com
Mon Jun 3 21:53:56 PDT 2013


needs a testcase.

On 31 May 2013 22:09, Matthew Dempsky <matthew at dempsky.org> wrote:
> On OpenBSD, we enable -fPIE and -fstack-protector by default in GCC.
> Patch below does the same for Clang.
>
> --- tools/clang/lib/Driver/ToolChains.h.orig    Mon Apr 29 18:21:43 2013
> +++ tools/clang/lib/Driver/ToolChains.h Fri May 31 18:23:13 2013
> @@ -427,6 +427,11 @@ class LLVM_LIBRARY_VISIBILITY OpenBSD : public Generic
>
>    virtual bool IsMathErrnoDefault() const { return false; }
>    virtual bool IsObjCNonFragileABIDefault() const { return true; }
> +  virtual bool isPIEDefault() const { return true; }
> +
> +  virtual unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const {
> +    return 1;
> +  }
>
>  protected:
>    virtual Tool *buildAssembler() const;
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list