From owner-freebsd-stable@FreeBSD.ORG Thu Feb 7 23:40:02 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B1671EFC; Thu, 7 Feb 2013 23:40:02 +0000 (UTC) (envelope-from kpaasial@gmail.com) Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by mx1.freebsd.org (Postfix) with ESMTP id F2D7577E; Thu, 7 Feb 2013 23:40:01 +0000 (UTC) Received: by mail-wi0-f179.google.com with SMTP id ez12so219425wid.6 for ; Thu, 07 Feb 2013 15:40:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=denVb4VY8GZoHyzmxs5P+cwN4N515gPQDzAuynArfAQ=; b=qjon24ct1j4S6ztTjKH4lSUVSBjbDJZ0uSLTNnAvL/Pn3mjn7xntHLCd5V7ZH9NLx6 Z/lDweQkhThSYp+pAlUIp6hZ0bmpeXssy2kFdWdlPqmesVKuDCBWOQfX8+KqeIymBRlz PGoep5iT17woJz94Qcakq6CxVx1lK7vSkNlqCbtilNTLrEhXbda3HZ9xn35ZVm6aSpCf s8Z2JYUymYSa72SSLQ4NagFeDu9DmmstS+iI7fstR1flWoYOvtlpMBEuo4YW50y6ktI5 9JYoGKAIrgT7hiIuWhLecsT+LH5ixptzd9Rbkbfx5Yd1KzGNX96gE/vmXOP322YnAXhL 4noA== MIME-Version: 1.0 X-Received: by 10.194.122.199 with SMTP id lu7mr6088083wjb.42.1360280400722; Thu, 07 Feb 2013 15:40:00 -0800 (PST) Received: by 10.216.120.193 with HTTP; Thu, 7 Feb 2013 15:40:00 -0800 (PST) In-Reply-To: <51141769.5060905@FreeBSD.org> References: <51141769.5060905@FreeBSD.org> Date: Fri, 8 Feb 2013 01:40:00 +0200 Message-ID: Subject: Re: CLANG and -fstack-protector From: Kimmo Paasiala To: Dimitry Andric Content-Type: text/plain; charset=UTF-8 Cc: FreeBSD current , freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 23:40:02 -0000 On Thu, Feb 7, 2013 at 11:06 PM, Dimitry Andric wrote: > On 2013-02-07 20:42, Kimmo Paasiala wrote: >> >> Does the -fstack-protector option work on CLANG 3.1 and 3.2? > > > Yes, it works with both clang and gcc. > Good to know thank you! > >> There is thread on FreeBSD forums about the stack protector and ports >> and I'm wondering if it's possible to use the -fstack-protector option >> with CLANG. >> >> http://forums.freebsd.org/showthread.php?t=36927 > > > That thread seems to be full of confusion. :-) The base system is mostly > built with -fstack-protector, except for the ia64, arm and mips arches, > and for some specific cases where it is not necessary, or unwanted. I was aware of the base system being built with the stack protector on systems where it makes sense. > > Ports are largely independent of the base system, and their compilation > flags are different from port to port. You could set -fstack-protector > for your ports in either make.conf or ports.conf, if you wanted. Is there any work being done to provide an optional Makefile knob (WITH_STACK_PROTECTOR ?) to turn on -fstack-protector for ports that install network services (or other critical code)? I'd bet such feature would be popular.