Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add OpenSSL 3.x, V8 12.1+, GCC 15 compatibility and system library support#1641

Open
toabctl wants to merge 20 commits into
ONLYOFFICE:master from
toabctl:openssl3-compat
Open

Add OpenSSL 3.x, V8 12.1+, GCC 15 compatibility and system library support #1641
toabctl wants to merge 20 commits into
ONLYOFFICE:master from
toabctl:openssl3-compat

Conversation

@toabctl

@toabctl toabctl commented Mar 11, 2026
edited
Loading

Copy link
Copy Markdown

Summary

This PR makes it possible to build OnlyOffice core against system-provided libraries and modern toolchains, enabling proper distribution packaging (e.g. openSUSE/Fedora RPMs) instead of relying solely on vendored/bundled dependencies.

OpenSSL 3.x compatibility

  • Migrate RSA key generation from deprecated RSA_new()/RSA_generate_multi_prime_key() to the EVP_PKEY_CTX interface, which works on both OpenSSL 1.1.x and 3.x (migration guide)
  • Remove redundant EVP_CIPHER_CTX_init() calls (EVP_CIPHER_CTX_new() already zero-initializes) and no-op EVP_cleanup() calls (docs)
  • Update hash implementation in doctrenderer to use modern EVP digest API
  • Handle unsupported hash algorithms gracefully in HashEmbed

V8 12.1+ compatibility

  • Add V8Holder compat macro (This() on 12.1+, Holder() on older V8)
  • Guard VisitHandlesWithClassIds() removal and inspector connect() API changes behind V8_VERSION_121_PLUS
  • Use v8::Isolate::GetCurrent() instead of removed Context::GetIsolate()

GCC 14/15 fixes

  • Fix -Wincompatible-pointer-types errors in vendored jasper (int* vs jpc_fix_t*)
  • Replace wide string literals in pole.cpp that GCC 15 libstdc++ rejects (operator<<(ostream, wchar_t*) deleted)

System library support (CONFIG+=use_system_*)

Add use_system_* qmake config flags to link against system-installed packages instead of vendored copies:

  • OpenSSL: use_system_openssl
  • zlib: use_system_zlib (keeps vendored minizip with OnlyOffice-specific patches)
  • Crypto++: use_system_cryptopp — also normalizes include paths to portable <cryptopp/foo.h> form
  • Boost: use_system_boost
  • ICU: use_system_icu
  • HarfBuzz: use_system_harfbuzz
  • libheif: use_system_heif — also switches to portable <libheif/heif.h> include
  • V8: use_system_v8 — targets V8 from system packages (e.g. nodejs-22-libv8)

Other fixes

  • Export zlib_addon symbols with proper C linkage and visibility for shared library builds
  • Remove redundant vendored zlib.h include from ioapibuf.h

CLAassistant commented Mar 11, 2026
edited
Loading

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

toabctl commented Mar 11, 2026

Copy link
Copy Markdown
Author

@papacarlo could you have a look please?

looking at the other PRs in this repo, I wonder if external contributions are actually welcome. Or is this the wrong repo?

toabctl added 15 commits March 11, 2026 14:41
ioapibuf.h already gets all needed zlib types (uLong, voidpf,
zlib_filefunc_def, OF macro) through ioapi.h which includes zlib.h.
The relative ../../zlib.h include was a duplicate and creates an
unnecessary hard dependency on the vendored zlib directory layout.
When use_system_zlib is set, link against system -lz and force-include
zlib_addon.h so the patched vendored minizip sources still see the
addon flags. The vendored minizip is kept as it has OnlyOffice-specific
patches (ioapibuf, disabled CRC check, read-only open mode flag).
Create centralized cryptopp.pri with use_system_cryptopp flag,
replacing ad-hoc CRYPTOPP_DISABLE_ASM defines and -lCryptoPPLib
links scattered across 7 consumer .pro files.
Change all #include paths from relative vendored paths to portable
<cryptopp/foo.h> form, which works for both vendored (via INCLUDEPATH
pointing to Common/3dParty/) and system (/usr/include/cryptopp/)
headers.
CRYPTOPP_DISABLE_ASM is only defined for vendored builds to avoid
ODR violations when linking against a system library built with
ASM enabled.
Wrap vendored include/library paths in !use_system_boost guard.
When using system boost, link without -L paths since system libs
are in the default search path. Compiler flags (enum constexpr
warnings, ARM64 defines) remain unconditional as they apply
regardless of boost source.
When use_system_icu is set, link against system -licuuc -licudata
without vendored include/library paths. All platform-specific
vendored ICU configuration (Windows, Linux, macOS, iOS, Android)
is wrapped in the else branch.
Create harfbuzz.pri with use_system_harfbuzz guard. When set,
link against system -lharfbuzz. Otherwise include the generated
harfbuzz_sources.pri from make.py.
Update make.py to write to harfbuzz_sources.pri instead of
harfbuzz.pri so the git-tracked file is not overwritten.
Update .gitignore to track harfbuzz.pri and ignore the generated
harfbuzz_sources.pri.
When use_system_heif is set, link against system -lheif -lde265
-lx265 without vendored paths or static build defines. All
platform-specific vendored library paths (Windows, Linux/Android,
macOS/iOS) are wrapped in the else branch.
When use_system_v8 is set, link against system libv8_monolith
from /usr/lib with headers from /usr/include/v8 (as provided by
the chromium-v8-dev package).
Defines V8_VERSION_89_PLUS, V8_VERSION_121_PLUS,
V8_COMPRESS_POINTERS, and DISABLE_MEMORY_LIMITATION for
compatibility with modern V8 (12.1+).
Add V8_VERSION_121_PLUS guards for API changes:
- Inspector connect() requires additional trust/debugger params
- VisitHandlesWithClassIds() was removed
Change from vendored relative path to <libheif/heif.h> which
works with both system libheif (/usr/include/libheif/heif.h)
and vendored libheif (via INCLUDEPATH from heif.pri).
GCC 14+ treats -Wincompatible-pointer-types as an error. The
jasper code used int* where jpc_fix_t* (long int* on 64-bit) was
expected. Fix the function declarations, definitions, and struct
typedef to use jpc_fix_t consistently:
- jpc_ft_synthesize() parameter in jpc_qmfb.c
- analyze/synthesize function pointers in jpc_qmfb2d_t struct
- jpc_tsfb_analyze2/synthesize2() parameters in jpc_tsfb.c
These changes are backward compatible with older GCC as they
correct the types to match actual usage on all architectures.
@toabctl toabctl marked this pull request as draft March 12, 2026 10:56
pole.cpp: Replace wide string literals (L"...") with narrow ones
when outputting to std::cout. GCC 15 libstdc++ deletes the
operator<<(ostream, wchar_t*) overload as mixing narrow/wide
streams is undefined behavior.
v8_base: Add V8Holder compat macro that maps to This() on
V8 12.1+ (where Holder() was removed) and Holder() on older V8.
Replace all Holder() calls in v8_base.h and v8_base.cpp.
inspector/utils.cpp: Use v8::Isolate::GetCurrent() instead of
Context::GetIsolate() which was removed in newer V8.
@toabctl toabctl force-pushed the openssl3-compat branch 3 times, most recently from c9c61b6 to 176d612 Compare March 13, 2026 19:45
When use_system_v8 is set, link against system libv8 from /usr/lib
with headers from /usr/include/v8 (as provided by the nodejs-22-libv8
package which extracts V8 from Node.js).
Defines V8_VERSION_89_PLUS, V8_VERSION_121_PLUS, and
DISABLE_MEMORY_LIMITATION for compatibility with modern V8 (12.1+).
Node.js V8 does not enable pointer compression by default, so
V8_COMPRESS_POINTERS is not defined. V8_SUPPORT_SNAPSHOTS is also
not defined as snapshots require sdkjs compiled from source.
The zlip_set_addition_flag and zlip_get_addition_flag functions
are used across shared library boundaries (defined in libkernel.so,
called by consumers). Add extern "C" guards so C++ callers use the
correct C linkage, and add explicit default visibility to ensure
they are exported from the shared library built with
-fvisibility=hidden.
@toabctl toabctl changed the title (削除) common_openssl: add OpenSSL 3.x compatibility (削除ここまで) (追記) Add OpenSSL 3.x, V8 12.1+, GCC 15 compatibility and system library support (追記ここまで) Mar 16, 2026
When use_system_googletest is set, link against system -lgtest
(and optionally -lgtest_main, -lgmock) instead of compiling
vendored sources. All vendored source compilation is wrapped
in the else branch.
Add core_no_gtest_main and core_gmock config flags to control
gtest_main and gmock inclusion, replacing per-project
SOURCES -= hacks that break under use_system_googletest.
Migrate cfcpp/test, OOXML/test, and OdfFile/Test/test_odf to
use the central googletest.pri with the new config flags.

toabctl commented Mar 16, 2026

Copy link
Copy Markdown
Author

I'm happy to split this up into smaller commits and adjust to whatever you prefer.
But I would like to understand if this is a feasible approach that have a chance to get merged upstream .

@toabctl toabctl marked this pull request as ready for review March 16, 2026 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /