The EU's attitude is the first sign of the obvious - that if you're a member of the club, you can influence it. When Spain joined, the UK, as a member, saw to it that the issue of Gibraltar was not raised, and now it is the opposite way around. It is very like Northern Ireland, Hong Kong or the Falklands. You have two problems - the legal rights and then the attitude of the existing population (and how much it would cost to compensate). That is why the current deal on the Six Counties is the only workable one just now, whereas we could hugely have compensated the inhabitants of the Falklands at far less cost that the war with Argentina, and avoided Thatcher and all the dire consequences thereof.