Law enforcement sources confirm… Mac was found Friday at around noon at his San Fernando Valley home and was pronounced dead at the scene.

We’re told authorities were alerted by a male friend who placed a 911 call from Mac’s home.

And there’s this … in a doc made a few years ago, Mac said, “I’d rather be the corny white rapper than the drugged-out mess who can’t even get out of his house. Overdosing is just not cool. You don’t go down in history because you overdose. You just die.”

Miller has battled substance abuse issues for years … something that came up again in the wake of his breakup with Ariana Grande. The rapper wrecked his G-Wagon by wrapping it around a utility pole back in May and was arrested for DUI and hit and run. He fled the scene but cops say he later confessed at his home. He blew 2 times the legal limit.

After his arrest Ariana tweeted, “Pls take care of yourself” and was clearly concerned about substance abuse.

A profile of Mac was just published Thursday by Vulture — among other things, Mac said he had enormous pressure growing up in the public eye … “A lot of times in my life I’ve put this pressure to hold myself to the standard of whatever I thought I was supposed to be, or how I was supposed to be perceived. And it creates pressure.”

Thursday night Mac posted video of a record player and you hear his song, “So it Goes,” which includes lyrics, “Nine lives, never, die, f*** a heaven, I’m still gettin’ high.”

Mac was supposed to start a tour next month.

Story developing …