Hi, building the port with WITH_PIE makes it fail (error message tells that ld can't relocate a specific symbol and that it should be recompiled with -fPIE). Until this is fixed, the port should get PIE_UNSAFE=yes in the Makefile (this fixes the build for me). Bye, Alexander.
*** Bug 268984 has been marked as a duplicate of this bug. ***
Created attachment 239510 [details] Set FFLAGS when WITH_PIE is defined The proposed patch sets FFLAGS when WITH_PIE is defined. This fixes Fortran programs.
Created attachment 239511 [details] Set CMAKE_Fortran_FLAGS Set CMAKE_Fortran_FLAGS=${FFLAGS} for Fortran ports using cmake.
There are two different problems: 1) FFLAGS is not set when WITH_MPI is defined. The first patch fixes that. 2) Even when FFLAGS is set, it may be ignored by cmake if CMAKE_Fortran_FLAGS is not set. The second patch fixes that. Remark: I modified Mk/Uses/fortran.mk for the cmake case, but we could also modify Mk/Uses/cmake.mk for the Fortran case. This should fix other Fortran ports, but it might also reveal brokenness in some other ports.
Assign to portmgr@FreeBSD.org who is handling Mk/Features/pie.mk.
(In reply to Thierry Thomas from comment #4) Hi Thierry you please look at Bug 268981 which has another cmake part for PIE stuff? How would this interact with your fortran patch?
Bug 268981 has a different patch and I validated that math/lapack and math/blas finish a PIE-build in poudriere with the more generic cmake patch in that bug. Thierry, can you please check if that other patch is ok for you instead of your patch? If yes, please close this bug as a duplicate of Bug 268981.
I tested this with py-scipy. Without your patch it fails, with your patch it compiles (and seems to work, at least an application which has it as a dependency doesn't show direct failures).