cgen: nva needs position independent code
commitfbb0d0515d201fba08fcc3a3d0a2a13b8dda10fd
authorMarcin Cieślak <saper@saper.info>
Wed, 7 Dec 2022 00:52:21 +0000 (7 01:52 +0100)
committerMarcin Cieślak <saper@saper.info>
Wed, 7 Dec 2022 10:57:26 +0000 (7 11:57 +0100)
tree043573756d424be6b588bdc3160c1c0b5f8eb6f7
parente11d670a70ae0455261ead53cdd09c321974cc64
cgen: nva needs position independent code

When building with clang on FreeBSD 14 we are getting:

[ 43%] Generating nvapy.c
[ 43%] Building C object nva/CMakeFiles/nvapy.dir/nvapy.c.o
[ 44%] Building C object nva/CMakeFiles/nvapy.dir/nva.c.o
[ 44%] Building C object nva/CMakeFiles/nvapy.dir/__/nvhw/chipset.c.o
[ 44%] Linking C shared module nvapy.so
ld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in ../cgen/libcgen.a(gpu.c.o)
>>> referenced by gpu.c
>>>               gpu.c.o:(gpu_list) in archive ../cgen/libcgen.a

This fixes this error.
cgen/CMakeLists.txt