EDIT: Thank you so much for the responses, everyone. I will be reading them
I want to start by pointing out that a lot of the time, they didn't really have much persecution to dodge. The "enlightenment" is a term that means different things in different contexts, but let's opt for an expansive definition here that extends back into the earlier part of the 17th century. Partly, this is because I take the case of Galileo to be a motivating case behind this question. Partly, this will allow us to equate "enlightenment philosopher" with "early modern philosopher". Anyway, one extremely common list of the canonical early modern philosophers that you might encounter in an introductory class on the period goes like this...
Descartes
Spinoza
Leibniz
Locke
Berkeley
Hume
Kant
What I want to stress right out of the gate here is that the only two figures who are genuinely hostile to traditional Christianity are Spinoza and Hume. Spinoza's views were quite radical, but speaking of him in opposition to the Church is a bit odd in the first place. He was, after all, born a Jew. Hume was probably an atheist, though matters are not always terribly straightforward. Hume certainly would have said, I think, that there was no rational justification for religious belief. But then again, he didn't think there was rational justification for the belief that the sun will rise tomorrow. Still, his argument against belief in miracles seems cutting even in the context of his broader skepticism.
Before looking at bit at Spinoza as a test case, let's say something quick about the other philosophers above. Descartes, arguably the transformative figure of the philosophical age, very obviously considers himself to be an orthodox Catholic. Indeed, the project of his magnum opus, the Meditations, is explicitly framed in this way. He was no doubt critical of much Christian philosophy as he knew it, as he was hostile to the underlying Aristotelianism; Descartes, while often called the father of modern philosophy, is somewhat surprisingly to modern readers fundamentally a Platonic reaction against the Aristotelianism of the schools. And he does sometimes dance pretty close to heresy; the accusations of Pelagianism are not far off the mark. Most famously, he suppresses a work on natural philosophy, Le Monde, after he became aware of the fate of Galileo. But still, don't let this distract from the broadly Christian character of Cartesianism. This is a man who defends the immortality of an immaterial soul, consistently and vehemently defends a supped-up version of the (in)famous ontological argument, and ends the third Meditation in something like a religious rapture. Descartes stands tall near the beginning of modern science, mathematics, and philosophy, but he was no heretic. Similar stories could be told about Leibniz and Locke and later on about Kant. And Berkeley was a bishop for crying out loud!
Okay, Spinoza. Spinoza did indeed experience some persecution for his beliefs, most dramatically in his expulsion from his community. Spinoza was born into the Sephardic community of Amsterdam, a community of Portuguese-Jewish people who had relocated themselves in Dutch lands. He was excommunicated for "monstrous deeds" and "abominable heresies". His later philosophical views are surely informative here. Spinoza's masterpiece, the Ethics, contains near constant references to "God or nature" throughout. The word rendered here as 'or' was in Spinoza's Latin sive. The idea here is that the 'or' is expressing a different name for the same thing, much as we might say "The first president, or George Washington, defeated the British." Spinoza's "God" turns out to bear very, very little resemblance to the traditional notion in Judaism (or Christianity). Still, the Dutch were a relatively tolerant society, and no one ever tried to burn him at the stake or anything like that. He made his living grinding optical lenses for use in scientific equipment; though he obviously considered his philosophical work his chief occupation, he clearly wished to earn his daily bread in a way that would be useful to the advancement of knowledge as well. This choice of profession sadly led him to an early grave - years of breathing in tiny particles of glass ravaged his lungs, and Spinoza died at the age of 44. Before his death, however, he was paid a brief visit by Leibniz. Oh, to have been a fly on the wall!
I'll also quickly flag that Hume experienced some professional setbacks owing to his religious views; probably, his lack of orthodoxy made his pursuit of an academic position extraordinarily difficult. But, like Spinoza, he had the good fortune of living in a relatively tolerate place and time, so nobody tried to burn him at the stake either.
For further reading here, the best introduction to the canonical early modern philosophers, in my opinion at least, is Learning from Six Philosophers by Jonathan Bennett. Though there are tons of good introductions out there, many of them admittedly more beginner friendly than Bennett's dense and scholarly treatment.