Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 908801 - sys-apps/sandbox - musl LFS64 deprecation
Summary: sys-apps/sandbox - musl LFS64 deprecation
Status: IN_PROGRESS
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Sandbox (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Sandbox Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: musl-1.2.4 929967
  Show dependency tree
 
Reported: 2023-06-18 20:07 UTC by Mike Gilbert
Modified: 2025-02-23 03:44 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Gilbert gentoo-dev 2023-06-18 20:07:37 UTC
According to the musl-1.2.4 release notes, support for the LFS64 structures and functions is deprecated and will be removed in a future release.

https://musl.libc.org/releases.html

sandbox uses these all over the place.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-06-18 20:56:16 UTC
As discussed on IRC, we'll almost-certainly need to typedef. We've had to tread a very delicate line with handling it on glibc (see e.g. https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=f4872fb69fe16fc416e4211d12811da61e8738b2).
Comment 2 Andreas K. Hüttel archtester gentoo-dev 2024-03-05 00:40:28 UTC
Dunno what the problem is. It builds perfectly.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-03-05 00:46:47 UTC
(In reply to Andreas K. Hüttel from comment #2)
> Dunno what the problem is. It builds perfectly.

No, it builds fine because configure.ac passes -D_LARGEFILE64_SOURCE right now. That will stop working in future.
Comment 4 Andreas K. Hüttel archtester gentoo-dev 2024-03-05 00:52:49 UTC
OK. At least not a stable blocker for 1.2.4 ...
Comment 5 Jory A. Pratt gentoo-dev 2024-04-21 13:07:13 UTC
(In reply to Andreas K. Hüttel from comment #4)
> OK. At least not a stable blocker for 1.2.4 ...

The only issue I have seen is sandbox needs to be rebuild after musl update. Mozilla packages will fail with unresolved symbols open64 if not rebuild. There are most likely other packages that will fail in the same way, I have not done a full system rebuild to test the 1k packages or so this system has installed yet.
Comment 6 Larry the Git Cow gentoo-dev 2025-01-14 04:38:15 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=d02e2c066681c44180926c33e1cf8efaf1bf83d9

commit d02e2c066681c44180926c33e1cf8efaf1bf83d9
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2025-01-04 02:30:39 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2025-01-06 04:16:33 +0000

    Rework LFS handing
    
    Define _FILE_OFFSET_BITS=64 and _TIME_BITS=64 for code that does not
    directly affect the wrapper functions.
    
    Replace _LARGEFILE64_SOURCE functions with the standard variants.
    
    Undefine _FILE_OFFSET_BITS and _TIME_BITS in wrappers.c to expose the
    legacy declarations.
    
    Also build the tests without _FILE_OFFSET_BITS set so we can actually
    test the legacy functions.
    
    The rc_get_size function now returns int64_t instead of off64_t. There
    should be no effective change in behavior.
    
    A new helper sb_fstat is added to avoid calling fstat64 from the wrapper
    code.
    
    Bug: https://bugs.gentoo.org/908801
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 Makefile.am                               |  2 ++
 configure.ac                              |  7 ----
 libsandbox/canonicalize.c                 |  6 ++--
 libsandbox/libsandbox.c                   |  8 ++---
 libsandbox/local.mk                       |  5 +--
 libsandbox/pre_check_mkdirat.c            |  6 ++--
 libsandbox/wrapper-funcs/__wrapper_exec.c | 15 ++++----
 libsandbox/wrappers.c                     |  4 +++
 libsbutil/include/rcscripts/util/file.h   |  2 +-
 libsbutil/local.mk                        |  3 +-
 libsbutil/sb_close.c                      |  4 +--
 libsbutil/{sb_exists.c => sb_stat.c}      | 14 ++++++--
 libsbutil/sbutil.h                        |  1 +
 libsbutil/src/file.c                      | 57 +++++++++++++------------------
 src/local.mk                              |  1 +
 src/namespaces.c                          |  4 +--
 tests/creat64-0.c                         |  1 +
 tests/fopen64-0.c                         |  1 +
 tests/get-group.c                         |  4 +--
 tests/get-user.c                          |  4 +--
 tests/local.mk                            |  4 +++
 tests/mkostemp64-0.c                      |  1 +
 tests/mkostemps64-0.c                     |  1 +
 tests/mkstemp64-0.c                       |  1 +
 tests/mkstemps64-0.c                      |  1 +
 tests/open64-0.c                          |  1 +
 tests/openat64-0.c                        |  1 +
 tests/test-skel-0.c                       |  2 +-
 tests/trace-memory_static_tst.c           |  4 +--
 tests/truncate64-0.c                      |  1 +
 30 files changed, 92 insertions(+), 74 deletions(-)
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-02-23 03:16:33 UTC
Fixed in 2.43, I think?
Comment 8 Mike Gilbert gentoo-dev 2025-02-23 03:44:24 UTC
(In reply to Sam James from comment #7)
> Fixed in 2.43, I think?

Should be I think.