Curiously, I looked this up about 2 weeks before this thread came up. According to what I found, whale oil worked very well for the task. However, in comparison to sweet oil, whale oil is rather costly, so it was not in wide general use and not the issue for armies.
According to what I read, although whale oil from whale fat in general was used for Betty lamps and other uses, whale oil of the fine grade used for gun oil, only comes from the bulbous nose of the Sperm Whale.
At least that is what my brief research brought forth.
BTW: Sweet Oil is an old remedy for ear ache, being as it breaks down hardened wax. Some still use it today, and it is generally available at drug stores for that reason.