Diffused from Mashreqi military colloquials, presumably a borrowing from Ottoman Turkish لغم (lağım). We cannot wholly rule out, perhaps via back-formation from a plural, kinship with لَاقُومَة (lāqūme, “putty”), as both matters are fitted to the joints of a building, in which case the Ottoman Turkish term can also be borrowed from Arabic.