Patchwork tcp-wrappers: place LIBS after object files

login
register
mail settings
Submitter Enrico Scholz
Date April 26, 2011, 10:41 a.m.
Message ID <1303814494-9623-1-git-send-email-enrico.scholz@sigma-chemnitz.de>
Download mbox | patch
Permalink /patch/2877/
State New, archived
Headers show

Comments

Enrico Scholz - April 26, 2011, 10:41 a.m.
From: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>

This fixes builds with '-Wl,-as-needed'. Patch changes the previous
'ldflags.patch' files instead of adding a new one.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Cc: Jeremy Lainé <jeremy.laine@m4x.org>
---
 .../tcp-wrappers/tcp-wrappers-7.6/ldflags.patch    |   22 +++++++++++++++----
 1 files changed, 17 insertions(+), 5 deletions(-)
Paul Menzel - April 26, 2011, 1:35 p.m.
Dear Enrico,


Am Dienstag, den 26.04.2011, 12:41 +0200 schrieb Enrico Scholz:
> From: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>

it seems you need to update your Git configuration to your common email
address.

> This fixes builds with '-Wl,-as-needed'. Patch changes the previous
> 'ldflags.patch' files instead of adding a new one.

It would be great if you could add a log of the failed build.

> Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
> Cc: Jeremy Lainé <jeremy.laine@m4x.org>
> ---
>  .../tcp-wrappers/tcp-wrappers-7.6/ldflags.patch    |   22 +++++++++++++++----
>  1 files changed, 17 insertions(+), 5 deletions(-)
> 
> diff --git a/recipes/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch b/recipes/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch
> index 2e89765..cac8615 100644
> --- a/recipes/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch
> +++ b/recipes/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch
> @@ -1,13 +1,25 @@
> -Index: tcp_wrappers_7.6.orig/Makefile
> +Index: tcp_wrappers_7.6/Makefile
>  ===================================================================
> ---- tcp_wrappers_7.6.orig.orig/Makefile	2009-04-06 10:55:47.000000000 +0000
> -+++ tcp_wrappers_7.6.orig/Makefile	2009-04-06 10:57:04.000000000 +0000
> -@@ -748,31 +748,31 @@
> +--- tcp_wrappers_7.6.orig/Makefile
> ++++ tcp_wrappers_7.6/Makefile

The diff could have been smaller, but no big problem.

> +@@ -724,9 +724,9 @@ SHLIBSOMAJ	= shared/libwrap.so.$(SOMAJOR
> + SHLIBSO		= shared/libwrap.so
> + SHLIBFLAGS	= -Lshared -lwrap
> + 
> +-SHLINKFLAGS = -shared -Xlinker -soname -Xlinker libwrap.so.$(SOMAJOR) -lc $(LIBS)
> ++SHLINKFLAGS = -shared -Xlinker -soname -Xlinker libwrap.so.$(SOMAJOR)
> + SHCFLAGS = -fPIC -shared -D_REENTRANT
> +-SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ));
> ++SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ))

The »;« was superfluous, since no command followed?

> + all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB)
> + 
> +@@ -748,31 +748,31 @@ $(LIB):	$(LIB_OBJ)
>   
>   $(SHLIB): $(SHLIB_OBJ)
>   	rm -f $(SHLIB)
>  -	$(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
> -+	$(CC) $(LDFLAGS) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
> ++	$(CC) $(LDFLAGS) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ) $(LIBS)
>   	ln -sf $(notdir $(SHLIB)) $(SHLIBSOMAJ)
>   	ln -sf $(notdir $(SHLIBSOMAJ)) $(SHLIBSO)

Is this patch already upstream?


Thanks,

Paul
Enrico Scholz - April 26, 2011, 1:53 p.m.
Paul Menzel <paulepanter@users.sourceforge.net> writes:

>> From: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
>
> it seems you need to update your Git configuration to your common
> email address.

Both addresses are in use; some patches are created at home when I work
on a personal project (-> tu-chemnitz.de address), some patches at work
(-> sigma-chemnitz.de address).


> The diff could have been smaller, but no big problem.

how? three places must be changed (removal of $(LIBS) from old LINKFLAGS,
removal of superflous ';' and adding of $(LIBS) to link command).


>> +-SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ));
>> ++SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ))
>
> The »;« was superfluous, since no command followed?

yes; and it would break the build because it terminates the $(CC) command
and $(LIBS) would be interpreted as the start of a new command.

>> ++	$(CC) $(LDFLAGS) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ) $(LIBS)


> Is this patch already upstream?

woglinde gave his ack on irc and I submitted it.



Enrico
Paul Menzel - April 26, 2011, 2:15 p.m.
Am Dienstag, den 26.04.2011, 15:53 +0200 schrieb Enrico Scholz:
> Paul Menzel <paulepanter@users.sourceforge.net> writes:
> 
> >> From: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
> >
> > it seems you need to update your Git configuration to your common
> > email address.
> 
> Both addresses are in use; some patches are created at home when I work
> on a personal project (-> tu-chemnitz.de address), some patches at work
> (-> sigma-chemnitz.de address).

I guessed as much. But your Signed-off-by line differs from the From
line. Additionally for the commit statistics it would be better to use a
common address so that all your commits are shown under one person.

The second reason is just for convenience reasons.

> > The diff could have been smaller, but no big problem.
> 
> how? three places must be changed (removal of $(LIBS) from old LINKFLAGS,
> removal of superflous ';' and adding of $(LIBS) to link command).

I meant just the header of the diff in the patch.

> >> +-SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ));
> >> ++SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ))
> >
> > The »;« was superfluous, since no command followed?
> 
> yes; and it would break the build because it terminates the $(CC) command
> and $(LIBS) would be interpreted as the start of a new command.

Thank you for the explanation.

> >> ++	$(CC) $(LDFLAGS) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ) $(LIBS)
> 
> > Is this patch already upstream?
> 
> woglinde gave his ack on irc

For documentation purpose it would be great if you could add such
acknowledgments to the commit message.

> and I submitted it.

But I meant upstream of TCP Wrapper.


Thank you for the explanation and your patches,

Paul
Enrico Scholz - April 26, 2011, 3 p.m.
Paul Menzel <paulepanter@users.sourceforge.net> writes:

> For documentation purpose it would be great if you could add such
> acknowledgments to the commit message.

ok; I will add it the next time.


> But I meant upstream of TCP Wrapper.

tcp-wrappers have an upstream? afais, the tarball in the package is from
1997...


Enrico
Paul Menzel - April 26, 2011, 3:10 p.m.
Am Dienstag, den 26.04.2011, 17:00 +0200 schrieb Enrico Scholz:
> Paul Menzel <paulepanter@users.sourceforge.net> writes:

[…]

> > But I meant upstream of TCP Wrapper.
> 
> tcp-wrappers have an upstream? afais, the tarball in the package is from
> 1997...

Well I found just the Web site on the FTP server and saw all the patches
applied in OE. So I thought I just ask. Maybe development goes on
somewhere non public. Anyway, thank you for your answer.


Thanks,

Paul

Patch

diff --git a/recipes/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch b/recipes/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch
index 2e89765..cac8615 100644
--- a/recipes/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch
+++ b/recipes/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch
@@ -1,13 +1,25 @@ 
-Index: tcp_wrappers_7.6.orig/Makefile
+Index: tcp_wrappers_7.6/Makefile
 ===================================================================
---- tcp_wrappers_7.6.orig.orig/Makefile	2009-04-06 10:55:47.000000000 +0000
-+++ tcp_wrappers_7.6.orig/Makefile	2009-04-06 10:57:04.000000000 +0000
-@@ -748,31 +748,31 @@
+--- tcp_wrappers_7.6.orig/Makefile
++++ tcp_wrappers_7.6/Makefile
+@@ -724,9 +724,9 @@ SHLIBSOMAJ	= shared/libwrap.so.$(SOMAJOR
+ SHLIBSO		= shared/libwrap.so
+ SHLIBFLAGS	= -Lshared -lwrap
+ 
+-SHLINKFLAGS = -shared -Xlinker -soname -Xlinker libwrap.so.$(SOMAJOR) -lc $(LIBS)
++SHLINKFLAGS = -shared -Xlinker -soname -Xlinker libwrap.so.$(SOMAJOR)
+ SHCFLAGS = -fPIC -shared -D_REENTRANT
+-SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ));
++SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ))
+ 
+ all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB)
+ 
+@@ -748,31 +748,31 @@ $(LIB):	$(LIB_OBJ)
  
  $(SHLIB): $(SHLIB_OBJ)
  	rm -f $(SHLIB)
 -	$(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
-+	$(CC) $(LDFLAGS) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
++	$(CC) $(LDFLAGS) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ) $(LIBS)
  	ln -sf $(notdir $(SHLIB)) $(SHLIBSOMAJ)
  	ln -sf $(notdir $(SHLIBSOMAJ)) $(SHLIBSO)