Use -fPIE for clang builds

Executables can't be produced without this option using clang available
under Ubuntu 20.04, as linking fails with a lot of errors of the form

/usr/bin/ld: Swig/wrapfunc.o: relocation R_X86_64_32S against `.rodata'
can not be used when making a PIE object; recompile with -fPIE
This commit is contained in:
Vadim Zeitlin 2021-09-30 18:12:50 +02:00
commit 6c2a4607f0

View file

@ -83,6 +83,9 @@ jobs:
if test '${{ matrix.compiler }}' = 'clang'; then
CC="clang"
CXX="clang++"
CFLAGS="$CFLAGS -fPIE"
CXXFLAGS="$CXXFLAGS -fPIE"
elif test -n "$GCC"; then
CC="gcc-$GCC"
CXX="g++-$GCC"