LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

FIXED (Re: ipvsadm version mismatch in debian)

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: FIXED (Re: ipvsadm version mismatch in debian)
Cc: Joerg Wendland <joergland@xxxxxxxxxx>
Cc: Horms <horms@xxxxxxxxxxxx>
From: Roberto Nibali <ratz@xxxxxxxxxxxx>
Date: Tue, 19 Oct 2004 15:44:56 +0200
Hi,

Yes, I agree. Something like this in conjunction with a diversion
(debian packaging speak for different packages can provide the same
binary) should work well. I have CCed the maintainer for his
consideration.

I have fixed the user space compilation of ipvsadm. See the inlined patch which should get applied to Debian package as well. Actually Wensong should integrate it into the stable release.

After I had identified the problem I searched the gcc man page and found the following switch which indeed fixes the problem:

 -m64
     Generate code for a 32-bit or 64-bit environment.  The 32-bit envi-
     ronment sets int, long and pointer to 32 bits.  The 64-bit environ-
     ment sets int to 32 bits and long and pointer to 64 bits.

So the following patch addresses this 4Byte/8Byte issue:

diff -ur ipvsadm-1.21/Makefile ipvsadm-1.21-sparc64/Makefile
--- ipvsadm-1.21/Makefile       2004-01-10 10:38:07.000000000 +0100
+++ ipvsadm-1.21-sparc64/Makefile       2004-10-19 15:25:04.000000000 +0200
@@ -29,9 +29,14 @@
 RELEASE        = 9
 SCHEDULERS = "$(shell cat SCHEDULERS)"
 PROGROOT = $(shell basename `pwd`)
+ARCH   := $(shell uname -m)

 CC     = gcc
-CFLAGS = -Wall -Wunused -Wstrict-prototypes -g -O2
+ifeq "${ARCH}" "sparc64"
+ CFLAGS = -Wall -Wunused -Wstrict-prototypes -g -O2 -m64 -pipe -mcpu=ultrasparc -mcmodel=medlow
+else
+    CFLAGS = -Wall -Wunused -Wstrict-prototypes -g -O2
+endif
 SBIN    = $(BUILD_ROOT)/sbin
 MANDIR = usr/man
 MAN    = $(BUILD_ROOT)/$(MANDIR)/man8

I wonder if we need the following flags as well:

   -mcmodel
   -march
   -mcpu

I'll wonder if alpha needs this as well? I'm sure s390 will need this. I'll do some more testing now but it looks rather good. Interesting would also be to experiment with the sparc64(8) command.

Best regards,
Roberto Nibali, ratz

ps.: make distclean is kind of broken in regard it removing the
     spec file.
--
echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq' | dc
<Prev in Thread] Current Thread [Next in Thread>