public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] login: Add back libutil as an empty library
@ 2021-10-13 12:50 Stafford Horne
  2021-10-13 12:56 ` Florian Weimer
  0 siblings, 1 reply; 5+ messages in thread
From: Stafford Horne @ 2021-10-13 12:50 UTC (permalink / raw)
  To: GLIBC patches; +Cc: Florian Weimer, Stafford Horne

There are several packages like sysvinit and buildroot that expect
-lutil to work.  Rather than impacting them with having to change
the linker flags provide an empty libutil.a.
---
 login/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/login/Makefile b/login/Makefile
index 4e6b97734d..5d3f8650fa 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -46,10 +46,10 @@ vpath %.c programs
 tests := tst-utmp tst-utmpx tst-grantpt tst-ptsname tst-getlogin tst-updwtmpx \
   tst-pututxline-lockfail tst-pututxline-cache
 
-ifeq ($(have-GLIBC_2.33),yes)
 # Empty compatibility library for old binaries.
 extra-libs      := libutil
 extra-libs-others := $(extra-libs)
+ifeq ($(have-GLIBC_2.33),yes)
 libutil-routines := libutil-compat
 libutil-shared-only-routines := libutil-compat
 
-- 
2.31.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] login: Add back libutil as an empty library
  2021-10-13 12:50 [PATCH] login: Add back libutil as an empty library Stafford Horne
@ 2021-10-13 12:56 ` Florian Weimer
  2021-10-13 13:21   ` Stafford Horne
  0 siblings, 1 reply; 5+ messages in thread
From: Florian Weimer @ 2021-10-13 12:56 UTC (permalink / raw)
  To: Stafford Horne via Libc-alpha

* Stafford Horne via Libc-alpha:

> There are several packages like sysvinit and buildroot that expect
> -lutil to work.  Rather than impacting them with having to change
> the linker flags provide an empty libutil.a.

This produces a libutil.so.1 as well, right?

I think we should still prevent that.  It's not clear to me what the
proper approach would be, though.  We have a bunch of existing
examples: libmcheck.a, libg.a.  But those do not use the usual library
mechanism AFAICS.

Maybe this will work?

libutil-inhibit-o = $(filter-out .o,$(object-suffixes))

And do not set libutil-routines and libutil-shared-only-routines for
new architectures.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] login: Add back libutil as an empty library
  2021-10-13 12:56 ` Florian Weimer
@ 2021-10-13 13:21   ` Stafford Horne
  2021-10-13 14:19     ` Florian Weimer
  0 siblings, 1 reply; 5+ messages in thread
From: Stafford Horne @ 2021-10-13 13:21 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Stafford Horne via Libc-alpha

On Wed, Oct 13, 2021 at 02:56:38PM +0200, Florian Weimer wrote:
> * Stafford Horne via Libc-alpha:
> 
> > There are several packages like sysvinit and buildroot that expect
> > -lutil to work.  Rather than impacting them with having to change
> > the linker flags provide an empty libutil.a.
> 
> This produces a libutil.so.1 as well, right?

Ah, thats right, I thought I checked that, but the .so files are still there.

> I think we should still prevent that.  It's not clear to me what the
> proper approach would be, though.  We have a bunch of existing
> examples: libmcheck.a, libg.a.  But those do not use the usual library
> mechanism AFAICS.
> 
> Maybe this will work?
> 
> libutil-inhibit-o = $(filter-out .o,$(object-suffixes))

Yes, it does seem to work, thanks.

> And do not set libutil-routines and libutil-shared-only-routines for
> new architectures.

I think this I am skipping via the existing if statement.

-Stafford

So maybe something like this?

--

--- a/login/Makefile
+++ b/login/Makefile
@@ -46,10 +46,10 @@ vpath %.c programs
 tests := tst-utmp tst-utmpx tst-grantpt tst-ptsname tst-getlogin tst-updwtmpx \
   tst-pututxline-lockfail tst-pututxline-cache
 
-ifeq ($(have-GLIBC_2.33),yes)
 # Empty compatibility library for old binaries.
 extra-libs      := libutil
 extra-libs-others := $(extra-libs)
+ifeq ($(have-GLIBC_2.33),yes)
 libutil-routines := libutil-compat
 libutil-shared-only-routines := libutil-compat
 
@@ -57,6 +57,8 @@ libutil-shared-only-routines := libutil-compat
 # link is not installed.
 install-lib-ldscripts = libutil.so
 $(inst_libdir)/libutil.so:
+else  # not $(have-GLIBC_2.33)
+libutil-inhibit-o = $(filter-out .o,$(object-suffixes))
 endif # $(have-GLIBC_2.33)
 
 include ../Rules


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] login: Add back libutil as an empty library
  2021-10-13 13:21   ` Stafford Horne
@ 2021-10-13 14:19     ` Florian Weimer
  2021-10-13 21:22       ` Stafford Horne
  0 siblings, 1 reply; 5+ messages in thread
From: Florian Weimer @ 2021-10-13 14:19 UTC (permalink / raw)
  To: Stafford Horne; +Cc: Stafford Horne via Libc-alpha

* Stafford Horne:

> I think this I am skipping via the existing if statement.
>
> -Stafford
>
> So maybe something like this?
>
> --
>
> --- a/login/Makefile
> +++ b/login/Makefile
> @@ -46,10 +46,10 @@ vpath %.c programs
>  tests := tst-utmp tst-utmpx tst-grantpt tst-ptsname tst-getlogin tst-updwtmpx \
>    tst-pututxline-lockfail tst-pututxline-cache
>  
> -ifeq ($(have-GLIBC_2.33),yes)
>  # Empty compatibility library for old binaries.
>  extra-libs      := libutil
>  extra-libs-others := $(extra-libs)
> +ifeq ($(have-GLIBC_2.33),yes)
>  libutil-routines := libutil-compat
>  libutil-shared-only-routines := libutil-compat
>  
> @@ -57,6 +57,8 @@ libutil-shared-only-routines := libutil-compat
>  # link is not installed.
>  install-lib-ldscripts = libutil.so
>  $(inst_libdir)/libutil.so:
> +else  # not $(have-GLIBC_2.33)
> +libutil-inhibit-o = $(filter-out .o,$(object-suffixes))
>  endif # $(have-GLIBC_2.33)
>  
>  include ../Rules

Yes, at least it matches my expectations.  I'm not familiar enough
with the build system to confirm it's correct, but hopefully it
unblocks your port.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] login: Add back libutil as an empty library
  2021-10-13 14:19     ` Florian Weimer
@ 2021-10-13 21:22       ` Stafford Horne
  0 siblings, 0 replies; 5+ messages in thread
From: Stafford Horne @ 2021-10-13 21:22 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Stafford Horne via Libc-alpha

On Wed, Oct 13, 2021 at 04:19:48PM +0200, Florian Weimer wrote:
> * Stafford Horne:
> 
> > I think this I am skipping via the existing if statement.
> >
> > -Stafford
> >
> > So maybe something like this?
> >
> > --
> >
> > --- a/login/Makefile
> > +++ b/login/Makefile
> > @@ -46,10 +46,10 @@ vpath %.c programs
> >  tests := tst-utmp tst-utmpx tst-grantpt tst-ptsname tst-getlogin tst-updwtmpx \
> >    tst-pututxline-lockfail tst-pututxline-cache
> >  
> > -ifeq ($(have-GLIBC_2.33),yes)
> >  # Empty compatibility library for old binaries.
> >  extra-libs      := libutil
> >  extra-libs-others := $(extra-libs)
> > +ifeq ($(have-GLIBC_2.33),yes)
> >  libutil-routines := libutil-compat
> >  libutil-shared-only-routines := libutil-compat
> >  
> > @@ -57,6 +57,8 @@ libutil-shared-only-routines := libutil-compat
> >  # link is not installed.
> >  install-lib-ldscripts = libutil.so
> >  $(inst_libdir)/libutil.so:
> > +else  # not $(have-GLIBC_2.33)
> > +libutil-inhibit-o = $(filter-out .o,$(object-suffixes))
> >  endif # $(have-GLIBC_2.33)
> >  
> >  include ../Rules
> 
> Yes, at least it matches my expectations.  I'm not familiar enough
> with the build system to confirm it's correct, but hopefully it
> unblocks your port.

OK, I sent a v2 as per above which I am keeping on my port branch for now.  I'll
wait for feedback for now.

-Stafford

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-13 21:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13 12:50 [PATCH] login: Add back libutil as an empty library Stafford Horne
2021-10-13 12:56 ` Florian Weimer
2021-10-13 13:21   ` Stafford Horne
2021-10-13 14:19     ` Florian Weimer
2021-10-13 21:22       ` Stafford Horne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).