Also compile C++ code with O3.
(cherry picked from commit strukturag/vlc@01dfa1712adef81548a12dcf083a7bb3a2af65e4)
Added patch to link against libraries required for static linking.
(cherry picked from commit strukturag/vlc@494c763e47123326f2a3bfeac25e4b8daa397ec4)