From owner-svn-src-head@freebsd.org Sun Mar 12 15:35:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30558D09032; Sun, 12 Mar 2017 15:35:30 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id EDE57114B; Sun, 12 Mar 2017 15:35:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 9AB73D64DCB; Mon, 13 Mar 2017 02:35:20 +1100 (AEDT) Date: Mon, 13 Mar 2017 02:35:19 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andriy Gapon cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r315068 - head/sys/modules/qlxgbe In-Reply-To: <18e52ee7-0b27-7aff-6b69-75b27673a8f4@FreeBSD.org> Message-ID: <20170313020809.P31989@besplex.bde.org> References: <201703111516.v2BFGtkn006959@repo.freebsd.org> <20170312124945.C4483@besplex.bde.org> <18e52ee7-0b27-7aff-6b69-75b27673a8f4@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=AYLBJzfG c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=I_GFfGCxctvMgBUQ9gcA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Sun, 12 Mar 2017 15:35:30 -0000 On Sun, 12 Mar 2017, Andriy Gapon wrote: > On 12/03/2017 04:44, Bruce Evans wrote: >> On Sat, 11 Mar 2017, Andriy Gapon wrote: >> >>> Log: >>> revert r314862, use of GCC_MS_EXTENSIONS in qlxgbe >>> >>> Commit r278913 made explicit use of GCC_MS_EXTENSIONS unnecessary. >>> >>> Requested by: glebius >> >> Does this module actually use ms extensions? This seems unlikely, since >> only gcc supports them. > > It probably doesn't. > >> My kernels compile correctly with the correct CFLAGS (gcc -std=gnu99 >> -fno-ms-extensions). > > How did you manage to pass -std=gnu99 to the module build? I edited kern.mk to change CSTD together with removing -fms-extensions. > No matter what flags I tried to modify the actual compiler invocations still had > -std=iso9899:1999 after -std=gnu99 in them, so my modifications had no effect. > GCC_MS_EXTENSIONS was the easiest way to get the job done. Hmm, more bugs: - kern.mk forces its wrong CSTD using '='. bsd.sys.mk uses '?=' as well as the correct CSTD. - -fms-extensions is now hard-coded too. However, it is a bit earlier in CFLAGS so might be easier to override. Controlling the order of CFLAGS has always been a problem. There are many undocumented macros and it isn't clear which ones are implementation details. Now I get -std second last and -Werror last CFLAGS. -Werror is set by WERROR?=, so WERROR can be used for overrides. Overriding -std is accepted and hopefully works. WERROR is before PROF in NORMAL_C, but PROF is not in NORMAL_S or PROFILE_C, so of you want to override PROF then you have to fix this or duplicate the overrides in WERROR and PROF. There are further problems with special rules. The ones for aesni are of nearly the lowest quality. These ensure breaking gcc using the order WERROR, NO_CAST_QUAL, PROF, then main unportable -m's (with at least -msse4 unsupported by gcc-4.2.1), then .IMPSRC. Bruce