We've encountered a critical issue with the new linker of CLT16 (version 16.1.0.0.1.1729049160) that prevents proper initialization of BLOCK DATA.
BLOCK DATA are used to initialize global variables in our Fortran code, and its failure to initialize those variables leads to a program crash. This affects our community of more that thousand scientists worldwide.
The current workaround is using the -ld_classic linker option. However, this option is deprecated and will be removed in a future release, as described in the Xcode release note.
I've attached a minimal example that reproduces the problem using GNU gfortran with the following instructions (the attached main.f.txt and bd.f.txt need to be rename to main.f and bd.f, respectively):
gfortran -c bd.f
gfortran -c main.f
ar rv libtest.a bd.o main.o
gfortran -ld_classic -o good.x -L. libtest.a
gfortran -o bad.x -L. libtest.a
Running the two programs, one can see that the BLOCK DATA are not initialised without the option ld_classic,
$ > ./good.x
3.7273802569289098 2.8083922366048202
$ > ./bad.x
0.0000000000000000 0.0000000000000000
We kindly request your attention to this matter and a prompt solution or alternative workaround.
Best regards
main.f.txt
bd.f.txt
part.txt