  Let $G$ be a compact abelian group and $\phi_1, \phi_2, \phi_3$ be continuous
endomorphisms on $G$. Under certain natural assumptions on the $\phi_i$'s, we
prove the existence of Bohr sets in the sumset $\phi_1(A) + \phi_2(A) +
\phi_3(A)$, where $A$ is either a set of positive Haar measure, or comes from a
finite partition of $G$. The first result generalizes theorems of Bogolyubov
and Bergelson-Ruzsa. As a variant of the second result, we show that for any
partition $\mathbb{Z} = \bigcup_{i=1}^r A_i$, there exists an $i$ such that
$A_i - A_i + sA_i$ contains a Bohr set for any $s \in \mathbb{Z} \setminus \{ 0
\}$. The latter is a step toward an open question of Katznelson and Ruzsa.
