Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it safe to use customized CFLAGS while compiling linux kernel, e.g enable SSE, MMX instructions, is that a problem ?

share|improve this question
I think the kernel makefiles already pick decent flags. I'd be wary of changing them, as the kernel source sometimes uses code that just happens to work with the expected version of GCC and may not be robust to unexpected compiler flags. – Gilles Jul 18 '12 at 23:45

If you are building a custom kernel then you are already playing with features which may or may not work depending on version of GCC (as mentioned by GillieS) and other factors. So deciding to enable SSE,MX and so forth, probably doesn't introduce any more 'risk'. Basically, you are going to need to test your custom kernel extensively anyway, so it depends on what you call 'safe'.

If you are building modules (device drivers) for an existing kernel, then you really do need to use the same GCC as the kernel and the CFLAGS selected by the appropriate makefiles or you are asking for trouble.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.