Bug 275104 - devel/libnotify : commit 623262a1 result on notify-send missing "environ" symbol
Summary: devel/libnotify : commit 623262a1 result on notify-send missing "environ" symbol
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-desktop (Team)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-15 14:35 UTC by Thibault Payet
Modified: 2023-11-26 21:08 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thibault Payet 2023-11-15 14:35:14 UTC
With the version of commit 623262a13efb4c659fda87783fb5e6164c24a774,
__progname and environ symbols where removed from libnotify.map .

Without these symbols, launching notify-send will result in:
ld-elf.so.1: /usr/local/lib/libglib-2.0.so.0: Undefined symbol "environ"

Reverting this commit fixes the issue (I am on 14.0-RELEASE).
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-11-26 11:58:27 UTC
It's a little weird, since neither /usr/local/bin/notify-send nor /usr/local/lib/libnotify.so.4.0.0 refers to 'environ' in any way. It is libglib-2.0.so that does so. But why do other libglib-2.0 dependent ports not show this problem?
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-11-26 18:25:53 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=50e1b669d76a12aab4bc9646261cd426847dc825

commit 50e1b669d76a12aab4bc9646261cd426847dc825
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-11-26 18:09:08 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-11-26 18:21:23 +0000

    devel/libnotify: fix build with lld 17 (take 2)

    The fix for bug 274108 broke running the notify-send command, resulting
    in:

      ld-elf.so.1: /usr/local/lib/libglib-2.0.so.0: Undefined symbol "environ"

    This is because libnotify uses the same linker version script for both
    its libnotify.so shared library and for its notify-send executable.

    The linker version script places all symbols that do not begin with
    "notify_" into the local scope, making them effectively hidden. This is
    fine for a shared library, but not for an executable, since it will also
    hide the symbols "environ" and "__progname", which are required for most
    programs.

    Fix it by not using the linker version script for the notify-send
    executable, so no required symbols are hidden.

    PR:             275104, 274108
    MFH:            2023Q4

 .../libnotify/files/patch-libnotify_meson.build (new)  | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
Comment 3 Dimitry Andric freebsd_committer freebsd_triage 2023-11-26 18:29:01 UTC
Sorry about the breakage, this should now be solved.
Comment 4 commit-hook freebsd_committer freebsd_triage 2023-11-26 21:08:17 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8498d8899949e5aba0fe6056411514478fae5cc5

commit 8498d8899949e5aba0fe6056411514478fae5cc5
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-11-26 21:05:36 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-11-26 21:06:42 +0000

    devel/libnotify: bump portrevision after 50e1b669d76a

    This is because the change influences runtime behavior: the port built
    successfully before, but only the notify-send command did not behave
    correctly.

    Noted by:       kib
    PR:             275104, 274108
    MFH:            2023Q4

 devel/libnotify/Makefile | 1 +
 1 file changed, 1 insertion(+)