Do you need a static library or a dynamic library? The use of the archiver ar suggests a static library, but I am confused by abc.so, since the suffix .so suggests a dynamic library to me. The use of ar with a dynamic library seems incorrect to me, gcc -shared or something of that sort should be used.
For a worked example of how to build a static library with CUDA on Linux, see my forum post here
If you need to build a dynamic library, I cannot help. It has probably been ten years or more since I last needed to build a dynamic library on Linux, and I do not have a Linux system at hand right now to refresh my memory. I suspect the title of this thread will not entice many readers to follow it to the end, so consider asking a new question on how to build a dynamic library with CUDA on Linux, as that is the task you are actually trying to accomplish from what I understand now.