Bug 257789 - libcompat.so is missing
Summary: libcompat.so is missing
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 13.0-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-12 16:22 UTC by Yuri Victorovich
Modified: 2023-05-07 11:48 UTC (History)
2 users (show)

See Also:


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