The option -export-dynamic is a linker option not (no longer?) understood by the compiler; pass -rdynamic to the compiler to have it pass -export-dynamic to the linker instead.