#!/usr/bin/python # # Find exported symbols that can be made non-exported. # # Noting that (a) parsing these commands is a pain, the output is quite irregular and (b) I'm fumbling in the # dark here, trying to guess what exactly constitutes an "import" vs an "export" of a symbol, linux linking # is rather complex. # # Takes about 5min to run on a decent machine. # # The standalone function analysis is reasonable reliable, but the class/method analysis is less so # (something to do with destructor thunks not showing up in my results?) # # Also, the class/method analysis will not catch problems like # 'dynamic_cast from 'Foo' with hidden type visibility to 'Bar' with default type visibility' # but loplugin:dyncastvisibility will do that for you # import subprocess import sys import re exported_symbols = set() imported_symbols = set() subprocess_find = subprocess.Popen("find ./instdir -name *.so && find ./workdir/LinkTarget/CppunitTest -name *.so", stdout=subprocess.PIPE, shell=True) with subprocess_find.stdout as txt: for line in txt: sharedlib = line.strip() # look for exported symbols subprocess_nm = subprocess.Popen("nm -D " + sharedlib, stdout=subprocess.PIPE, shell=True) with subprocess_nm.stdout as txt2: # We are looking for lines something like: # 0000000000036ed0 T flash_component_getFactory line_regex = re.compile(r'^[0-9a-fA-F]+ T ') for line2 in txt2: line2 = line2.strip() if line_regex.match(line2): exported_symbols.add(line2.split(" ")[2]) # look for imported symbols subprocess_objdump = subprocess.Popen("objdump -T " + sharedlib, stdout=subprocess.PIPE, shell=True) with subprocess_objdump.stdout as txt2: # ignore some header bumpf txt2.readline() txt2.readline() txt2.readline() txt2.readline() # We are looking for lines something like: # 0000000000000000 DF *UND* 0000000000000000 _ZN16FilterConfigItem10WriteInt32ERKN3rtl8OUStringEi for line2 in txt2: line2 = line2.strip() tokens = line2.split(" ") if len(tokens) < 7 or not(tokens[7].startswith("*UND*")): continue sym = tokens[len(tokens)-1] imported_symbols.add(sym) subprocess_find.terminate() # look for imported symbols in executables subprocess_find = subprocess.Popen("find ./instdir -name *.bin", stdout=subprocess.PIPE, shell=True) with subprocess_find.stdout as txt: for line in txt: executable = line.strip() # look for exported symbols subprocess_nm = subprocess.Popen("nm -D " + executable + " | grep -w U", stdout=subprocess.PIPE, shell=True) with subprocess_nm.stdout as txt2: # We are looking for lines something like: # U sal_detail_deinitialize for line2 in txt2: line2 = line2.strip() sym = line2.split(" ")[1] imported_symbols.add(sym) subprocess_find.terminate() diff = exported_symbols - imported_symbols print("exported = " + str(len(exported_symbols))) print("imported = " + str(len(imported_symbols))) print("diff = " + str(len(diff))) # standalone functions that are exported but not imported unused_function_exports = set() classes_with_exported_symbols = set() classes_with_imported_symbols = set() for sym in exported_symbols: filtered_sym = subprocess.check_output(["c++filt", sym]).strip() if filtered_sym.startswith("non-virtual thunk to "): filtered_sym = filtered_sym[21:] elif filtered_sym.startswith("virtual thunk to "): filtered_sym = filtered_sym[17:] i = filtered_sym.find("(") i = filtered_sym.rfind("::", 0, i) if i != -1: classname = filtered_sym[:i] # find classes where all of the exported symbols are not imported classes_with_exported_symbols.add(classname) else: func = filtered_sym # find standalone functions which are exported but not imported if not(sym in imported_symbols): unused_function_exports.add(func) for sym in imported_symbols: filtered_sym = subprocess.check_output(["c++filt", sym]).strip() if filtered_sym.startswith("non-virtual thunk to "): filtered_sym = filtered_sym[21:] elif filtered_sym.startswith("virtual thunk to "): filtered_sym = filtered_sym[17:] i = filtered_sym.find("(") i = filtered_sym.rfind("::", 0, i) if i != -1: classname = filtered_sym[:i] classes_with_imported_symbols.add(classname) with open("bin/find-can-be-private-symbols.functions.results", "wt") as f: for sym in sorted(unused_function_exports): # Filter out most of the noise. # No idea where these are coming from, but not our code. if sym.startswith("CERT_"): continue elif sym.startswith("DER_"): continue elif sym.startswith("FORM_"): continue elif sym.startswith("FPDF"): continue elif sym.startswith("HASH_"): continue elif sym.startswith("Hunspell_"): continue elif sym.startswith("LL_"): continue elif sym.startswith("LP_"): continue elif sym.startswith("LU"): continue elif sym.startswith("MIP"): continue elif sym.startswith("MPS"): continue elif sym.startswith("NSS"): continue elif sym.startswith("NSC_"): continue elif sym.startswith("PK11"): continue elif sym.startswith("PL_"): continue elif sym.startswith("PQ"): continue elif sym.startswith("PBE_"): continue elif sym.startswith("PORT_"): continue elif sym.startswith("PRP_"): continue elif sym.startswith("PR_"): continue elif sym.startswith("PT_"): continue elif sym.startswith("QS_"): continue elif sym.startswith("REPORT_"): continue elif sym.startswith("RSA_"): continue elif sym.startswith("SEC"): continue elif sym.startswith("SGN"): continue elif sym.startswith("SOS"): continue elif sym.startswith("SSL_"): continue elif sym.startswith("VFY_"): continue elif sym.startswith("_PR_"): continue elif sym.startswith("_"): continue elif sym.startswith("ber_"): continue elif sym.startswith("bfp_"): continue elif sym.startswith("ldap_"): continue elif sym.startswith("ne_"): continue elif sym.startswith("opj_"): continue elif sym.startswith("pg_"): continue elif sym.startswith("pq"): continue elif sym.startswith("presolve_"): continue elif sym.startswith("sqlite3_"): continue # dynamically loaded elif sym.endswith("get_implementation"): continue elif sym.endswith("component_getFactory"): continue elif sym == "CreateDialogFactory": continue elif sym == "CreateUnoWrapper": continue elif sym == "CreateWindow": continue elif sym == "ExportDOC": continue elif sym == "ExportPPT": continue elif sym == "ExportRTF": continue elif sym == "GetSaveWarningOfMSVBAStorage_ww8": continue elif sym == "GetSpecialCharsForEdit": continue elif sym.startswith("Import"): continue elif sym.startswith("Java_com_sun_star_"): continue elif sym.startswith("TestImport"): continue elif sym.startswith("getAllCalendars_"): continue elif sym.startswith("getAllCurrencies_"): continue elif sym.startswith("getAllFormats"): continue elif sym.startswith("getBreakIteratorRules_"): continue elif sym.startswith("getCollationOptions_"): continue elif sym.startswith("getCollatorImplementation_"): continue elif sym.startswith("getContinuousNumberingLevels_"): continue elif sym.startswith("getDateAcceptancePatterns_"): continue elif sym.startswith("getForbiddenCharacters_"): continue elif sym.startswith("getIndexAlgorithm_"): continue elif sym.startswith("getLCInfo_"): continue elif sym.startswith("getLocaleItem_"): continue elif sym.startswith("getOutlineNumberingLevels_"): continue elif sym.startswith("getReservedWords_"): continue elif sym.startswith("getSTC_"): continue elif sym.startswith("getSearchOptions_"): continue elif sym.startswith("getTransliterations_"): continue elif sym.startswith("getUnicodeScripts_"): continue elif sym.startswith("lok_"): continue # UDK API elif sym.startswith("osl_"): continue elif sym.startswith("rtl_"): continue elif sym.startswith("typelib_"): continue elif sym.startswith("typereg_"): continue elif sym.startswith("uno_"): continue f.write(sym + "\n") with open("bin/find-can-be-private-symbols.classes.results", "wt") as f: for sym in sorted(classes_with_exported_symbols - classes_with_imported_symbols): # externals if sym.startswith("libcdr"): continue elif sym.startswith("libabw"): continue elif sym.startswith("libebook"): continue elif sym.startswith("libepubgen"): continue elif sym.startswith("libfreehand"): continue elif sym.startswith("libmspub"): continue elif sym.startswith("libpagemaker"): continue elif sym.startswith("libqxp"): continue elif sym.startswith("libvisio"): continue elif sym.startswith("libzmf"): continue elif sym.startswith("lucene::"): continue f.write(sym + "\n") neFix'>feature/BorderlineFix LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/distro-configs
AgeCommit message (Collapse)Author
2018-07-04enable html-help for Linux, Windows and Mac distro-configsChristian Lohmaier
Change-Id: I731e9bcae221d72286f13d5ab8a117e1f1f92052 (cherry picked from commit c625bc9aa485c747de54b0cb479abbbf79789b36)
2018-06-25Just use --with-extra-buildid=FlatpakStephan Bergmann
...as suggested in comment <https://github.com/flathub/ org.libreoffice.LibreOffice/issues/48#issuecomment-399739393> to "LibreOffice 6.0.5": "Should 'Flatpak version' be just 'Flatpak' to save translation of 'version' in the string for non-English locales?" Change-Id: I53171a5725f54520ae9e3cbaf294e291d16e1c78 Reviewed-on: https://gerrit.libreoffice.org/56390 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit 3a8ae607cb0e63f252ca5a3b224f479cf304dc3f) Reviewed-on: https://gerrit.libreoffice.org/56403
2018-06-08solenv/flatpak-manifest.in: Properly disable debug informationStephan Bergmann
...see 02248e9e191f798f96218a0c4d281f99e15bea31 "solenv/flatpak-manifest.in: Disable debug information again, for now" commit message Change-Id: I4a9f8c547a50e8a8c83b5f96768949867aa4bb7b Reviewed-on: https://gerrit.libreoffice.org/55453 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit a7db7f3ce699a46ce7e9eafdf4388a3213264464) Reviewed-on: https://gerrit.libreoffice.org/55463
2018-06-07Update Flatpak to OpenJDK10Stephan Bergmann
see <https://github.com/flathub/org.libreoffice.LibreOffice/issues/42> "OpenJDK 10 is now available". Change-Id: Iaae9d22d91d984a5c11eee26bd05ab7d328d7a5b Reviewed-on: https://gerrit.libreoffice.org/55422 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit 930cb22f75c672c2fa3a4153094df4dd3a71cb7f) Reviewed-on: https://gerrit.libreoffice.org/55428
2018-05-23remove Linux ("UNX") systray "Quickstarter"Rene Engelhard
Change-Id: Ie0e8b8b7ad59ee640d6b195dfae1a7cf745056fd Reviewed-on: https://gerrit.libreoffice.org/54543 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-05-19explicitly enable avahiChristian Lohmaier
Change-Id: I8d3c639bfeb6797a5d61ea21e55ac23da1504120
2018-05-15Adapt solenv/flatpak-manifest.in to recent download.lst changesStephan Bergmann
Change-Id: Ic8f4afe8f46b5f0c36eeffdbb04b3cc652884ab4
2018-05-04Add a distro-config file for LibreOffice Vanilla on the Mac App StoreTor Lillqvist
In addition to the options in this file, the following are present in our autogen.input for the 6.0 branch: --disable-ccache --enable-macosx-code-signing=<redacted> --enable-macosx-package-signing=<redacted> --with-external-tar=/Users/tml/lo/src --with-lang=bg br ca ca-valencia cy cs da de el en-US en-GB es et eu fi fr ga gd gl hr hu id is it ja km lt lv nb nl nn pl pt\ pt-BR ro ru sk sl sv ta tr uk zh-CN zh-TW --with-macosx-bundle-identifier=com.collabora.libreoffice-free --with-product-name=LibreOffice Vanilla --with-package-version=<depends on version> --with-referenced-git=/Users/tml/lo/core --without-parallelism The language list is a guesstimate of what localisations are good enough. Suggestions of languages that should be dropped (or added) welcome. (We don't want a language with immediately visible holes (in top level menus or common dialogs) in the translation coverage. That is an insult to a user who would want to use that language and worse than not providing a localisation in that language at all. In my opinion.) Change-Id: I0dd1c2848cd964f6bf9e17d95d1735b81b235b1c
2018-04-12Build Jenkins ASan/UBSan bot with --enable-firebird-sdbcStephan Bergmann
...now that 14955ed91b282ccbb395cb47c6d76e3b42b34748 "external/firebird: Support Clang ASan" allows to Change-Id: I339ec464a085853e1b6789a544b8f64932f1322d
2018-04-12Revert "Remove dead HSQLDB driver"Sophia Schröder
We cannot silently convert user data or their used file formats and then await them to accept it or reinstall an older version. Let us make a soft change instead of an hard (heart) break and avoid us to been attacked with fire and forks from our users. This reverts commit 8d381ae8d6c742a7e15bf7ad9e07b65f81728ef6. Change-Id: Ia153640935e355771acb85cf652f8fe4c21fafbb Reviewed-on: https://gerrit.libreoffice.org/52731 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-04-10Remove dead HSQLDB driverTamas Bunth
Change-Id: Id4cfb69079f0150c9cca2626c16df7fab441d916 Reviewed-on: https://gerrit.libreoffice.org/52611 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2018-04-09Merge in Flatpak improvementsStephan Bergmann
...from <https://github.com/flathub/org.libreoffice.LibreOffice/>: commit 7a2393f5fcab8c6938180c4718f2c61acd495528 Author: Robert McQueen <rob@endlessm.com> Date: Tue Apr 3 10:41:22 2018 +0100 port to freedesktop.org 1.6 runtime Gtk+3/GIO/etc dependencies used by LO in "GNOME" mode are actually included in the freedesktop.org runtime. Try to build against fd.o by downgrading gst-libav (fd.o has gst 1.10 rather than gnome's 1.12), bundling dbus-glib and disable Gtk+ 2. commit 42650da01f270e86bfb40035a9194b23ccf24c4c Author: Robert McQueen <rob@endlessm.com> Date: Tue Apr 3 11:23:27 2018 +0100 fix up LD_LIBRARY_PATH with gcc7 Append to library path rather than resetting it (causes build failures due to overriding /app/lib). commit 3e4c655294c8124cb54e1c651ec4dc1230b8151e Author: Robert McQueen <rob@endlessm.com> Date: Tue Apr 3 11:25:02 2018 +0100 fixup solenv/bin/assemble_flatpak.sh Use mkdir -p to be robust to other modules (ie dbus-glib) creating some of the paths before we do. commit d1d449ffa837b1de876f524494dbce09ec92ce73 Author: Robert McQueen <rob@endlessm.com> Date: Wed Apr 4 15:50:49 2018 +0100 split resource/registry data into Locales extension Move the language-specific data into the /app/share/runtime path which flatpak-builder splits into the Locale extension if we re-enable separate-locales. We symlink the original locations back to these paths, which means we have dangling symlinks depending on which Locale sutpaths are installed. Include Stephan Bergmann's patch from https://gerrit.libreoffice.org/#/c/52381/ to make the configmgr robust to such dangling links. commit ad6674f166c68fb79e19d80950a104a0a33f81dc Author: Robert McQueen <rob@endlessm.com> Date: Wed Apr 4 16:05:28 2018 +0100 make locale split glob more specific This loop will fail if the share/registry/res folder gains any .xcd files which are not named fcfg_langpack_* or registry_* so just to be safe, only glob these files. Change-Id: Icd41d7077b9f308dbb196927715b210328709662 Reviewed-on: https://gerrit.libreoffice.org/52642 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-03-15--without-lxml for Flatpak buildsStephan Bergmann
where the Yocto-based GNOME SDK provides no python lxml, but building LO's internal one fails because it internally uses {xml2,xslt}-config, and those are broken by (mis?-)design in Yocto, just returning with exit code 1. It didn't work well to pass applications of pkg-config into the external/lxml build as replacements for --with-{xml2,xslt}-config (as is successfully done elsewhere with 1462b2784fa3e95499808b2ef706e4787a01aaae "Adapt the external/redland/raptor/xml2-config.patch to raptor2-2.0.15"), so just run gla11y in its slightly limited form without lxml in the Flatpak build. Change-Id: I2d42901373c8c861b16da385c37bcc24d6e783fd Reviewed-on: https://gerrit.libreoffice.org/51321 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-03-05Make LibreOffice buildable on Haiku.Kacper Kasper
* Obviously VCL wiring is missing, but most components do build. Change-Id: Ie853ada1423a8f4c2b647be59cd47a7730c42978 Reviewed-on: https://gerrit.libreoffice.org/50293 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2018-02-19Buildsystem changes to recognize Haiku.Kacper Kasper
Change-Id: I219d556f8e124cfe426cc1ac3c54da34eb7ef790 Reviewed-on: https://gerrit.libreoffice.org/49925 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins <ci@libreoffice.org>
2018-01-18enable c++17 for android again after boost auto_ptr has a workaroundChristian Lohmaier
see 90d2155912bcee40377620d4836726041a72d537 for boost fix and see effe6b3d84302afce3d5095e4f376e7e3bf669e0 for bridges fix for mac Change-Id: Ic6209ce0927dafd39763ef0b2fabbcaa7abf743f Reviewed-on: https://gerrit.libreoffice.org/46002 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Jenkins <ci@libreoffice.org>
2018-01-18android: use unified headers and llvm-c++ STL (x86) with NDK 16Christian Lohmaier
gnustl (and others) are to be removed in future versions of the ndk also bump gradle and build-tools to current versions along with it arm unfortunately crashes with llvm-c++, so keep with gnustl for now/fix that later Change-Id: Ic794c3293b599b77ec48096bf3283a99c09cbb79 Reviewed-on: https://gerrit.libreoffice.org/45163 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2018-01-08Let flatpak-builder build .Debug extensionStephan Bergmann
Includes a revert of 58891d589bd8da700f135b098dd50833277c65dc "Add distro-pack- install-strip target to be used by dev-tools' flatpak/build.sh". Change-Id: Ie2ba18bc13471b46e8d5f41868bae5aee17ff25f Reviewed-on: https://gerrit.libreoffice.org/47599 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-04iOS disable gpgmejan Iversen
Disable gpgme called for passing parameters to configure, when called internally (to generate config_build etc). Update the distro-conf, with info on the different supported models Change-Id: I884c8638bf7b1c9fbc8ea4bdaa4dfca019857f45
2018-01-03Add JVM support to FlatpakStephan Bergmann
...fixing <https://github.com/flathub/org.libreoffice.LibreOffice/issues/5> "Add JRE-based components". It appeared to be easiest to install the Ant build-time dependency to /run/build/libreoffice/ant, instead of making it into a flatpak-builder module of its own. (The sha512 is as given at <http://ant.apache.org/bindownload.cgi>.) To avoid further dependencies, configure --without-export-validation and --without-junit, only affecting build-time checks (and the amount of checks thus affected by a plain `make` should be small). Change-Id: I5b67c37f168533f9dc7ade11c7c4e2c42814b942 Reviewed-on: https://gerrit.libreoffice.org/47322 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>