From owner-freebsd-stable@FreeBSD.ORG Thu Feb 7 21:06:54 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 249B03FE; Thu, 7 Feb 2013 21:06:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) by mx1.freebsd.org (Postfix) with ESMTP id DDB1ADA9; Thu, 7 Feb 2013 21:06:53 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:204:4bff:fe01:de8a] (spaceball.andric.com [IPv6:2001:7b8:3a7:0:204:4bff:fe01:de8a]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id E718D5C43; Thu, 7 Feb 2013 22:06:51 +0100 (CET) Message-ID: <51141769.5060905@FreeBSD.org> Date: Thu, 07 Feb 2013 22:06:49 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20130117 Thunderbird/19.0 MIME-Version: 1.0 To: Kimmo Paasiala , freebsd-stable@freebsd.org, FreeBSD current Subject: Re: CLANG and -fstack-protector References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 21:06:54 -0000 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. > 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. 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.