in reply to os upgrade breaks cgi

You likely need to reinstall/rebuild any non-core modules that originally created any compiled objects or required modules that did that. Start with the list of modules that your cgi uses.