Bug 252689

Summary: editors/libreoffice: requires ELF feature tag to indicate W+X mappings required
Product: Ports & Packages Reporter: Ed Maste <emaste>
Component: Individual Port(s)Assignee: FreeBSD Office Team <office>
Status: New ---    
Severity: Affects Only Me CC: Trond.Endrestol, jrm, justine.akehurst, pmc
Priority: --- Flags: bugzilla: maintainer-feedback? (office)
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 252629    
Attachments:
Description Flags
elfctl +wxneeded for the binary none

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
Comment 4 Justine Akehurst 2024-09-18 19:01:21 UTC
(In reply to Ed Maste from comment #3)

PR256477 could possibly serve as the tracking PR for openjdk11