The Philippines and Indonesia both issued tsunami warnings after a powerful 7.8 magnitude earthquake struck off Mindanao.