* [PATCH] Allow override of CFLAGS @ 2013-08-08 4:59 Simon Horman 2013-08-08 6:13 ` Julian Anastasov 2013-08-08 7:47 ` Daniel Borkmann 0 siblings, 2 replies; 22+ messages in thread From: Simon Horman @ 2013-08-08 4:59 UTC (permalink / raw) To: lvs-devel Cc: Wensong Zhang, Julian Anastasov, Jesper Dangaard Brouer, Simon Horman When building ipvsadm this allows make to add to CFLAGS supplied on the command line. This seems to make sense as Makefile and libipvs/Makefile add different CFLAGS but it may be desirable to supply supplementary flags when building ipvsadm. In particular the following may be useful when building ipvsadm on Debian Jessie. make CFLAGS='-I/usr/include/libnl3' LIBS='-lnl-3 -lnl-genl-3 -lnl-3 -lpopt' Signed-off-by: Simon Horman <horms@verge.net.au> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6e36d79..c8c1eec 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ STATIC_LIBS = libipvs/libipvs.a ifeq "${ARCH}" "sparc64" CFLAGS = -Wall -Wunused -Wstrict-prototypes -g -m64 -pipe -mcpu=ultrasparc -mcmodel=medlow else - CFLAGS = -Wall -Wunused -Wstrict-prototypes -g + CFLAGS = -I/usr/include/libnl3 -Wall -Wunused -Wstrict-prototypes -g endif -- 1.8.3.2 ^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH] Allow override of CFLAGS 2013-08-08 4:59 [PATCH] Allow override of CFLAGS Simon Horman @ 2013-08-08 6:13 ` Julian Anastasov 2013-08-08 7:34 ` Simon Horman 2013-08-08 7:47 ` Daniel Borkmann 1 sibling, 1 reply; 22+ messages in thread From: Julian Anastasov @ 2013-08-08 6:13 UTC (permalink / raw) To: Simon Horman; +Cc: lvs-devel, Wensong Zhang, Jesper Dangaard Brouer Hello, On Thu, 8 Aug 2013, Simon Horman wrote: > When building ipvsadm this allows make to add to CFLAGS supplied > on the command line. Hm, the change below simply adds -I, variable override is already possible before the change. Is the commit correct? > This seems to make sense as Makefile and libipvs/Makefile > add different CFLAGS but it may be desirable to supply supplementary > flags when building ipvsadm. > > In particular the following may be useful when building ipvsadm > on Debian Jessie. > > make CFLAGS='-I/usr/include/libnl3' LIBS='-lnl-3 -lnl-genl-3 -lnl-3 -lpopt' Hm, such command line vars override the vars in Makefiles, they do not add to them. So, it is not good for libipvs where -fPIC is the difference. make has such rules for vars: Order of variables: - command line - makefile - environment For example: var=env make var=command_line If -e is provided order is: command line, environment, makefile Sub-make: only command line and environment vars are inherited, use 'export' to provide variables defined in makefile As result, we can support EXTRA_CFLAGS when we want to add -Idir or other options, for example: Makefile: CFLAGS = $(EXTRA_CFLAGS) -Wall -Wunused -Wstrict-prototypes -g libipvs/Makefile: CFLAGS = $(EXTRA_CFLAGS) -Wall -Wunused -Wstrict-prototypes -g -fPIC Then: 1. Add to CFLAGS by providing EXTRA_CFLAGS, override LIBS: make EXTRA_CFLAGS='-I/usr/include/libnl3' \ LIBS='-lnl-3 -lnl-genl-3 -lnl-3 -lpopt' 2. Override CFLAGS for both Makefiles because CFLAGS from command line is inherited in sub-make make CFLAGS='-I/usr/include/libnl3 -fPIC' \ LIBS='-lnl-3 -lnl-genl-3 -lnl-3 -lpopt' We can add EXTRA_LIBS if needed to complement EXTRA_CFLAGS. Also, this is NOT an alternative: Makefile: CFLAGS+=-Wall -Wunused -Wstrict-prototypes -g Makefile: CFLAGS+=-Wall -Wunused -Wstrict-prototypes -g -fPIC because make CFLAGS=... will override the var, makefile can override command line vars in such way but it is ugly: override var=DEFERRED override var:=IMMEDIATE override var+=APPEND > Signed-off-by: Simon Horman <horms@verge.net.au> > --- > Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/Makefile b/Makefile > index 6e36d79..c8c1eec 100644 > --- a/Makefile > +++ b/Makefile > @@ -48,7 +48,7 @@ STATIC_LIBS = libipvs/libipvs.a > ifeq "${ARCH}" "sparc64" > CFLAGS = -Wall -Wunused -Wstrict-prototypes -g -m64 -pipe -mcpu=ultrasparc -mcmodel=medlow > else > - CFLAGS = -Wall -Wunused -Wstrict-prototypes -g > + CFLAGS = -I/usr/include/libnl3 -Wall -Wunused -Wstrict-prototypes -g > endif > > > -- > 1.8.3.2 Regards -- Julian Anastasov <ja@ssi.bg> ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] Allow override of CFLAGS 2013-08-08 6:13 ` Julian Anastasov @ 2013-08-08 7:34 ` Simon Horman 2013-08-08 8:30 ` Julian Anastasov 0 siblings, 1 reply; 22+ messages in thread From: Simon Horman @ 2013-08-08 7:34 UTC (permalink / raw) To: Julian Anastasov; +Cc: lvs-devel, Wensong Zhang, Jesper Dangaard Brouer On Thu, Aug 08, 2013 at 09:13:38AM +0300, Julian Anastasov wrote: > > Hello, > > On Thu, 8 Aug 2013, Simon Horman wrote: > > > When building ipvsadm this allows make to add to CFLAGS supplied > > on the command line. > > Hm, the change below simply adds -I, variable > override is already possible before the change. Is the > commit correct? The commit is completely wrong, sorry! > > This seems to make sense as Makefile and libipvs/Makefile > > add different CFLAGS but it may be desirable to supply supplementary > > flags when building ipvsadm. > > > > In particular the following may be useful when building ipvsadm > > on Debian Jessie. > > > > make CFLAGS='-I/usr/include/libnl3' LIBS='-lnl-3 -lnl-genl-3 -lnl-3 -lpopt' > > Hm, such command line vars override the > vars in Makefiles, they do not add to them. So, it is > not good for libipvs where -fPIC is the difference. > > make has such rules for vars: > > Order of variables: > - command line > - makefile > - environment > > For example: var=env make var=command_line > If -e is provided order is: command line, environment, makefile > Sub-make: only command line and environment vars are inherited, > use 'export' to provide variables defined in makefile > > As result, we can support EXTRA_CFLAGS when > we want to add -Idir or other options, for example: > > Makefile: > CFLAGS = $(EXTRA_CFLAGS) -Wall -Wunused -Wstrict-prototypes -g > > libipvs/Makefile: > CFLAGS = $(EXTRA_CFLAGS) -Wall -Wunused -Wstrict-prototypes -g -fPIC > > Then: > > 1. Add to CFLAGS by providing EXTRA_CFLAGS, override LIBS: > > make EXTRA_CFLAGS='-I/usr/include/libnl3' \ > LIBS='-lnl-3 -lnl-genl-3 -lnl-3 -lpopt' > > 2. Override CFLAGS for both Makefiles because CFLAGS from > command line is inherited in sub-make > > make CFLAGS='-I/usr/include/libnl3 -fPIC' \ > LIBS='-lnl-3 -lnl-genl-3 -lnl-3 -lpopt' > > We can add EXTRA_LIBS if needed to complement > EXTRA_CFLAGS. > > Also, this is NOT an alternative: > > Makefile: > CFLAGS+=-Wall -Wunused -Wstrict-prototypes -g > > Makefile: > CFLAGS+=-Wall -Wunused -Wstrict-prototypes -g -fPIC > > because make CFLAGS=... will override the var, > makefile can override command line vars in such way but > it is ugly: > > override var=DEFERRED > override var:=IMMEDIATE > override var+=APPEND I was planning to use override but somehow I sent the wrong version of the patch. However, I like your EXTRA_CFLAGS and EXTRA_LIBS idea better. Should I send a patch or would you like to? > > > Signed-off-by: Simon Horman <horms@verge.net.au> > > --- > > Makefile | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/Makefile b/Makefile > > index 6e36d79..c8c1eec 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -48,7 +48,7 @@ STATIC_LIBS = libipvs/libipvs.a > > ifeq "${ARCH}" "sparc64" > > CFLAGS = -Wall -Wunused -Wstrict-prototypes -g -m64 -pipe -mcpu=ultrasparc -mcmodel=medlow > > else > > - CFLAGS = -Wall -Wunused -Wstrict-prototypes -g > > + CFLAGS = -I/usr/include/libnl3 -Wall -Wunused -Wstrict-prototypes -g > > endif > > > > > > -- > > 1.8.3.2 > > Regards > > -- > Julian Anastasov <ja@ssi.bg> > ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] Allow override of CFLAGS 2013-08-08 7:34 ` Simon Horman @ 2013-08-08 8:30 ` Julian Anastasov 0 siblings, 0 replies; 22+ messages in thread From: Julian Anastasov @ 2013-08-08 8:30 UTC (permalink / raw) To: Simon Horman; +Cc: lvs-devel, Wensong Zhang, Jesper Dangaard Brouer Hello, On Thu, 8 Aug 2013, Simon Horman wrote: > On Thu, Aug 08, 2013 at 09:13:38AM +0300, Julian Anastasov wrote: > > As result, we can support EXTRA_CFLAGS when > > we want to add -Idir or other options, for example: > > > > Makefile: > > CFLAGS = $(EXTRA_CFLAGS) -Wall -Wunused -Wstrict-prototypes -g > > > > libipvs/Makefile: > > CFLAGS = $(EXTRA_CFLAGS) -Wall -Wunused -Wstrict-prototypes -g -fPIC > > > > Then: > > > > 1. Add to CFLAGS by providing EXTRA_CFLAGS, override LIBS: > > > > make EXTRA_CFLAGS='-I/usr/include/libnl3' \ > > LIBS='-lnl-3 -lnl-genl-3 -lnl-3 -lpopt' > > > > 2. Override CFLAGS for both Makefiles because CFLAGS from > > command line is inherited in sub-make > > > > make CFLAGS='-I/usr/include/libnl3 -fPIC' \ > > LIBS='-lnl-3 -lnl-genl-3 -lnl-3 -lpopt' > > > > We can add EXTRA_LIBS if needed to complement > > EXTRA_CFLAGS. > > > > Also, this is NOT an alternative: > > > > Makefile: > > CFLAGS+=-Wall -Wunused -Wstrict-prototypes -g > > > > Makefile: > > CFLAGS+=-Wall -Wunused -Wstrict-prototypes -g -fPIC > > > > because make CFLAGS=... will override the var, > > makefile can override command line vars in such way but > > it is ugly: > > > > override var=DEFERRED > > override var:=IMMEDIATE > > override var+=APPEND > > I was planning to use override but somehow I sent the wrong version of the patch. > > However, I like your EXTRA_CFLAGS and EXTRA_LIBS idea better. > Should I send a patch or would you like to? You can try it, hope it works. Regards -- Julian Anastasov <ja@ssi.bg> ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] Allow override of CFLAGS 2013-08-08 4:59 [PATCH] Allow override of CFLAGS Simon Horman 2013-08-08 6:13 ` Julian Anastasov @ 2013-08-08 7:47 ` Daniel Borkmann 2013-08-08 8:19 ` ipvsadm git head not compiling on RHEL6 Jesper Dangaard Brouer ` (2 more replies) 1 sibling, 3 replies; 22+ messages in thread From: Daniel Borkmann @ 2013-08-08 7:47 UTC (permalink / raw) To: Simon Horman Cc: lvs-devel, Wensong Zhang, Julian Anastasov, Jesper Dangaard Brouer On 08/08/2013 06:59 AM, Simon Horman wrote: > When building ipvsadm this allows make to add to CFLAGS supplied > on the command line. > > This seems to make sense as Makefile and libipvs/Makefile > add different CFLAGS but it may be desirable to supply supplementary > flags when building ipvsadm. > > In particular the following may be useful when building ipvsadm > on Debian Jessie. > > make CFLAGS='-I/usr/include/libnl3' LIBS='-lnl-3 -lnl-genl-3 -lnl-3 -lpopt' For libnl3, what about ... cflags: $(shell pkg-config --cflags libnl-3.0) $(shell pkg-config --cflags libnl-3.0) libs: $(shell pkg-config --libs libnl-3.0) $(shell pkg-config --libs libnl-genl-3.0) > Signed-off-by: Simon Horman <horms@verge.net.au> > --- > Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/Makefile b/Makefile > index 6e36d79..c8c1eec 100644 > --- a/Makefile > +++ b/Makefile > @@ -48,7 +48,7 @@ STATIC_LIBS = libipvs/libipvs.a > ifeq "${ARCH}" "sparc64" > CFLAGS = -Wall -Wunused -Wstrict-prototypes -g -m64 -pipe -mcpu=ultrasparc -mcmodel=medlow > else > - CFLAGS = -Wall -Wunused -Wstrict-prototypes -g > + CFLAGS = -I/usr/include/libnl3 -Wall -Wunused -Wstrict-prototypes -g > endif > > > ^ permalink raw reply [flat|nested] 22+ messages in thread
* ipvsadm git head not compiling on RHEL6 2013-08-08 7:47 ` Daniel Borkmann @ 2013-08-08 8:19 ` Jesper Dangaard Brouer 2013-08-08 8:27 ` Daniel Borkmann 2013-08-08 9:00 ` [PATCH] Allow override of CFLAGS Simon Horman 2013-08-08 12:10 ` [PATCH] ipvsadm: fix compiling tool on distros with only libnl-1 Jesper Dangaard Brouer 2 siblings, 1 reply; 22+ messages in thread From: Jesper Dangaard Brouer @ 2013-08-08 8:19 UTC (permalink / raw) To: Daniel Borkmann; +Cc: Simon Horman, lvs-devel, Wensong Zhang, Julian Anastasov I noticed that I get an compile error, when compiling ipvsadm git HEAD 1ea1f41f4 on RHEL6.4. Compile Error: gcc -Wall -Wunused -Wstrict-prototypes -g -o ipvsadm ipvsadm.o config_stream.o dynamic_array.o libipvs/libipvs.a -lpopt -lnl libipvs/libipvs.a(libipvs.o): In function `ipvs_nl_send_message': /home/jbrouer/git/ipvsadm/libipvs/libipvs.c:76: undefined reference to `nl_socket_alloc' /home/jbrouer/git/ipvsadm/libipvs/libipvs.c:91: undefined reference to `nl_socket_free' /home/jbrouer/git/ipvsadm/libipvs/libipvs.c:107: undefined reference to `nl_socket_free' /home/jbrouer/git/ipvsadm/libipvs/libipvs.c:112: undefined reference to `nl_socket_free' collect2: ld returned 1 exit status make: *** [ipvsadm] Error 1 I'll investigate, but hints would be appreciated ;-) -- Best regards, Jesper Dangaard Brouer MSc.CS, Sr. Network Kernel Developer at Red Hat Author of http://www.iptv-analyzer.org LinkedIn: http://www.linkedin.com/in/brouer ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: ipvsadm git head not compiling on RHEL6 2013-08-08 8:19 ` ipvsadm git head not compiling on RHEL6 Jesper Dangaard Brouer @ 2013-08-08 8:27 ` Daniel Borkmann 2013-08-08 9:00 ` Simon Horman 2013-08-08 9:17 ` Jesper Dangaard Brouer 0 siblings, 2 replies; 22+ messages in thread From: Daniel Borkmann @ 2013-08-08 8:27 UTC (permalink / raw) To: Jesper Dangaard Brouer Cc: Simon Horman, lvs-devel, Wensong Zhang, Julian Anastasov On 08/08/2013 10:19 AM, Jesper Dangaard Brouer wrote: > > I noticed that I get an compile error, when compiling ipvsadm > git HEAD 1ea1f41f4 on RHEL6.4. > > Compile Error: > > gcc -Wall -Wunused -Wstrict-prototypes -g -o ipvsadm ipvsadm.o config_stream.o dynamic_array.o libipvs/libipvs.a -lpopt -lnl > libipvs/libipvs.a(libipvs.o): In function `ipvs_nl_send_message': > /home/jbrouer/git/ipvsadm/libipvs/libipvs.c:76: undefined reference to `nl_socket_alloc' > /home/jbrouer/git/ipvsadm/libipvs/libipvs.c:91: undefined reference to `nl_socket_free' > /home/jbrouer/git/ipvsadm/libipvs/libipvs.c:107: undefined reference to `nl_socket_free' > /home/jbrouer/git/ipvsadm/libipvs/libipvs.c:112: undefined reference to `nl_socket_free' > collect2: ld returned 1 exit status > make: *** [ipvsadm] Error 1 > > I'll investigate, but hints would be appreciated ;-) Did you try using libnl3? (Migrating to libnl3 would be better anyway as distributions try to get rid of supporting libnl.) I think sometime in libnl*, nl_handle_{alloc,free} was changed to nl_socket_{alloc,free}. Maybe try changing include locations and libs that are linked against to libnl3. ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: ipvsadm git head not compiling on RHEL6 2013-08-08 8:27 ` Daniel Borkmann @ 2013-08-08 9:00 ` Simon Horman 2013-08-08 9:17 ` Jesper Dangaard Brouer 1 sibling, 0 replies; 22+ messages in thread From: Simon Horman @ 2013-08-08 9:00 UTC (permalink / raw) To: Daniel Borkmann Cc: Jesper Dangaard Brouer, lvs-devel, Wensong Zhang, Julian Anastasov On Thu, Aug 08, 2013 at 10:27:05AM +0200, Daniel Borkmann wrote: > On 08/08/2013 10:19 AM, Jesper Dangaard Brouer wrote: > > > >I noticed that I get an compile error, when compiling ipvsadm > >git HEAD 1ea1f41f4 on RHEL6.4. > > > >Compile Error: > > > >gcc -Wall -Wunused -Wstrict-prototypes -g -o ipvsadm ipvsadm.o config_stream.o dynamic_array.o libipvs/libipvs.a -lpopt -lnl > >libipvs/libipvs.a(libipvs.o): In function `ipvs_nl_send_message': > >/home/jbrouer/git/ipvsadm/libipvs/libipvs.c:76: undefined reference to `nl_socket_alloc' > >/home/jbrouer/git/ipvsadm/libipvs/libipvs.c:91: undefined reference to `nl_socket_free' > >/home/jbrouer/git/ipvsadm/libipvs/libipvs.c:107: undefined reference to `nl_socket_free' > >/home/jbrouer/git/ipvsadm/libipvs/libipvs.c:112: undefined reference to `nl_socket_free' > >collect2: ld returned 1 exit status > >make: *** [ipvsadm] Error 1 > > > >I'll investigate, but hints would be appreciated ;-) > > Did you try using libnl3? (Migrating to libnl3 would be better anyway as > distributions try to get rid of supporting libnl.) > > I think sometime in libnl*, nl_handle_{alloc,free} was changed to > nl_socket_{alloc,free}. > > Maybe try changing include locations and libs that are linked against > to libnl3. I'm pretty sure that I saw the same problem and that using libnl3 was the solution. ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: ipvsadm git head not compiling on RHEL6 2013-08-08 8:27 ` Daniel Borkmann 2013-08-08 9:00 ` Simon Horman @ 2013-08-08 9:17 ` Jesper Dangaard Brouer 2013-08-08 9:23 ` Daniel Borkmann 1 sibling, 1 reply; 22+ messages in thread From: Jesper Dangaard Brouer @ 2013-08-08 9:17 UTC (permalink / raw) To: Daniel Borkmann, Ryan O'Hara Cc: Simon Horman, lvs-devel, Wensong Zhang, Julian Anastasov, Thomas Graf On Thu, 08 Aug 2013 10:27:05 +0200 Daniel Borkmann <dborkman@redhat.com> wrote: > On 08/08/2013 10:19 AM, Jesper Dangaard Brouer wrote: > > > > I noticed that I get an compile error, when compiling ipvsadm > > git HEAD 1ea1f41f4 on RHEL6.4. > > > > Compile Error: > > > > gcc -Wall -Wunused -Wstrict-prototypes -g -o ipvsadm ipvsadm.o config_stream.o dynamic_array.o libipvs/libipvs.a -lpopt -lnl > > libipvs/libipvs.a(libipvs.o): In function `ipvs_nl_send_message': > > /home/jbrouer/git/ipvsadm/libipvs/libipvs.c:76: undefined reference to `nl_socket_alloc' > > /home/jbrouer/git/ipvsadm/libipvs/libipvs.c:91: undefined reference to `nl_socket_free' > > /home/jbrouer/git/ipvsadm/libipvs/libipvs.c:107: undefined reference to `nl_socket_free' > > /home/jbrouer/git/ipvsadm/libipvs/libipvs.c:112: undefined reference to `nl_socket_free' > > collect2: ld returned 1 exit status > > make: *** [ipvsadm] Error 1 > > > > I'll investigate, but hints would be appreciated ;-) > > Did you try using libnl3? (Migrating to libnl3 would be better anyway as > distributions try to get rid of supporting libnl.) Nope, I'm using the default libnl coming with RHEL6.4. Its not really an option to import/change to libnl3 for RHEL6. But you could try poking Thomas Graf ;-) > I think sometime in libnl*, nl_handle_{alloc,free} was changed to > nl_socket_{alloc,free}. Yes, I can see that your libnl3 commit f48e93c1 (libipvs: libnl3: fix compilation error) caused this issue. > Maybe try changing include locations and libs that are linked against > to libnl3. We officially support ipvsadm for RHEL6, so its not an option to link against libnl3, as we need to supply an official package... else we/I would need to have an adaption patch in the RPM (I were looking to rebase RHEL6 to use the upcoming ipvsadm release). -- Best regards, Jesper Dangaard Brouer MSc.CS, Sr. Network Kernel Developer at Red Hat Author of http://www.iptv-analyzer.org LinkedIn: http://www.linkedin.com/in/brouer ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: ipvsadm git head not compiling on RHEL6 2013-08-08 9:17 ` Jesper Dangaard Brouer @ 2013-08-08 9:23 ` Daniel Borkmann 2013-08-08 9:33 ` Thomas Graf 0 siblings, 1 reply; 22+ messages in thread From: Daniel Borkmann @ 2013-08-08 9:23 UTC (permalink / raw) To: Jesper Dangaard Brouer Cc: Ryan O'Hara, Simon Horman, lvs-devel, Wensong Zhang, Julian Anastasov, Thomas Graf On 08/08/2013 11:17 AM, Jesper Dangaard Brouer wrote: > On Thu, 08 Aug 2013 10:27:05 +0200 > Daniel Borkmann <dborkman@redhat.com> wrote: >> On 08/08/2013 10:19 AM, Jesper Dangaard Brouer wrote: >>> >>> I noticed that I get an compile error, when compiling ipvsadm >>> git HEAD 1ea1f41f4 on RHEL6.4. >>> >>> Compile Error: >>> >>> gcc -Wall -Wunused -Wstrict-prototypes -g -o ipvsadm ipvsadm.o config_stream.o dynamic_array.o libipvs/libipvs.a -lpopt -lnl >>> libipvs/libipvs.a(libipvs.o): In function `ipvs_nl_send_message': >>> /home/jbrouer/git/ipvsadm/libipvs/libipvs.c:76: undefined reference to `nl_socket_alloc' >>> /home/jbrouer/git/ipvsadm/libipvs/libipvs.c:91: undefined reference to `nl_socket_free' >>> /home/jbrouer/git/ipvsadm/libipvs/libipvs.c:107: undefined reference to `nl_socket_free' >>> /home/jbrouer/git/ipvsadm/libipvs/libipvs.c:112: undefined reference to `nl_socket_free' >>> collect2: ld returned 1 exit status >>> make: *** [ipvsadm] Error 1 >>> >>> I'll investigate, but hints would be appreciated ;-) >> >> Did you try using libnl3? (Migrating to libnl3 would be better anyway as >> distributions try to get rid of supporting libnl.) > > Nope, I'm using the default libnl coming with RHEL6.4. > > Its not really an option to import/change to libnl3 for RHEL6. But you > could try poking Thomas Graf ;-) > >> I think sometime in libnl*, nl_handle_{alloc,free} was changed to >> nl_socket_{alloc,free}. > > Yes, I can see that your libnl3 commit f48e93c1 (libipvs: libnl3: fix > compilation error) caused this issue. Well, because it broke the build when using libnl3 which should be the way to go for most users. ;-) You could add a fall-back define for libnl1 users, so that there's just a textual replacement to the old name. >> Maybe try changing include locations and libs that are linked against >> to libnl3. > > We officially support ipvsadm for RHEL6, so its not an option to link > against libnl3, as we need to supply an official package... else we/I > would need to have an adaption patch in the RPM (I were looking to > rebase RHEL6 to use the upcoming ipvsadm release). ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: ipvsadm git head not compiling on RHEL6 2013-08-08 9:23 ` Daniel Borkmann @ 2013-08-08 9:33 ` Thomas Graf 0 siblings, 0 replies; 22+ messages in thread From: Thomas Graf @ 2013-08-08 9:33 UTC (permalink / raw) To: Daniel Borkmann Cc: Jesper Dangaard Brouer, Ryan O'Hara, Simon Horman, lvs-devel, Wensong Zhang, Julian Anastasov On 08/08/2013 11:23 AM, Daniel Borkmann wrote: > On 08/08/2013 11:17 AM, Jesper Dangaard Brouer wrote: >> On Thu, 08 Aug 2013 10:27:05 +0200 >> Daniel Borkmann <dborkman@redhat.com> wrote: >>> On 08/08/2013 10:19 AM, Jesper Dangaard Brouer wrote: >>>> >>>> I noticed that I get an compile error, when compiling ipvsadm >>>> git HEAD 1ea1f41f4 on RHEL6.4. >>>> >>>> Compile Error: >>>> >>>> gcc -Wall -Wunused -Wstrict-prototypes -g -o ipvsadm ipvsadm.o >>>> config_stream.o dynamic_array.o libipvs/libipvs.a -lpopt -lnl >>>> libipvs/libipvs.a(libipvs.o): In function `ipvs_nl_send_message': >>>> /home/jbrouer/git/ipvsadm/libipvs/libipvs.c:76: undefined reference >>>> to `nl_socket_alloc' >>>> /home/jbrouer/git/ipvsadm/libipvs/libipvs.c:91: undefined reference >>>> to `nl_socket_free' >>>> /home/jbrouer/git/ipvsadm/libipvs/libipvs.c:107: undefined reference >>>> to `nl_socket_free' >>>> /home/jbrouer/git/ipvsadm/libipvs/libipvs.c:112: undefined reference >>>> to `nl_socket_free' >>>> collect2: ld returned 1 exit status >>>> make: *** [ipvsadm] Error 1 >>>> >>>> I'll investigate, but hints would be appreciated ;-) >>> >>> Did you try using libnl3? (Migrating to libnl3 would be better anyway as >>> distributions try to get rid of supporting libnl.) >> >> Nope, I'm using the default libnl coming with RHEL6.4. >> >> Its not really an option to import/change to libnl3 for RHEL6. But you >> could try poking Thomas Graf ;-) >> >>> I think sometime in libnl*, nl_handle_{alloc,free} was changed to >>> nl_socket_{alloc,free}. >> >> Yes, I can see that your libnl3 commit f48e93c1 (libipvs: libnl3: fix >> compilation error) caused this issue. > > Well, because it broke the build when using libnl3 which should be the > way to go for most users. ;-) > > You could add a fall-back define for libnl1 users, so that there's just > a textual replacement to the old name. > >>> Maybe try changing include locations and libs that are linked against >>> to libnl3. >> >> We officially support ipvsadm for RHEL6, so its not an option to link >> against libnl3, as we need to supply an official package... else we/I >> would need to have an adaption patch in the RPM (I were looking to >> rebase RHEL6 to use the upcoming ipvsadm release). libnl1 and libnl3 are not API compatible. ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] Allow override of CFLAGS 2013-08-08 7:47 ` Daniel Borkmann 2013-08-08 8:19 ` ipvsadm git head not compiling on RHEL6 Jesper Dangaard Brouer @ 2013-08-08 9:00 ` Simon Horman 2013-08-08 9:05 ` Daniel Borkmann 2013-08-08 12:10 ` [PATCH] ipvsadm: fix compiling tool on distros with only libnl-1 Jesper Dangaard Brouer 2 siblings, 1 reply; 22+ messages in thread From: Simon Horman @ 2013-08-08 9:00 UTC (permalink / raw) To: Daniel Borkmann Cc: lvs-devel, Wensong Zhang, Julian Anastasov, Jesper Dangaard Brouer On Thu, Aug 08, 2013 at 09:47:30AM +0200, Daniel Borkmann wrote: > On 08/08/2013 06:59 AM, Simon Horman wrote: > >When building ipvsadm this allows make to add to CFLAGS supplied > >on the command line. > > > >This seems to make sense as Makefile and libipvs/Makefile > >add different CFLAGS but it may be desirable to supply supplementary > >flags when building ipvsadm. > > > >In particular the following may be useful when building ipvsadm > >on Debian Jessie. > > > >make CFLAGS='-I/usr/include/libnl3' LIBS='-lnl-3 -lnl-genl-3 -lnl-3 -lpopt' > > For libnl3, what about ... > > cflags: $(shell pkg-config --cflags libnl-3.0) $(shell pkg-config --cflags libnl-3.0) > libs: $(shell pkg-config --libs libnl-3.0) $(shell pkg-config --libs libnl-genl-3.0) That seems reasonable to me. Is it likely to work on a variety of distributions? > > >Signed-off-by: Simon Horman <horms@verge.net.au> > >--- > > Makefile | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > >diff --git a/Makefile b/Makefile > >index 6e36d79..c8c1eec 100644 > >--- a/Makefile > >+++ b/Makefile > >@@ -48,7 +48,7 @@ STATIC_LIBS = libipvs/libipvs.a > > ifeq "${ARCH}" "sparc64" > > CFLAGS = -Wall -Wunused -Wstrict-prototypes -g -m64 -pipe -mcpu=ultrasparc -mcmodel=medlow > > else > >- CFLAGS = -Wall -Wunused -Wstrict-prototypes -g > >+ CFLAGS = -I/usr/include/libnl3 -Wall -Wunused -Wstrict-prototypes -g > > endif > > > > > > > ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] Allow override of CFLAGS 2013-08-08 9:00 ` [PATCH] Allow override of CFLAGS Simon Horman @ 2013-08-08 9:05 ` Daniel Borkmann 0 siblings, 0 replies; 22+ messages in thread From: Daniel Borkmann @ 2013-08-08 9:05 UTC (permalink / raw) To: Simon Horman Cc: lvs-devel, Wensong Zhang, Julian Anastasov, Jesper Dangaard Brouer On 08/08/2013 11:00 AM, Simon Horman wrote: > On Thu, Aug 08, 2013 at 09:47:30AM +0200, Daniel Borkmann wrote: >> On 08/08/2013 06:59 AM, Simon Horman wrote: >>> When building ipvsadm this allows make to add to CFLAGS supplied >>> on the command line. >>> >>> This seems to make sense as Makefile and libipvs/Makefile >>> add different CFLAGS but it may be desirable to supply supplementary >>> flags when building ipvsadm. >>> >>> In particular the following may be useful when building ipvsadm >>> on Debian Jessie. >>> >>> make CFLAGS='-I/usr/include/libnl3' LIBS='-lnl-3 -lnl-genl-3 -lnl-3 -lpopt' >> >> For libnl3, what about ... >> >> cflags: $(shell pkg-config --cflags libnl-3.0) $(shell pkg-config --cflags libnl-3.0) >> libs: $(shell pkg-config --libs libnl-3.0) $(shell pkg-config --libs libnl-genl-3.0) > > That seems reasonable to me. Is it likely to work on a variety of > distributions? Afaik, this should do the job at least on the major ones like Fedora/RHEL and Debian, also Gentoo, etc. I once had people sending me patches to switch to pkg-config on netsniff-ng. >>> Signed-off-by: Simon Horman <horms@verge.net.au> >>> --- >>> Makefile | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/Makefile b/Makefile >>> index 6e36d79..c8c1eec 100644 >>> --- a/Makefile >>> +++ b/Makefile >>> @@ -48,7 +48,7 @@ STATIC_LIBS = libipvs/libipvs.a >>> ifeq "${ARCH}" "sparc64" >>> CFLAGS = -Wall -Wunused -Wstrict-prototypes -g -m64 -pipe -mcpu=ultrasparc -mcmodel=medlow >>> else >>> - CFLAGS = -Wall -Wunused -Wstrict-prototypes -g >>> + CFLAGS = -I/usr/include/libnl3 -Wall -Wunused -Wstrict-prototypes -g >>> endif ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH] ipvsadm: fix compiling tool on distros with only libnl-1 2013-08-08 7:47 ` Daniel Borkmann 2013-08-08 8:19 ` ipvsadm git head not compiling on RHEL6 Jesper Dangaard Brouer 2013-08-08 9:00 ` [PATCH] Allow override of CFLAGS Simon Horman @ 2013-08-08 12:10 ` Jesper Dangaard Brouer 2013-08-08 12:23 ` Daniel Borkmann 2013-08-08 20:00 ` Ryan O'Hara 2 siblings, 2 replies; 22+ messages in thread From: Jesper Dangaard Brouer @ 2013-08-08 12:10 UTC (permalink / raw) To: Simon Horman Cc: Wensong Zhang, Thomas Graf, Ryan O'Hara, Julian Anastasov, Jesper Dangaard Brouer, lvs-devel, Daniel Borkmann Some distros have not moved to libnl3 yet. Add a fallback option for compiling on distro's with only libnl1. Using pkg-config to detect what versions of libnl is available. Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> --- libipvs/Makefile | 5 +++++ libipvs/libipvs.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/libipvs/Makefile b/libipvs/Makefile index a527a7f..eafc3e5 100644 --- a/libipvs/Makefile +++ b/libipvs/Makefile @@ -10,6 +10,11 @@ INCLUDE += $(shell if [ -f ../../ip_vs.h ]; then \ echo "-I../../."; fi;) DEFINES = $(shell if [ ! -f ../../ip_vs.h ]; then \ echo "-DHAVE_NET_IP_VS_H"; fi;) +DEFINES += $(shell if which pkg-config > /dev/null 2>&1; then \ + if pkg-config --exists libnl-3.0; then :; \ + elif pkg-config --exists libnl-2.0; then :; \ + elif pkg-config --exists libnl-1; \ + then echo "-DFALLBACK_LIBNL1"; fi; fi) .PHONY = all clean install dist distclean rpm rpms STATIC_LIB = libipvs.a diff --git a/libipvs/libipvs.c b/libipvs/libipvs.c index c3c3b0a..2b066d2 100644 --- a/libipvs/libipvs.c +++ b/libipvs/libipvs.c @@ -32,6 +32,11 @@ static void* ipvs_func = NULL; struct ip_vs_getinfo ipvs_info; #ifdef LIBIPVS_USE_NL +#ifdef FALLBACK_LIBNL1 +#define nl_sock nl_handle +#define nl_socket_alloc nl_handle_alloc +#define nl_socket_free nl_handle_destroy +#endif static struct nl_sock *sock = NULL; static int family, try_nl = 1; #endif ^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH] ipvsadm: fix compiling tool on distros with only libnl-1 2013-08-08 12:10 ` [PATCH] ipvsadm: fix compiling tool on distros with only libnl-1 Jesper Dangaard Brouer @ 2013-08-08 12:23 ` Daniel Borkmann 2013-08-08 20:00 ` Ryan O'Hara 1 sibling, 0 replies; 22+ messages in thread From: Daniel Borkmann @ 2013-08-08 12:23 UTC (permalink / raw) To: Jesper Dangaard Brouer Cc: Simon Horman, Wensong Zhang, Thomas Graf, Ryan O'Hara, Julian Anastasov, Jesper Dangaard Brouer, lvs-devel On 08/08/2013 02:10 PM, Jesper Dangaard Brouer wrote: > Some distros have not moved to libnl3 yet. Add a fallback option > for compiling on distro's with only libnl1. > > Using pkg-config to detect what versions of libnl is available. > > Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Acked-by: Daniel Borkmann <dborkman@redhat.com> > --- > libipvs/Makefile | 5 +++++ > libipvs/libipvs.c | 5 +++++ > 2 files changed, 10 insertions(+) > > diff --git a/libipvs/Makefile b/libipvs/Makefile > index a527a7f..eafc3e5 100644 > --- a/libipvs/Makefile > +++ b/libipvs/Makefile > @@ -10,6 +10,11 @@ INCLUDE += $(shell if [ -f ../../ip_vs.h ]; then \ > echo "-I../../."; fi;) > DEFINES = $(shell if [ ! -f ../../ip_vs.h ]; then \ > echo "-DHAVE_NET_IP_VS_H"; fi;) > +DEFINES += $(shell if which pkg-config > /dev/null 2>&1; then \ > + if pkg-config --exists libnl-3.0; then :; \ > + elif pkg-config --exists libnl-2.0; then :; \ > + elif pkg-config --exists libnl-1; \ > + then echo "-DFALLBACK_LIBNL1"; fi; fi) > > .PHONY = all clean install dist distclean rpm rpms > STATIC_LIB = libipvs.a > diff --git a/libipvs/libipvs.c b/libipvs/libipvs.c > index c3c3b0a..2b066d2 100644 > --- a/libipvs/libipvs.c > +++ b/libipvs/libipvs.c > @@ -32,6 +32,11 @@ static void* ipvs_func = NULL; > struct ip_vs_getinfo ipvs_info; > > #ifdef LIBIPVS_USE_NL > +#ifdef FALLBACK_LIBNL1 > +#define nl_sock nl_handle > +#define nl_socket_alloc nl_handle_alloc > +#define nl_socket_free nl_handle_destroy > +#endif > static struct nl_sock *sock = NULL; > static int family, try_nl = 1; > #endif > ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] ipvsadm: fix compiling tool on distros with only libnl-1 2013-08-08 12:10 ` [PATCH] ipvsadm: fix compiling tool on distros with only libnl-1 Jesper Dangaard Brouer 2013-08-08 12:23 ` Daniel Borkmann @ 2013-08-08 20:00 ` Ryan O'Hara 2013-08-09 5:47 ` Simon Horman 1 sibling, 1 reply; 22+ messages in thread From: Ryan O'Hara @ 2013-08-08 20:00 UTC (permalink / raw) To: Jesper Dangaard Brouer Cc: Simon Horman, Wensong Zhang, Thomas Graf, Julian Anastasov, Jesper Dangaard Brouer, lvs-devel, Daniel Borkmann On Thu, Aug 08, 2013 at 02:10:54PM +0200, Jesper Dangaard Brouer wrote: > Some distros have not moved to libnl3 yet. Add a fallback option > for compiling on distro's with only libnl1. > > Using pkg-config to detect what versions of libnl is available. > > Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> This patch looks fine, but I think it only solves part of the problem. The Makefile still contains following code: ifneq (0,$(HAVE_NL)) LIBS += -lnl endif First, I think the HAVE_NL conditional can be removed. But more importantly the correct netlink library should be appended to the LIBS variable. With the current code we'll always link against libnl-1. On Fedora with both libnl and libnl-3 installed: $ pkg-config --libs libnl-3.0 -lnl-3 $ pkg-config --libs libnl-1 -lnl Ryan > --- > libipvs/Makefile | 5 +++++ > libipvs/libipvs.c | 5 +++++ > 2 files changed, 10 insertions(+) > > diff --git a/libipvs/Makefile b/libipvs/Makefile > index a527a7f..eafc3e5 100644 > --- a/libipvs/Makefile > +++ b/libipvs/Makefile > @@ -10,6 +10,11 @@ INCLUDE += $(shell if [ -f ../../ip_vs.h ]; then \ > echo "-I../../."; fi;) > DEFINES = $(shell if [ ! -f ../../ip_vs.h ]; then \ > echo "-DHAVE_NET_IP_VS_H"; fi;) > +DEFINES += $(shell if which pkg-config > /dev/null 2>&1; then \ > + if pkg-config --exists libnl-3.0; then :; \ > + elif pkg-config --exists libnl-2.0; then :; \ > + elif pkg-config --exists libnl-1; \ > + then echo "-DFALLBACK_LIBNL1"; fi; fi) > > .PHONY = all clean install dist distclean rpm rpms > STATIC_LIB = libipvs.a > diff --git a/libipvs/libipvs.c b/libipvs/libipvs.c > index c3c3b0a..2b066d2 100644 > --- a/libipvs/libipvs.c > +++ b/libipvs/libipvs.c > @@ -32,6 +32,11 @@ static void* ipvs_func = NULL; > struct ip_vs_getinfo ipvs_info; > > #ifdef LIBIPVS_USE_NL > +#ifdef FALLBACK_LIBNL1 > +#define nl_sock nl_handle > +#define nl_socket_alloc nl_handle_alloc > +#define nl_socket_free nl_handle_destroy > +#endif > static struct nl_sock *sock = NULL; > static int family, try_nl = 1; > #endif > ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] ipvsadm: fix compiling tool on distros with only libnl-1 2013-08-08 20:00 ` Ryan O'Hara @ 2013-08-09 5:47 ` Simon Horman 2013-08-09 6:27 ` [PATCH v2] " Jesper Dangaard Brouer 2013-08-09 6:43 ` [PATCH] " Jesper Dangaard Brouer 0 siblings, 2 replies; 22+ messages in thread From: Simon Horman @ 2013-08-09 5:47 UTC (permalink / raw) To: Ryan O'Hara Cc: Jesper Dangaard Brouer, Wensong Zhang, Thomas Graf, Julian Anastasov, Jesper Dangaard Brouer, lvs-devel, Daniel Borkmann On Thu, Aug 08, 2013 at 03:00:17PM -0500, Ryan O'Hara wrote: > On Thu, Aug 08, 2013 at 02:10:54PM +0200, Jesper Dangaard Brouer wrote: > > Some distros have not moved to libnl3 yet. Add a fallback option > > for compiling on distro's with only libnl1. > > > > Using pkg-config to detect what versions of libnl is available. > > > > Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> > > This patch looks fine, but I think it only solves part of the > problem. The Makefile still contains following code: > > ifneq (0,$(HAVE_NL)) > LIBS += -lnl > endif > > First, I think the HAVE_NL conditional can be removed. But more > importantly the correct netlink library should be appended to the > LIBS variable. With the current code we'll always link against > libnl-1. > > On Fedora with both libnl and libnl-3 installed: > > $ pkg-config --libs libnl-3.0 > -lnl-3 > $ pkg-config --libs libnl-1 > -lnl > > Ryan Daniel could you amend your patch or provide a second patch to use pkg-confog for LIBS too. It seems like a good idea to me. > > > > --- > > libipvs/Makefile | 5 +++++ > > libipvs/libipvs.c | 5 +++++ > > 2 files changed, 10 insertions(+) > > > > diff --git a/libipvs/Makefile b/libipvs/Makefile > > index a527a7f..eafc3e5 100644 > > --- a/libipvs/Makefile > > +++ b/libipvs/Makefile > > @@ -10,6 +10,11 @@ INCLUDE += $(shell if [ -f ../../ip_vs.h ]; then \ > > echo "-I../../."; fi;) > > DEFINES = $(shell if [ ! -f ../../ip_vs.h ]; then \ > > echo "-DHAVE_NET_IP_VS_H"; fi;) > > +DEFINES += $(shell if which pkg-config > /dev/null 2>&1; then \ > > + if pkg-config --exists libnl-3.0; then :; \ > > + elif pkg-config --exists libnl-2.0; then :; \ > > + elif pkg-config --exists libnl-1; \ > > + then echo "-DFALLBACK_LIBNL1"; fi; fi) > > > > .PHONY = all clean install dist distclean rpm rpms > > STATIC_LIB = libipvs.a > > diff --git a/libipvs/libipvs.c b/libipvs/libipvs.c > > index c3c3b0a..2b066d2 100644 > > --- a/libipvs/libipvs.c > > +++ b/libipvs/libipvs.c > > @@ -32,6 +32,11 @@ static void* ipvs_func = NULL; > > struct ip_vs_getinfo ipvs_info; > > > > #ifdef LIBIPVS_USE_NL > > +#ifdef FALLBACK_LIBNL1 > > +#define nl_sock nl_handle > > +#define nl_socket_alloc nl_handle_alloc > > +#define nl_socket_free nl_handle_destroy > > +#endif > > static struct nl_sock *sock = NULL; > > static int family, try_nl = 1; > > #endif > > > ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v2] ipvsadm: fix compiling tool on distros with only libnl-1 2013-08-09 5:47 ` Simon Horman @ 2013-08-09 6:27 ` Jesper Dangaard Brouer 2013-08-09 8:32 ` Simon Horman 2013-08-09 6:43 ` [PATCH] " Jesper Dangaard Brouer 1 sibling, 1 reply; 22+ messages in thread From: Jesper Dangaard Brouer @ 2013-08-09 6:27 UTC (permalink / raw) To: Simon Horman Cc: Ryan O'Hara, Jesper Dangaard Brouer, Wensong Zhang, Thomas Graf, Julian Anastasov, lvs-devel, Daniel Borkmann Some distros have not moved to libnl3 yet. Add a fallback option for compiling on distro's with only libnl1. Using pkg-config to detect what versions of libnl is available. Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Acked-by: Daniel Borkmann <dborkman@redhat.com> --- V2: My git mail config were wrongly configured, and the orig patch only reached RedHat recipients, thus I'm resending hoping my email client does not screw the patches... libipvs/Makefile | 5 +++++ libipvs/libipvs.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/libipvs/Makefile b/libipvs/Makefile index a527a7f..eafc3e5 100644 --- a/libipvs/Makefile +++ b/libipvs/Makefile @@ -10,6 +10,11 @@ INCLUDE += $(shell if [ -f ../../ip_vs.h ]; then \ echo "-I../../."; fi;) DEFINES = $(shell if [ ! -f ../../ip_vs.h ]; then \ echo "-DHAVE_NET_IP_VS_H"; fi;) +DEFINES += $(shell if which pkg-config > /dev/null 2>&1; then \ + if pkg-config --exists libnl-3.0; then :; \ + elif pkg-config --exists libnl-2.0; then :; \ + elif pkg-config --exists libnl-1; \ + then echo "-DFALLBACK_LIBNL1"; fi; fi) .PHONY = all clean install dist distclean rpm rpms STATIC_LIB = libipvs.a diff --git a/libipvs/libipvs.c b/libipvs/libipvs.c index c3c3b0a..2b066d2 100644 --- a/libipvs/libipvs.c +++ b/libipvs/libipvs.c @@ -32,6 +32,11 @@ static void* ipvs_func = NULL; struct ip_vs_getinfo ipvs_info; #ifdef LIBIPVS_USE_NL +#ifdef FALLBACK_LIBNL1 +#define nl_sock nl_handle +#define nl_socket_alloc nl_handle_alloc +#define nl_socket_free nl_handle_destroy +#endif static struct nl_sock *sock = NULL; static int family, try_nl = 1; #endif ^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH v2] ipvsadm: fix compiling tool on distros with only libnl-1 2013-08-09 6:27 ` [PATCH v2] " Jesper Dangaard Brouer @ 2013-08-09 8:32 ` Simon Horman 0 siblings, 0 replies; 22+ messages in thread From: Simon Horman @ 2013-08-09 8:32 UTC (permalink / raw) To: Jesper Dangaard Brouer Cc: Ryan O'Hara, Wensong Zhang, Thomas Graf, Julian Anastasov, lvs-devel, Daniel Borkmann On Fri, Aug 09, 2013 at 08:27:14AM +0200, Jesper Dangaard Brouer wrote: > > Some distros have not moved to libnl3 yet. Add a fallback option > for compiling on distro's with only libnl1. > > Using pkg-config to detect what versions of libnl is available. > > Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> > Acked-by: Daniel Borkmann <dborkman@redhat.com> > --- > V2: My git mail config were wrongly configured, and the orig > patch only reached RedHat recipients, thus I'm resending > hoping my email client does not screw the patches... > > libipvs/Makefile | 5 +++++ > libipvs/libipvs.c | 5 +++++ > 2 files changed, 10 insertions(+) Thanks, applied. ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] ipvsadm: fix compiling tool on distros with only libnl-1 2013-08-09 5:47 ` Simon Horman 2013-08-09 6:27 ` [PATCH v2] " Jesper Dangaard Brouer @ 2013-08-09 6:43 ` Jesper Dangaard Brouer 2013-08-09 6:55 ` Daniel Borkmann 1 sibling, 1 reply; 22+ messages in thread From: Jesper Dangaard Brouer @ 2013-08-09 6:43 UTC (permalink / raw) To: Simon Horman Cc: Ryan O'Hara, Jesper Dangaard Brouer, Wensong Zhang, Thomas Graf, Julian Anastasov, lvs-devel, Daniel Borkmann On Fri, 9 Aug 2013 14:47:36 +0900 Simon Horman <horms@verge.net.au> wrote: > On Thu, Aug 08, 2013 at 03:00:17PM -0500, Ryan O'Hara wrote: > > On Thu, Aug 08, 2013 at 02:10:54PM +0200, Jesper Dangaard Brouer wrote: > > > Some distros have not moved to libnl3 yet. Add a fallback option > > > for compiling on distro's with only libnl1. > > > > > > Using pkg-config to detect what versions of libnl is available. > > > > > > Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> > > > > This patch looks fine, but I think it only solves part of the > > problem. The Makefile still contains following code: This, patch only address making libnl1 work again. > > ifneq (0,$(HAVE_NL)) > > LIBS += -lnl > > endif > > > > First, I think the HAVE_NL conditional can be removed. But more > > importantly the correct netlink library should be appended to the > > LIBS variable. With the current code we'll always link against > > libnl-1. True. It seems to me that the libnl3 work have not been fully completed. And the reason Simon send the "Allow override of CFLAGS", which allowed him to compile with libnl3 via: make CFLAGS='-I/usr/include/libnl3' LIBS='-lnl-3 -lnl-genl-3 -lpopt' > > On Fedora with both libnl and libnl-3 installed: > > > > $ pkg-config --libs libnl-3.0 > > -lnl-3 > > $ pkg-config --libs libnl-1 > > -lnl > > > > Ryan > > Daniel could you amend your patch or provide a second patch > to use pkg-confog for LIBS too. It seems like a good idea to me. I think a second patch, to address libnl3 issues would be best. > > > --- > > > libipvs/Makefile | 5 +++++ > > > libipvs/libipvs.c | 5 +++++ > > > 2 files changed, 10 insertions(+) > > > > > > diff --git a/libipvs/Makefile b/libipvs/Makefile > > > index a527a7f..eafc3e5 100644 > > > --- a/libipvs/Makefile > > > +++ b/libipvs/Makefile > > > @@ -10,6 +10,11 @@ INCLUDE += $(shell if [ -f ../../ip_vs.h ]; then \ > > > echo "-I../../."; fi;) > > > DEFINES = $(shell if [ ! -f ../../ip_vs.h ]; then \ > > > echo "-DHAVE_NET_IP_VS_H"; fi;) > > > +DEFINES += $(shell if which pkg-config > /dev/null 2>&1; then \ > > > + if pkg-config --exists libnl-3.0; then :; \ > > > + elif pkg-config --exists libnl-2.0; then :; \ > > > + elif pkg-config --exists libnl-1; \ > > > + then echo "-DFALLBACK_LIBNL1"; fi; fi) > > > > > > .PHONY = all clean install dist distclean rpm rpms > > > STATIC_LIB = libipvs.a > > > diff --git a/libipvs/libipvs.c b/libipvs/libipvs.c > > > index c3c3b0a..2b066d2 100644 > > > --- a/libipvs/libipvs.c > > > +++ b/libipvs/libipvs.c > > > @@ -32,6 +32,11 @@ static void* ipvs_func = NULL; > > > struct ip_vs_getinfo ipvs_info; > > > > > > #ifdef LIBIPVS_USE_NL > > > +#ifdef FALLBACK_LIBNL1 > > > +#define nl_sock nl_handle > > > +#define nl_socket_alloc nl_handle_alloc > > > +#define nl_socket_free nl_handle_destroy > > > +#endif > > > static struct nl_sock *sock = NULL; > > > static int family, try_nl = 1; > > > #endif > > > > > -- Best regards, Jesper Dangaard Brouer MSc.CS, Sr. Network Kernel Developer at Red Hat Author of http://www.iptv-analyzer.org LinkedIn: http://www.linkedin.com/in/brouer ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] ipvsadm: fix compiling tool on distros with only libnl-1 2013-08-09 6:43 ` [PATCH] " Jesper Dangaard Brouer @ 2013-08-09 6:55 ` Daniel Borkmann 2013-08-09 8:31 ` Simon Horman 0 siblings, 1 reply; 22+ messages in thread From: Daniel Borkmann @ 2013-08-09 6:55 UTC (permalink / raw) To: Jesper Dangaard Brouer Cc: Simon Horman, Ryan O'Hara, Jesper Dangaard Brouer, Wensong Zhang, Thomas Graf, Julian Anastasov, lvs-devel On 08/09/2013 08:43 AM, Jesper Dangaard Brouer wrote: > On Fri, 9 Aug 2013 14:47:36 +0900 > Simon Horman <horms@verge.net.au> wrote: > >> On Thu, Aug 08, 2013 at 03:00:17PM -0500, Ryan O'Hara wrote: >>> On Thu, Aug 08, 2013 at 02:10:54PM +0200, Jesper Dangaard Brouer wrote: >>>> Some distros have not moved to libnl3 yet. Add a fallback option >>>> for compiling on distro's with only libnl1. >>>> >>>> Using pkg-config to detect what versions of libnl is available. >>>> >>>> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> >>> >>> This patch looks fine, but I think it only solves part of the >>> problem. The Makefile still contains following code: > > This, patch only address making libnl1 work again. > >>> ifneq (0,$(HAVE_NL)) >>> LIBS += -lnl >>> endif >>> >>> First, I think the HAVE_NL conditional can be removed. But more >>> importantly the correct netlink library should be appended to the >>> LIBS variable. With the current code we'll always link against >>> libnl-1. > > True. It seems to me that the libnl3 work have not been fully completed. > And the reason Simon send the "Allow override of CFLAGS", which allowed > him to compile with libnl3 via: > > make CFLAGS='-I/usr/include/libnl3' LIBS='-lnl-3 -lnl-genl-3 -lpopt' > >>> On Fedora with both libnl and libnl-3 installed: >>> >>> $ pkg-config --libs libnl-3.0 >>> -lnl-3 >>> $ pkg-config --libs libnl-1 >>> -lnl >>> >>> Ryan >> >> Daniel could you amend your patch or provide a second patch >> to use pkg-confog for LIBS too. It seems like a good idea to me. > > I think a second patch, to address libnl3 issues would be best. Agreed, will do that after yours got into the tree. >>>> --- >>>> libipvs/Makefile | 5 +++++ >>>> libipvs/libipvs.c | 5 +++++ >>>> 2 files changed, 10 insertions(+) >>>> >>>> diff --git a/libipvs/Makefile b/libipvs/Makefile >>>> index a527a7f..eafc3e5 100644 >>>> --- a/libipvs/Makefile >>>> +++ b/libipvs/Makefile >>>> @@ -10,6 +10,11 @@ INCLUDE += $(shell if [ -f ../../ip_vs.h ]; then \ >>>> echo "-I../../."; fi;) >>>> DEFINES = $(shell if [ ! -f ../../ip_vs.h ]; then \ >>>> echo "-DHAVE_NET_IP_VS_H"; fi;) >>>> +DEFINES += $(shell if which pkg-config > /dev/null 2>&1; then \ >>>> + if pkg-config --exists libnl-3.0; then :; \ >>>> + elif pkg-config --exists libnl-2.0; then :; \ >>>> + elif pkg-config --exists libnl-1; \ >>>> + then echo "-DFALLBACK_LIBNL1"; fi; fi) >>>> >>>> .PHONY = all clean install dist distclean rpm rpms >>>> STATIC_LIB = libipvs.a >>>> diff --git a/libipvs/libipvs.c b/libipvs/libipvs.c >>>> index c3c3b0a..2b066d2 100644 >>>> --- a/libipvs/libipvs.c >>>> +++ b/libipvs/libipvs.c >>>> @@ -32,6 +32,11 @@ static void* ipvs_func = NULL; >>>> struct ip_vs_getinfo ipvs_info; >>>> >>>> #ifdef LIBIPVS_USE_NL >>>> +#ifdef FALLBACK_LIBNL1 >>>> +#define nl_sock nl_handle >>>> +#define nl_socket_alloc nl_handle_alloc >>>> +#define nl_socket_free nl_handle_destroy >>>> +#endif >>>> static struct nl_sock *sock = NULL; >>>> static int family, try_nl = 1; >>>> #endif >>>> >>> > ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] ipvsadm: fix compiling tool on distros with only libnl-1 2013-08-09 6:55 ` Daniel Borkmann @ 2013-08-09 8:31 ` Simon Horman 0 siblings, 0 replies; 22+ messages in thread From: Simon Horman @ 2013-08-09 8:31 UTC (permalink / raw) To: Daniel Borkmann Cc: Jesper Dangaard Brouer, Ryan O'Hara, Jesper Dangaard Brouer, Wensong Zhang, Thomas Graf, Julian Anastasov, lvs-devel On Fri, Aug 09, 2013 at 08:55:52AM +0200, Daniel Borkmann wrote: > On 08/09/2013 08:43 AM, Jesper Dangaard Brouer wrote: > >On Fri, 9 Aug 2013 14:47:36 +0900 > >Simon Horman <horms@verge.net.au> wrote: > > > >>On Thu, Aug 08, 2013 at 03:00:17PM -0500, Ryan O'Hara wrote: > >>>On Thu, Aug 08, 2013 at 02:10:54PM +0200, Jesper Dangaard Brouer wrote: > >>>>Some distros have not moved to libnl3 yet. Add a fallback option > >>>>for compiling on distro's with only libnl1. > >>>> > >>>>Using pkg-config to detect what versions of libnl is available. > >>>> > >>>>Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> > >>> > >>>This patch looks fine, but I think it only solves part of the > >>>problem. The Makefile still contains following code: > > > >This, patch only address making libnl1 work again. > > > >>>ifneq (0,$(HAVE_NL)) > >>>LIBS += -lnl > >>>endif > >>> > >>>First, I think the HAVE_NL conditional can be removed. But more > >>>importantly the correct netlink library should be appended to the > >>>LIBS variable. With the current code we'll always link against > >>>libnl-1. > > > >True. It seems to me that the libnl3 work have not been fully completed. > >And the reason Simon send the "Allow override of CFLAGS", which allowed > >him to compile with libnl3 via: > > > > make CFLAGS='-I/usr/include/libnl3' LIBS='-lnl-3 -lnl-genl-3 -lpopt' > > > >>>On Fedora with both libnl and libnl-3 installed: > >>> > >>>$ pkg-config --libs libnl-3.0 > >>>-lnl-3 > >>>$ pkg-config --libs libnl-1 > >>>-lnl > >>> > >>>Ryan > >> > >>Daniel could you amend your patch or provide a second patch > >>to use pkg-confog for LIBS too. It seems like a good idea to me. > > > >I think a second patch, to address libnl3 issues would be best. > > Agreed, will do that after yours got into the tree. I have pushed the following. commit ca23ad37d5c7b1b393afa0f72461d81ee884e059 Author: Jesper Dangaard Brouer <brouer@redhat.com> Date: Fri Aug 9 08:27:14 2013 +0200 ipvsadm: fix compiling tool on distros with only libnl-1 Some distros have not moved to libnl3 yet. Add a fallback option for compiling on distro's with only libnl1. Using pkg-config to detect what versions of libnl is available. Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Acked-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Simon Horman <horms@verge.net.au> diff --git a/libipvs/Makefile b/libipvs/Makefile index a527a7f..eafc3e5 100644 --- a/libipvs/Makefile +++ b/libipvs/Makefile @@ -10,6 +10,11 @@ INCLUDE += $(shell if [ -f ../../ip_vs.h ]; then \ echo "-I../../."; fi;) DEFINES = $(shell if [ ! -f ../../ip_vs.h ]; then \ echo "-DHAVE_NET_IP_VS_H"; fi;) +DEFINES += $(shell if which pkg-config > /dev/null 2>&1; then \ + if pkg-config --exists libnl-3.0; then :; \ + elif pkg-config --exists libnl-2.0; then :; \ + elif pkg-config --exists libnl-1; \ + then echo "-DFALLBACK_LIBNL1"; fi; fi) .PHONY = all clean install dist distclean rpm rpms STATIC_LIB = libipvs.a diff --git a/libipvs/libipvs.c b/libipvs/libipvs.c index c3c3b0a..2b066d2 100644 --- a/libipvs/libipvs.c +++ b/libipvs/libipvs.c @@ -32,6 +32,11 @@ static void* ipvs_func = NULL; struct ip_vs_getinfo ipvs_info; #ifdef LIBIPVS_USE_NL +#ifdef FALLBACK_LIBNL1 +#define nl_sock nl_handle +#define nl_socket_alloc nl_handle_alloc +#define nl_socket_free nl_handle_destroy +#endif static struct nl_sock *sock = NULL; static int family, try_nl = 1; #endif ^ permalink raw reply related [flat|nested] 22+ messages in thread
end of thread, other threads:[~2013-08-09 8:32 UTC | newest] Thread overview: 22+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-08-08 4:59 [PATCH] Allow override of CFLAGS Simon Horman 2013-08-08 6:13 ` Julian Anastasov 2013-08-08 7:34 ` Simon Horman 2013-08-08 8:30 ` Julian Anastasov 2013-08-08 7:47 ` Daniel Borkmann 2013-08-08 8:19 ` ipvsadm git head not compiling on RHEL6 Jesper Dangaard Brouer 2013-08-08 8:27 ` Daniel Borkmann 2013-08-08 9:00 ` Simon Horman 2013-08-08 9:17 ` Jesper Dangaard Brouer 2013-08-08 9:23 ` Daniel Borkmann 2013-08-08 9:33 ` Thomas Graf 2013-08-08 9:00 ` [PATCH] Allow override of CFLAGS Simon Horman 2013-08-08 9:05 ` Daniel Borkmann 2013-08-08 12:10 ` [PATCH] ipvsadm: fix compiling tool on distros with only libnl-1 Jesper Dangaard Brouer 2013-08-08 12:23 ` Daniel Borkmann 2013-08-08 20:00 ` Ryan O'Hara 2013-08-09 5:47 ` Simon Horman 2013-08-09 6:27 ` [PATCH v2] " Jesper Dangaard Brouer 2013-08-09 8:32 ` Simon Horman 2013-08-09 6:43 ` [PATCH] " Jesper Dangaard Brouer 2013-08-09 6:55 ` Daniel Borkmann 2013-08-09 8:31 ` Simon Horman
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.