Bug 257789 - libcompat.so is missing
Summary: libcompat.so is missing
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 13.0-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: Mariusz Zaborski
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-12 16:22 UTC by Yuri Victorovich
Modified: 2024-06-28 10:25 UTC (History)
3 users (show)

See Also:
linimon: mfc-stable14?
linimon: mfc-stable13?


Attachments
patch (289 bytes, patch)
2022-11-18 03:54 UTC, Yuri Victorovich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2021-08-12 16:22:52 UTC
Only libcompat.a is installed.

As a result it can't be used in shared libraries:
> /usr/local/bin/ld: /usr/lib/libcompat.a(ftime.o): relocation R_X86_64_PC32 against symbol `__stack_chk_guard@@FBSD_1.0' can not be used when making a shared object; recompile with -fPIC

There is no easy solution when the ftime(3) is used from a shared library.

Problem found in science/siconos which has a missing symbol ftime(3) in libsicanos_external.so and adding -lcompat causes the above error.
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2022-11-18 03:54:02 UTC
Created attachment 238156 [details]
patch
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2022-11-18 03:54:59 UTC
Konstantin,


Maybe you can commit or approve this patch?


Thanks,
Yuri
Comment 3 Konstantin Belousov freebsd_committer freebsd_triage 2022-11-18 11:24:43 UTC
I do not think we want to ship the libcompat.so (it should be versioned,
but still we do not want to ship it).

Might be ftime(3) should be moved to libc. E.g. it is provided by glibc.
There I do not have strong objections.

Meantime you can replace use of ftime(3) by gettimeofdate(2).
Comment 4 Mariusz Zaborski freebsd_committer freebsd_triage 2023-05-07 11:48:47 UTC
I have created a PR to move ftime to libc:
https://reviews.freebsd.org/D39994
Comment 5 commit-hook freebsd_committer freebsd_triage 2024-05-29 12:35:08 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=bb421be6c1174fad837973acc5e4a7bade4489db

commit bb421be6c1174fad837973acc5e4a7bade4489db
Author:     Mariusz Zaborski <oshogbo@FreeBSD.org>
AuthorDate: 2024-05-29 12:32:16 +0000
Commit:     Mariusz Zaborski <oshogbo@FreeBSD.org>
CommitDate: 2024-05-29 12:36:09 +0000

    libutil: move ftime to libutil

    It seems that there are still some applications that use ftime(3)
    (for example, science/siconos and sysutils/lcdproc). The issue
    is that we don't build libcompat as a shared library anymore.
    The easiest solution is to move it to libutil, until we
    deprecate it for good.

    This solution was proposed by kib@ in
    https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257789.

    PR:             257789
    MFC after:      1 month
    Reviewed by:    kib (ages ago)
    Differential Revision:  https://reviews.freebsd.org/D39994

 lib/libcompat/Makefile                 | 7 +------
 lib/libutil/Makefile                   | 6 +++---
 lib/{libcompat/4.1 => libutil}/ftime.3 | 4 ++--
 lib/{libcompat/4.1 => libutil}/ftime.c | 2 ++
 sys/sys/timeb.h                        | 2 +-
 5 files changed, 9 insertions(+), 12 deletions(-)
Comment 6 Warner Losh freebsd_committer freebsd_triage 2024-06-14 15:03:09 UTC
Moved to In Progress since a fix has been committed to -current. Since it hits ports, likely best to MFC it, but if not oshogbo@FreeBSD.org can close it (assigned to him to make the call).
Comment 7 commit-hook freebsd_committer freebsd_triage 2024-06-28 10:17:36 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=c5e0b035d9eb14e73fc17899cd007a31e0d1edc8

commit c5e0b035d9eb14e73fc17899cd007a31e0d1edc8
Author:     Mariusz Zaborski <oshogbo@FreeBSD.org>
AuthorDate: 2024-05-29 12:32:16 +0000
Commit:     Mariusz Zaborski <oshogbo@FreeBSD.org>
CommitDate: 2024-06-28 10:17:52 +0000

    libutil: move ftime to libutil

    It seems that there are still some applications that use ftime(3)
    (for example, science/siconos and sysutils/lcdproc). The issue
    is that we don't build libcompat as a shared library anymore.
    The easiest solution is to move it to libutil, until we
    deprecate it for good.

    This solution was proposed by kib@ in
    https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257789.

    PR:             257789
    MFC after:      1 month
    Reviewed by:    kib (ages ago)
    Differential Revision:  https://reviews.freebsd.org/D39994

    (cherry picked from commit bb421be6c1174fad837973acc5e4a7bade4489db)

 lib/libcompat/Makefile                 | 7 +------
 lib/libutil/Makefile                   | 6 +++---
 lib/{libcompat/4.1 => libutil}/ftime.3 | 4 ++--
 lib/{libcompat/4.1 => libutil}/ftime.c | 2 ++
 sys/sys/timeb.h                        | 2 +-
 5 files changed, 9 insertions(+), 12 deletions(-)