CFLAGS vs COPTFLAGS for building kernel modules



/usr/share/examples/etc/make.conf v1.265.2.1 states:

# To compile just the kernel with special optimizations, you should use
# this instead of CFLAGS (which is not applicable to kernel builds anyway).
# There is very little to gain by using higher optimization levels, and doing
# so can cause problems.
#
#COPTFLAGS= -O -pipe

Unfortunately, it seems that kernel modules are build with CFLAGS
rather than COPTFLAGS. This is somewhat embarrassing when CFLAGS
includes options that don't work in the kernel but aren't explicitly
disabled (eg -msse3). My make-foo isn't up to quickly isolating the
problem.

--
Peter Jeremy
_______________________________________________
freebsd-stable@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: 2.6.24-rc1-82798a1 compile failure (x86_64)
    ... ignore those and set its own CFLAGS, ... The kernel will now honour the users CFLAGS setting as you just discovered. ... The flags will be appended to the flags specified by the kernel. ... extra-CFLAGS option to .config and perhaps a 'make configpickupCFLAGS' ...
    (Linux-Kernel)
  • Re: how to stop multpile compilations
    ... compiled till the latest change and not to compile if already done. ... Or your kernel tree is on an NFS filesystem, ... some flags(for example cflags) to take care of this. ...
    (comp.os.linux.development.system)
  • Re: 2.6.24-rc1-82798a1 compile failure (x86_64)
    ... ignore those and set its own CFLAGS, ... The kernel will now honour the users CFLAGS setting as you just discovered. ... The flags will be appended to the flags specified by the kernel. ... extra-CFLAGS option to .config and perhaps a 'make configpickupCFLAGS' ...
    (Linux-Kernel)
  • Re: 2.6.24-rc1-82798a1 compile failure (x86_64)
    ... The kernel already sets all flags correctly, ... CFLAGS has global meaning in every ... If people set something like CFLAGS in their environment, ...
    (Linux-Kernel)
  • Re: 2.6.24-rc1-82798a1 compile failure (x86_64)
    ... always thought the kernel would ignore those and set its own ... CFLAGS, but I was wrong. ... conflicting options. ... There had been need of rain for many days. ...
    (Linux-Kernel)