  We analyze topological mass terms of BF type arising in supersymmetric
M-theory compactifications to $AdS_5$. These describe spontaneously broken
higher-form gauge symmetries in the bulk. Different choices of boundary
conditions for the BF terms yield dual field theories with distinct global
discrete symmetries. We discuss in detail these symmetries and their 't Hooft
anomalies for 4d $\mathcal N = 1$ SCFTs arising from M5-branes wrapped on a
Riemann surface without punctures, including theories from M5-branes at a
$\mathbb Z_2$ orbifold singularity. The anomaly polynomial is computed via
inflow and contains background fields for discrete global 0-, 1-, and 2-form
symmetries and continuous 0-form symmetries, as well as axionic background
fields. The latter are properly interpreted in the context of anomalies in the
space of coupling constants.
