A long time ago we added a wrapper and an autoconf test for the __isoc99_fscanf function that can be found in newer glibc implementations. It doesn't appear as though this old autoconf test appropriately tests whether we should include a wrapper for the __isoc99_fscanf routine. Locally, this autoconf test was failing even though I have __isoc99_fscanf, leading to missed instrumentation of these calls.
We can't simply offer wrappers for both fscanf and __isoc99_fscanf, as this leads to symbol redefinition errors when building Darshan's shared library.
This PR tries to address the issue by detecting the presence of __isoc99_fscanf, and including a wrapper for that call if found. If not found, we include our traditional fscanf wrapper. The key is to ensure that only one of these wrappers is available in Darshan, and that we prefer __isoc99_fscanf if available.
A long time ago we added a wrapper and an autoconf test for the
__isoc99_fscanf
function that can be found in newer glibc implementations. It doesn't appear as though this old autoconf test appropriately tests whether we should include a wrapper for the__isoc99_fscanf
routine. Locally, this autoconf test was failing even though I have__isoc99_fscanf
, leading to missed instrumentation of these calls.We can't simply offer wrappers for both
fscanf
and__isoc99_fscanf
, as this leads to symbol redefinition errors when building Darshan's shared library.This PR tries to address the issue by detecting the presence of
__isoc99_fscanf
, and including a wrapper for that call if found. If not found, we include our traditionalfscanf
wrapper. The key is to ensure that only one of these wrappers is available in Darshan, and that we prefer__isoc99_fscanf
if available.