Google et. al. are hiring generalists because they want people of a mindset such that when the entire special-purpose they hired them for dissolves, they're willing and eager to ramp up on a new project and new challenges instead of saying "Well, the foo project is closing down and foo's pretty much what I wanted to do, so I guess I'm going to quit (and take all the knowledge and skills Google spent time and money to train me up on with me)."
I get that there are people who don't care (much) what kind of code they are working on. If those are the people Google exclusively wants, that's fine. I just won't have a place there. I do not think this is a generally-advisable strategy, though, as the GGP I was responding to indicated. In fact, I'd argue that well-crafted teams of specialists are superior to, but harder to staff than, teams of generalists.
The big tech companies do also build well-crafted teams of specialists where appropriate (for instance, Google's Deep Mind team is all AI specialists). I don't know what sort of hiring process they use for those roles, but I would wager the process is a little more personalized, and also substantially more selective.
I don't know about letting people "define their own role", but a lot of the biggest companies are constantly hiring without a specific role in mind. If you've got thousands of employees then your best strategy is just hire the smartest people you can find, and figure out how to use them effectively - you have enough roles available that you'll find something for anyone to do, and while not every role you need filled is someone's dream job, a combination of internal mobility between teams and great benefits and pay will attract a lot of good candidates.