Unable to use cuda-gdb with my project. Compilation error. But I can debug the sample application bi

When I pass the “-g -G” flags to nvcc in my cuda project, I get the following error:

my_fun.cu.o: In function `$$SymbolTable:
Note that nothing appears after the colon punctuation mark.

And I get this error message 5 times per .cu file with a final:
collect2: ld returned 1 exit status

My makefile defines some variables (for example OTHER_FLAGS_NVCC := -g -G --ptxas-options=-v) and then includes common.mk
Everything has been working fine so far, just -G that is not working.

Any ideas?