Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 30 Sep 2022 15:26:18 -0400
From: Rich Felker <dalias@...c.org>
To: enh <enh@...gle.com>
Cc: musl@...ts.openwall.com, Markus Wichmann <nullplan@....net>
Subject: Re: Revisiting LFS64 removal

On Fri, Sep 30, 2022 at 11:13:28AM -0700, enh wrote:
> On Fri, Sep 30, 2022 at 10:36 AM Colin Cross <ccross@...gle.com> wrote:
> 
> > On Fri, Sep 30, 2022 at 5:58 AM Rich Felker <dalias@...c.org> wrote:
> > >
> > > On Fri, Sep 30, 2022 at 04:44:47AM +0200, Markus Wichmann wrote:
> > > > On Thu, Sep 29, 2022 at 07:07:08PM -0400, Rich Felker wrote:
> > > > > As an alternative, maybe we should consider leaving these but only
> > > > > under explict _LARGEFILE64_SOURCE rather than implicitly via
> > > > > _GNU_SOURCE for at least one release cycle. This would allow
> > makeshift
> > > > > fixing of any builds that break by just adding -D_LARGEFILE64_SOURCE
> > > > > until a proper fix can be applied.
> > > > >
> > > > > Any preference here?
> > > > >
> > > > > Rich
> > > >
> > > > Given that nothing lasts as long as a temporary measure, I'd say it is
> > >
> > > That's not a given for musl, quite the opposite. I would expect it to
> > > last at most a release cycle, possibly even to disappear before then
> > > if distros backport the changes to their development branches early
> > > and find and fix everything.
> > >
> > > > better to rip the band-aid off in one go rather than two. Besides, any
> > > > breakage ought to be able to be dealt with by a simple replacement,
> > > > right?
> > >
> > > It's a simple fix, but the question is how many such simple fixes a
> > > distro might need to make in their packages, and that I don't know.
> > >
> > > If they have a trivial mechanical fix of "add something to CFLAGS"
> > > they can do at first, that lets them build a list of affected packages
> > > while quickly getting them all building again, then work out the right
> > > fixes one at a time according to usual triage rather than being
> > > swamped with these taking priority over issues with more depth.
> > >
> > > Rich
> >
> > I experimented with building all the host code in the Android tree
> > with these two patches just to measure the damage.  The first patch is
> > mostly fine, but causes link failures in rust modules.  I think that's
> > due to the upstream rust libc assuming the presence of fstat64, etc.:
> >
> > https://cs.android.com/android/platform/superproject/+/master:external/rust/crates/libc/src/unix/linux_like/mod.rs;l=1665;drc=b38fde0ab980c7d79f0a55aec1b7121022a38257
> >
> > The second patch causes 680 unique errors.  Many of those are in
> > Android-specific code that uses the *64 functions directly, which I
> > think is especially common due to early bionic's poor LFS64 support.
> >
> 
> ....and the fact that we can't flip the switch globally for the OS build
> without risking subtle ABI changes. but maybe these days we could recognize
> such things (via the .lsdump stuff)? maybe it's time to try?
> 
> (we have similar issues with code that's also built for macOS, which never
> had the *64 functions or off64_t, so there might be some low-hanging fruit
> by extending those `#if __APPLE__` hacks -- that are basically just
> `#define off64_t off_t` etc -- to apply to musl too...)

The intended usage as I understand it is that you would probe for
sizeof(off_t)>=8 and only try to use these hacks if that's not
satisfied, not hard-code combinatoric platform knowledge. Something
like:

checking if sizeof(off_t)>=8...
[if no] checking if -D_FILE_OFFSET_BITS=64 makes sizeof(off_t)>=8...
[if no] checking if -D_LARGEFILE64_SOURCE exposes off64_t interfaces...
...

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.