GCC 6 introduces the --enable-default-pie option, however it looks like gnat doesn't respect this option. Seen while running the examples/matrix test in gprbuild on x86_64-linux-gnu (gnatgcc here is just a symlink to the gcc driver matching the gnat version): make[1]: Entering directory '/tmp/adt-run.SU7baW/adttmp/examples/matrix' gprconfig --batch --config Ada --config C --config Fortran -o default.cgpr Creating configuration file: default.cgpr gprbuild using project file matrix.gpr gnatgcc -c -gnat05 main.adb gfortran -c multmat.f gcc -c initmat.c gprbind main.bexch gnatbind main.ali gnatgcc -c b__main.adb ar cr libmatrix.a ... ranlib libmatrix.a gfortran main.o -o main /usr/bin/ld: main.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC main.o: error adding symbols: Bad value Makefile:2: recipe for target 'all' failed make[1]: Leaving directory '/tmp/adt-run.SU7baW/adttmp/examples/matrix' Makefile:5: recipe for target 'all' failed collect2: error: ld returned 1 exit status gprbuild: link of main.adb failed make[1]: *** [all] Error 4
There is not enough information. Please provide a testcase and a GCC command line (no, a GPRbuild invocation doesn't qualify).
Does examples/first_steps/ada_main.gpr trigger the failure? And the same project with the C library removed? Once you have a minimal reproducer, you may get the exact compiler invokations with "gprbuild -v" (normal output is misleading).