Date: Fri, 30 Jan 2015 16:41:06 -0800 (PST) From: Don Lewis <truckman@FreeBSD.org> To: tijl@FreeBSD.org Cc: ports@FreeBSD.org, bsd-lists@bsdforge.com Subject: Re: testing the value of ${CXX} in ports Makefile Message-ID: <201501310041.t0V0f6io017536@gw.catspoiler.org> In-Reply-To: <20150130094046.19e227e9@kalimero.tijl.coosemans.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 30 Jan, Tijl Coosemans wrote: > On Thu, 29 Jan 2015 22:46:32 -0800 (PST) Don Lewis <truckman@FreeBSD.org> wrote: >> gcc46, gcc47, gcc48, and probably gcc5 (haven't tested that one yet) all >> work. gcc49 requires a source patch. > > Can't you make the patch work with all versions of gcc? Well, I could, but what's the fun in that? The port wants to use -Os when compiling some of it's code. It switches to -O0 if compiling for DEBUG. Unfortunately, with gcc 4.9, -Os seems to trigger a code generation bug. The alternatives that I've considered: Set USE_GCC=4.8, the downside being that when the default ports version of gcc is changed to 4.9, anyone using the port will need to install gcc 4.8 as well to get the correct version of the gcc runtime. Patch the port to always use -O0, the downside being that when using gcc 4.8, the code size gets larger. I haven't quantified by how much. Only patch the port when building with gcc 4.9. Patch the port configure script to detect the gcc version and adjust the optimization level accordingly. The third option is fairly easy to do, but has to be done with shell code instead of .if / .endif in the Makefile. If the port actually obeyed CFLAGS, I think adjusting the optimization level by changing CFLAGS is also possible, but would require me to study the make documentation since using .if / .endif still wouldn't work. I think it would require a bunch of make variable expansion magic that I don't fully understand. Upstream would probably prefer the fourth option, but that's more difficult and I don't want to put that much effort into it.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501310041.t0V0f6io017536>