passing optimization options to gcc through nvcc

I have been trying to build a hello world with nvcc.

nvcc -g
There are know compilation erros reported. And the executable runs fine without any issues.

But once i pass optimization options it reports a host of compilation errors.

nvcc -g -O2

error: inline function ‘double fabs(double)’ cannot be declared weak
error: inline function ‘float fabsf(float)’ cannot be declared weak
error: inline function ‘double floor(double)’ cannot be declared weak

Tons of others are reported.

These erros come from maths_functions.h file in cuda installation directory

The same errors are reproducible with -deviceemu option also.

Following are the configuration of my machine and Cuda
Linux : 32 bit
Fedora 11
Cuda Version : 2.3
gcc version : 4.4.1

Can’t we pass optimization options through nvcc.