The return value from EC_KEY_new_by_curve_name would be NULL. And right, cross-compilation makes this pretty hard. In case you link dynamically with libcrypto, it isn't even the build system that should determine this, as it may be different with the same binary on a different system.