On Fri, Sep 2, 2016 at 4:40 AM, Joerg Sonnenberger <[email protected]> wrote: > On Thu, Sep 01, 2016 at 10:00:52PM +0900, Ryota Ozaki wrote: >> On Thu, Sep 1, 2016 at 6:45 PM, Joerg Sonnenberger <[email protected]> wrote: >> > On Thu, Sep 01, 2016 at 03:46:15PM +0900, Ryota Ozaki wrote: >> >> http://www.netbsd.org/~ozaki-r/align-functions-16.diff >> >> >> >> The patch adds the option to sys/arch/amd64/conf/Makefile.amd64. >> >> Is it a feasible place to add? >> > >> > There are two small issues I have with this patch: >> > (1) I think it should be restricted to GCC with an appropiate comment of >> > what this is a workaround for. Clang seems to behave a lot more sensible >> > out of the box. If there are CPU models with a different base alignment >> > and the user asked for one of them as optimisation target, it should be >> > honored IMO. >> > (2) This should not touch CFLAGS, but COPTS. >> >> Okay, I see. How about the following patch? >> (nonaka@ helped improving Makefile options.) >> >> http://www.netbsd.org/~ozaki-r/align-functions-16.v2.diff > > Almost. You shouldn't need the whole if-block.
The if-block intends to add the option even when a kernel config (like GENERIC) has own COPTS. Well, should we diereclty add the option to COPTS in GENERIC instead? Or we may be able to get rid of (or comment-out) COPTS from GENERIC because it's the same as DEFCOPTS. > I don't understand the > bsd.own.mk reference, it doesn't contain -mtune=nocona here? I meant GCC_CONFIG_TUNE.x86_64=nocona line that makes gcc use nocona as the default value of -mtune. Okay, revised the comment like this: -# By default, our gcc uses -mtune=nocona for compiling the kernels -# (see share/mk/bsd.own.mk). With -mtune=nocona, gcc doesn't align +# Our gcc is built to use nocona as the default value of -mtune +# (see GCC_CONFIG_TUNE in share/mk/bsd.own.mk). With -mtune=nocona, +# gcc doesn't align (...) Thanks, ozaki-r
