If you write a bare metal application, then it runs on bare metal and cannot run on Linux. The code for a bare metal application should use the bare metal headers, libraries, compilers, linkers, etc.
If you write a Linux application, then it runs on Linux and cannot run on bare metal. The code for a Linux application should use the Linux headers, libraries, compilers, linkers, etc.
Xilinx SDK can be used for both types of applications (bare metal and Linux) but libraries, compilers, linkers, etc are different for these types of applications and cannot be mixed.