Heat olive oil in a 6-qt. saucepan over medium-high. Cook onion, stirring occasionally, until golden, about 15 minutes. Stir in turmeric, five-spice powder, garlic, and ginger and cook until fragrant, about 1 minute. Add squash, stock, apples, salt, and pepper and bring to a boil. Cover and cook, stirring occasionally, until squash and apple are tender, about 15 minutes.