Use the -fvisibility=hidden flag for all underlying libraries