Makkhali Gosala, the founder of the Ajivika sect, was a contemporary and friend of Mahavira for 6 years before they parted ways due to philosophical differences. Buddha lived slightly later, Ashoka came centuries after, and Shankaracharya was much later (8th century CE).