Bug 252689 - editors/libreoffice: requires ELF feature tag to indicate W+X mappings required
Summary: editors/libreoffice: requires ELF feature tag to indicate W+X mappings required
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: FreeBSD Office Team
URL:
Keywords:
Depends on:
Blocks: 252629
  Show dependency treegraph
 
Reported: 2021-01-14 21:53 UTC by Ed Maste
Modified: 2023-03-10 18:47 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (office)


Attachments
elfctl +wxneeded for the binary (536 bytes, patch)
2023-03-10 11:14 UTC, Peter Much
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 2021-01-14 21:53:47 UTC
Attempting to run libreoffice with W^X enabled results in this failure to start:

# sysctl kern.elf64.allow_wx=0
% libreoffice
LibreOffice 7.0 - Fatal Error: The application cannot be started. 
Extension Manager: exception in synchronize

elfctl(1) can be used to tag binaries that require W+X mappings; discussion about a canonical method of applying these tags is being discussed in PR252629
Comment 1 Trond Endrestøl 2021-04-22 11:26:58 UTC
(In reply to Ed Maste from comment #0)
Sometimes the error message is even more ambiguous:

Application Error

Observed on recent 13.0-STABLE and 14.0-CURRENT.
Comment 2 Peter Much 2023-03-10 11:14:10 UTC
Created attachment 240717 [details]
elfctl +wxneeded for the binary

The libreoffice binary can be treated with Uses/elfctl during the build, this works and prevents the problem (patch attached).

But that is not the only problem: by default libreoffice requires JAVA (here: java/openjdk11), and that port has the same problem, it also requires allow_wx.

What is worse, the java/openjdk11 cannot be treated with Uses/elfctl, because it computes the build directory dynamically.
Comment 3 Ed Maste freebsd_committer freebsd_triage 2023-03-10 18:47:09 UTC
(In reply to Peter Much from comment #2)
> What is worse, the java/openjdk11 cannot be treated with Uses/elfctl, because
> it computes the build directory dynamically.

We'll want to have a separate PR to track this for openjdk11