From owner-svn-src-head@freebsd.org Wed Nov 13 03:00:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE9BF17B404; Wed, 13 Nov 2019 03:00:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47CTrJ5cD0z4RqT; Wed, 13 Nov 2019 03:00:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3B4299C4; Wed, 13 Nov 2019 03:00:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAD30Wkm099997; Wed, 13 Nov 2019 03:00:32 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAD30WUE099996; Wed, 13 Nov 2019 03:00:32 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201911130300.xAD30WUE099996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 13 Nov 2019 03:00:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354672 - head/lib/libc/secure X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libc/secure X-SVN-Commit-Revision: 354672 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Nov 2019 03:00:32 -0000 Author: kevans Date: Wed Nov 13 03:00:32 2019 New Revision: 354672 URL: https://svnweb.freebsd.org/changeset/base/354672 Log: ssp: rework the logic to use priority=200 on clang builds The preproc logic was added at the last minute to appease GCC 4.2, and kevans@ did clearly not go back and double-check that the logic worked out for clang builds to use the new variant. It turns out that clang defines __GNUC__ == 4. Flip it around and check __clang__ as well, leaving a note to remove it later. Reported by: cem Modified: head/lib/libc/secure/stack_protector.c Modified: head/lib/libc/secure/stack_protector.c ============================================================================== --- head/lib/libc/secure/stack_protector.c Wed Nov 13 02:22:00 2019 (r354671) +++ head/lib/libc/secure/stack_protector.c Wed Nov 13 03:00:32 2019 (r354672) @@ -47,13 +47,15 @@ __FBSDID("$FreeBSD$"); * they're either not usually statically linked or they simply don't do things * in constructors that would be adversely affected by their positioning with * respect to this initialization. + * + * This conditional should be removed when GCC 4.2 is removed. */ -#if defined(__GNUC__) && __GNUC__ <= 4 -#define _GUARD_SETUP_CTOR_ATTR \ - __attribute__((__constructor__, __used__)); -#else +#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ > 4) #define _GUARD_SETUP_CTOR_ATTR \ __attribute__((__constructor__ (200), __used__)); +#else +#define _GUARD_SETUP_CTOR_ATTR \ + __attribute__((__constructor__, __used__)); #endif extern int __sysctl(const int *name, u_int namelen, void *oldp,