lis  

patch for LiS 2.19.0

Paul Landay
Sun, 04 Mar 2007 09:05:34 -0800

Attached is a patch for LiS 2.19.0.
It includes changes for building on SLES10 (2.6.16) kernels,
checks for root authority when builing, clean-up for uninstall,
more ifdefs for 64bit platforms.

Paul Landay
diff -Naur LiS-2.19-orig/Configure LiS-2.19-patch01/Configure
--- LiS-2.19-orig/Configure     2006-06-16 14:38:55.000000000 -0400
+++ LiS-2.19-patch01/Configure  2007-01-22 05:14:06.000000000 -0500
@@ -492,8 +492,8 @@
 {
     if [ -f $KSRC/include/linux/config.h ]; then
        cc -D__KERNGLUE__ -I$KSRC/include -E -dM \
-               -include $KSRC/include/linux/config.h dummy.c >kconfig
-       x=`grep $1 kconfig 2>&1`
+               -include $KSRC/include/linux/config.h dummy.c > /tmp/kconfig
+       x=`grep $1 /tmp/kconfig 2>&1`
        if [ $? -eq 0 ]; then                   # found it
            if expr "$x" : "#define" >/dev/null 2>/dev/null; then
                echo -n "y"                     # option selected
@@ -627,8 +627,8 @@
 get_vers_h()
 {
     if [ -f $1 ]; then
-       cc -D__KERNGLUE__ -I$KSRC/include -E -dM -include $1 dummy.c > kver
-       KVER_H=`grep UTS_RELEASE kver | \
+       cc -D__KERNGLUE__ -I$KSRC/include -E -dM -include $1 dummy.c > /tmp/kver
+       KVER_H=`grep UTS_RELEASE /tmp/kver | \
             sed -e 's/^.*UTS_RELEASE.//' -e's/"//g' -e's/  *$//'`
        NKVER_H=`echo $KVER_H | sed -e 's/-.*//'`
     fi
@@ -1665,6 +1665,15 @@
     do_read_choice
     MOD_INSTALL=$RESULT
 
+    if [ "$MOD_INSTALL" = "y" ]; then
+        if [ `whoami` != "root" ]; then
+            echo
+            echo "You must be root in order to install kernel modules."
+            echo
+            exit 1
+        fi
+    fi
+
     #
     # MOD_INST_DIR
     #
diff -Naur LiS-2.19-orig/Makefile LiS-2.19-patch01/Makefile
--- LiS-2.19-orig/Makefile      2006-05-18 13:06:04.000000000 -0400
+++ LiS-2.19-patch01/Makefile   2007-01-22 05:14:06.000000000 -0500
@@ -39,6 +39,8 @@
 # a target named as a dependent of another is defined further down in
 # this file.
 
+WHOAMI=$(shell whoami)
+
 ifeq ($(wildcard .config_mk),)
 #
 # not configured - force 'make configure', which recursively does 'make all'
@@ -114,6 +116,7 @@
 # You may have to be root to do these targets
 #
 ifeq ($(LIS_TARG),linux)
+ifeq ($(WHOAMI),root)
 
 ifneq ($(wildcard .config_mk),)
 install: modules_install $(filter-out modules_install,$(ALL_TARGETS))
@@ -303,6 +306,9 @@
        -$(Q) (cd $(MOD_INST_DIR); rm -f streams.ko streams-*.ko)
 endif
 endif  # .config_mk
+else   # WHOAMI
+       $(Q)echo "Must be root to run that make target"
+endif  # WHOAMI
        $(nothing)
 
 else
@@ -583,6 +589,9 @@
        $(nothing)
 
 clean: FORCE
+ifneq ($(WHOAMI),root)
+       -$(Q)echo "Must be root to run this LiS make target"
+else
 ifeq ($(ARCH),s390x)
        -$(Q)$(MAKE) -C $(LIBOBJ32OVER64) $@
 endif
@@ -603,6 +612,7 @@
        -$(Q)rm -f streams.o Config.master .modules
        -$(Q)rm -f $(CONFMOD).incl $(CONFMOD).streams $(CONFMOD).save
 endif  # .config_mk
+endif  # WHOAMI
        $(nothing)
 
 dep: FORCE
diff -Naur LiS-2.19-orig/config.mk LiS-2.19-patch01/config.mk
--- LiS-2.19-orig/config.mk     2006-06-16 12:57:48.000000000 -0400
+++ LiS-2.19-patch01/config.mk  2007-01-22 05:14:06.000000000 -0500
@@ -150,8 +150,14 @@
 # Added -D__KERNGLUE__ to keep RHEL4 happy
 XOPTS = -Wall -Wstrict-prototypes $(PROBLEMS) -D__KERNGLUE__
 XOPTS+= -fno-strict-aliasing -Wno-sign-compare -fno-common
-XOPTS+= $(KBUILD_STR)
-XOPTS+= -D"KBUILD_BASENAME=KBUILD_STR(streams)"
+# Added -D"KBUILD_BASENAME=" to keep SLES10 happy
+ifeq ($(KVER_MAJORMINOR),2.6) 
+  ifeq ($(KVER_PATCHNO),16)
+    XOPTS += -D"KBUILD_BASENAME=" 
+  endif
+endif
+#XOPTS+= $(KBUILD_STR)
+#XOPTS+= -D"KBUILD_BASENAME=KBUILD_STR(streams)"
 
 #
 # Compiler options for debugging and optimization.
diff -Naur LiS-2.19-orig/drivers/str/linux/Makefile 
LiS-2.19-patch01/drivers/str/linux/Makefile
--- LiS-2.19-orig/drivers/str/linux/Makefile    2006-05-18 13:06:05.000000000 
-0400
+++ LiS-2.19-patch01/drivers/str/linux/Makefile 2007-01-22 05:14:06.000000000 
-0500
@@ -55,6 +55,10 @@
 ifeq ($(ARCH),s390x)
 TOBJS := connld mtdrv
 endif
+ifeq ($(ARCH),ppc64)
+# ldl fails to build on SLES10-ppc64
+TOBJS := connld mtdrv
+endif
 
 # Similar to TOBJS, but non-streams modules
 ZOBJS := 
diff -Naur LiS-2.19-orig/head/head.c LiS-2.19-patch01/head/head.c
--- LiS-2.19-orig/head/head.c   2006-06-19 11:56:10.000000000 -0400
+++ LiS-2.19-patch01/head/head.c        2007-01-22 05:14:06.000000000 -0500
@@ -5624,8 +5624,6 @@
 
 #define        RTN(val)  do { err = val; goto return_point; } while (0)
 
-    CHECK_INO(i,"lis_strputmsg"); /* may return */
-
     hd = FILE_STR(fp) ;
     if (hd == NULL)
        return(-ENODEV);
@@ -5886,8 +5884,6 @@
 
 #define RTN(v) do { err=(v); goto err_return_point; } while (0)
 
-    CHECK_INO(i,"lis_strgetmsg"); /* may return */
-
     hd = FILE_STR(fp) ;
     if (hd == NULL)
        return(-ENODEV);
@@ -6339,8 +6335,6 @@
 
 #define RTN(v) do { err=(v); goto return_point; } while (0)
 
-    CHECK_INO(i,"lis_strioctl"); /* may return */
-
     if (LIS_DEBUG_IOCTL && LIS_DEBUG_ADDRS)
        printk("lis_strioctl([EMAIL PROTECTED]/%d,[EMAIL 
PROTECTED]/%d,cmd=0x%x,arg=0x%lx)"
               " << i_rdev=0x%x\n",
diff -Naur LiS-2.19-orig/head/linux/exports.c 
LiS-2.19-patch01/head/linux/exports.c
--- LiS-2.19-orig/head/linux/exports.c  2006-05-18 13:06:06.000000000 -0400
+++ LiS-2.19-patch01/head/linux/exports.c       2007-01-22 05:14:06.000000000 
-0500
@@ -44,6 +44,10 @@
 #define __NO_VERSION__ 1       /* 2.2 kernel needs this */
 #include <linux/module.h>
 
+#ifndef EXPORT_SYMBOL_NOVERS
+/* This was finally ripped out of the Linux Kernel in 2.6.11 */
+#define EXPORT_SYMBOL_NOVERS(sym) EXPORT_SYMBOL(sym)
+#endif
 
 #include <sys/stream.h>
 #include <sys/poll.h>
@@ -241,15 +245,19 @@
 EXPORT_SYMBOL_NOVERS(lis_osif_pci_dac_set_dma_mask);
 #endif
 EXPORT_SYMBOL_NOVERS(lis_osif_pci_dac_dma_supported);
+#if (!defined(_PPC64_LIS_))
+/* PPC64 has CONFIG_PCI, but no pci_dac_dma symbols */
 EXPORT_SYMBOL_NOVERS(lis_osif_pci_dac_page_to_dma);
 EXPORT_SYMBOL_NOVERS(lis_osif_pci_dac_dma_to_page);
 EXPORT_SYMBOL_NOVERS(lis_osif_pci_dac_dma_to_offset);
 EXPORT_SYMBOL_NOVERS(lis_osif_pci_dac_dma_sync_single);
+#endif /* not _PPC64_LIS_ */
 #endif                                  /* 2.4.13 */
 #endif /* CONFIG_PCI */
 
 EXPORT_SYMBOL_NOVERS(lis_osif_sti);
 EXPORT_SYMBOL_NOVERS(lis_own_spl);
+#if (!defined(_S390_LIS_) && !defined(_S390X_LIS_) && !defined(_PPC64_LIS_) && 
!defined(_X86_64_LIS_))
 EXPORT_SYMBOL_NOVERS(lis_pcibios_present);
 
 #if ((LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) && defined(CONFIG_PCI))
@@ -288,6 +296,7 @@
 EXPORT_SYMBOL_NOVERS(lis_pci_write_config_byte);
 EXPORT_SYMBOL_NOVERS(lis_pci_write_config_dword);
 EXPORT_SYMBOL_NOVERS(lis_pci_write_config_word);
+#endif          /* S390 or S390X or PPC64 or X86_64 */
 EXPORT_SYMBOL_NOVERS(lis_phys_to_virt);
 EXPORT_SYMBOL_NOVERS(lis_print_block);
 EXPORT_SYMBOL_NOVERS(lis_print_data);
diff -Naur LiS-2.19-orig/head/linux-mdep.c LiS-2.19-patch01/head/linux-mdep.c
--- LiS-2.19-orig/head/linux-mdep.c     2006-06-16 12:57:49.000000000 -0400
+++ LiS-2.19-patch01/head/linux-mdep.c  2007-01-22 05:14:06.000000000 -0500
@@ -205,11 +205,13 @@
 
 #if (defined(_S390X_LIS_) || defined(_PPC64_LIS_) || defined(_X86_64_LIS_))
 extern long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,13)
 extern int register_ioctl32_conversion(unsigned int fd, 
                                        int (*handler)(unsigned int fd,
                                                       unsigned int cmd,
                                                       unsigned long arg));
 extern int unregister_ioctl32_conversion(unsigned int cmd);
+#endif
 typedef struct strioctl32 {
     int     ic_cmd;                 /* command */
     int     ic_timout;              /* timeout value */
@@ -331,6 +333,11 @@
 #if defined(KERNEL_2_5)
 int lis_strflush(struct file *f);
 #endif
+#if (defined(_S390X_LIS_) || defined(_PPC64_LIS_) || defined(_X86_64_LIS_))
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13)
+long lis_compat_ioctl(struct file *fp, unsigned int cmd, unsigned long arg);
+#endif
+#endif
 
 /*
  * File operations
@@ -342,6 +349,11 @@
     write:     lis_strwrite,           /* write                */
     poll:      lis_poll_2_1,           /* poll                 */
     ioctl:     lis_strioctl,           /* ioctl                */
+#if (defined(_S390X_LIS_) || defined(_PPC64_LIS_) || defined(_X86_64_LIS_))
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13)
+    compat_ioctl: lis_compat_ioctl,    /* 32 over 64 bit ioctl */
+#endif
+#endif
     open:      lis_stropen,            /* open                 */
 #if defined(KERNEL_2_5)
     flush:     lis_strflush,           /* flush                */
@@ -3580,15 +3592,35 @@
 #endif
 }
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
 /************************************************************************
-*                         Kernel Semaphores                             *
+*                         Kernel Mutex                                  *
 *************************************************************************
 *                                                                      *
-* These routines are used with doing a down/up on a kernel semaphore.  *
-* lis_down/up are used for LiS type semaphores.  Kernel semaphores     *
+* These routines are used with doing a down/up on a kernel mutex.      *
+* lis_down/up are used for LiS type semaphores.  Kernel mutexes        *
 * occur in kernel structures, such as inodes.                          *
 *                                                                      *
 ************************************************************************/
+int _RP lis_kernel_down(struct mutex *mut)
+{
+    mutex_lock(mut); return(0);
+}
+
+void _RP lis_kernel_up(struct mutex *mut)
+{
+    mutex_unlock(mut) ;
+}
+#else
+/************************************************************************
+*                         Kernel Semaphores                             *
+*************************************************************************
+*                                                                       *
+* These routines are used with doing a down/up on a kernel semaphore.   *
+* lis_down/up are used for LiS type semaphores.  Kernel semaphores      *
+* occur in kernel structures, such as inodes.                           *
+*                                                                       *
+************************************************************************/
 int _RP lis_kernel_down(struct semaphore *sem)
 {
     return(down_interruptible(sem)) ;
@@ -3598,6 +3630,7 @@
 {
     up(sem) ;
 }
+#endif
 
 /************************************************************************
 *                         User Space Access                             *
@@ -3621,10 +3654,14 @@
 int lis_check_umem(struct file *fp, int rd_wr_fcn,
                   const void *usr_addr, int lgth)
 {
-    if (!access_ok(rd_wr_fcn,usr_addr,lgth)) 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)
+    return(verify_area(rd_wr_fcn,usr_addr,lgth)) ;
+#else
+    if (1-access_ok(rd_wr_fcn,usr_addr,lgth)) 
        return(-EFAULT);
     else
        return(0);
+#endif
 }
 
 /************************************************************************
@@ -3665,9 +3702,40 @@
 #endif
 }
 
+#if (defined(_S390X_LIS_) || defined(_PPC64_LIS_) || defined(_X86_64_LIS_))
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13)
+long lis_compat_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)
+{
+  switch (cmd)
+  {
+  case I_SETSIG:
+  case I_SRDOPT:
+  case I_PUSH:
+  case I_LINK:
+  case I_UNLINK:
+  case I_LIS_GETMSG:
+  case I_LIS_PUTMSG:
+    return lis_strioctl(NULL, fp, cmd, arg);
+    break;
+
+  case I_STR:
+    return lis_ioctl32_str(fp, cmd, arg);
+    break;
+
+  default:
+    printk("Invalid 32 bit over 64 bit ioctl 0x%2.2x\n", cmd);
+    break;
+  }
+}
+#endif
+#endif
 
 #if (defined(_S390X_LIS_) || defined(_PPC64_LIS_) || defined(_X86_64_LIS_))
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13)
+int lis_ioctl32_str (struct file * fp, unsigned int cmd, unsigned long arg)
+#else
 int lis_ioctl32_str (unsigned int fd, unsigned int cmd, unsigned long arg)
+#endif
 {
   strioctl_t par64;
   strioctl32_t par32;
@@ -3714,7 +3782,11 @@
   }
   old_fs = get_fs();
   set_fs(KERNEL_DS);
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13)
+  rc = lis_strioctl(NULL, fp, cmd, (unsigned long)&par64);
+#else
   rc = sys_ioctl(fd,cmd,(unsigned long)&par64);
+#endif
   set_fs(old_fs);
  
   if (copy_to_user((void*)&(ptr32->ic_cmd),(void*)&(par64.ic_cmd),sizeof(int)))
@@ -3820,14 +3892,18 @@
     lis_start_qsched() ;               /* ensure q running process going */
 
 #if (defined(_S390X_LIS_) || defined(_PPC64_LIS_) || defined(_X86_64_LIS_))
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,13)
     register_ioctl32_conversion(I_SETSIG,sys_ioctl);
     register_ioctl32_conversion(I_SRDOPT,sys_ioctl);
     register_ioctl32_conversion(I_PUSH,sys_ioctl);
     register_ioctl32_conversion(I_LINK,sys_ioctl);
     register_ioctl32_conversion(I_UNLINK,sys_ioctl);
+    register_ioctl32_conversion(I_LIS_GETMSG,sys_ioctl);
+    register_ioctl32_conversion(I_LIS_PUTMSG,sys_ioctl);
  
     register_ioctl32_conversion(I_STR,lis_ioctl32_str);
 #endif
+#endif
 
     printk(
        "Linux STREAMS Subsystem ready.\n"
@@ -3930,15 +4006,19 @@
     lis_terminate_final() ;            /* LiS internal memory */
     lis_mem_terminate() ;              /* LiS use of slab allocator */
 
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,13)
 #if (defined(_S390X_LIS_) || defined(_PPC64_LIS_) || defined(_X86_64_LIS_))
     unregister_ioctl32_conversion(I_SETSIG);
     unregister_ioctl32_conversion(I_SRDOPT);
     unregister_ioctl32_conversion(I_PUSH);
     unregister_ioctl32_conversion(I_LINK);
     unregister_ioctl32_conversion(I_UNLINK);
+    unregister_ioctl32_conversion(I_LIS_GETMSG);
+    unregister_ioctl32_conversion(I_LIS_PUTMSG);
  
     unregister_ioctl32_conversion(I_STR);
 #endif
+#endif
 
     printk ("Linux STREAMS Subsystem removed\n");
 }
diff -Naur LiS-2.19-orig/head/osif.c LiS-2.19-patch01/head/osif.c
--- LiS-2.19-orig/head/osif.c   2006-05-18 13:06:05.000000000 -0400
+++ LiS-2.19-patch01/head/osif.c        2007-01-22 05:14:06.000000000 -0500
@@ -454,6 +454,7 @@
 }
 
 
+#if (!defined(_PPC64_LIS_))
 dma64_addr_t  _RP lis_osif_pci_dac_page_to_dma(struct pci_dev *pdev,
                        struct page *page, unsigned long offset,
                        int direction)
@@ -491,6 +492,7 @@
     pci_dac_dma_sync_single(pdev, dma_addr, len, direction) ;
 #endif
 }
+#endif         /* not _PPC64_LIS_ */
 #endif                                  /* 2.4.13 */
 
 #endif          /* CONFIG_PCI */
diff -Naur LiS-2.19-orig/include/sys/LiS/linux-mdep.h 
LiS-2.19-patch01/include/sys/LiS/linux-mdep.h
--- LiS-2.19-orig/include/sys/LiS/linux-mdep.h  2006-05-18 13:06:07.000000000 
-0400
+++ LiS-2.19-patch01/include/sys/LiS/linux-mdep.h       2007-01-22 
05:14:06.000000000 -0500
@@ -141,7 +141,9 @@
 #include <linux/mm.h>          /* memory manager, pages,... */
 #include <linux/slab.h>                /* memory manager, pages,... */
 #include <linux/stat.h>                /* S_ISCHR */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
 #include <asm/segment.h>       /* memcpy_{to,from}_fs */
+#endif
 #include <asm/system.h>                /* sti,cli */
 #include <linux/errno.h>             /* for errno */
 #include <linux/signal.h>            /* for signal numbers */
@@ -354,6 +356,15 @@
 void lis_gettimeofday(struct timeval *tv)_RP;
 
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
+/* lock inodes...
+ *
+ * Must use kernel mutex routine directly since the inode mutex is a
+ * kernel mutex and not an LiS semaphore.
+ */
+int lis_kernel_down(struct mutex *mut)_RP;
+void lis_kernel_up(struct mutex *mut)_RP;
+#else
 /* lock inodes...
  *
  * Must use kernel semaphore routine directly since the inode semaphore is a
@@ -361,6 +372,7 @@
  */
 int lis_kernel_down(struct semaphore *sem)_RP;
 void lis_kernel_up(struct semaphore *sem)_RP;
+#endif
 
 #if 0                  /* don't need to hold inode semaphore for I/O oprns */
 #define        LOCK_INO(i)     lis_kernel_down(&((i)->i_sem))
diff -Naur LiS-2.19-orig/include/sys/osif.h LiS-2.19-patch01/include/sys/osif.h
--- LiS-2.19-orig/include/sys/osif.h    2006-05-18 13:06:07.000000000 -0400
+++ LiS-2.19-patch01/include/sys/osif.h 2007-01-22 05:14:06.000000000 -0500
@@ -355,6 +355,7 @@
 #define pci_dac_dma_supported lis_osif_pci_dac_dma_supported
 extern int lis_osif_pci_dac_dma_supported(struct pci_dev *hwdev, u64 mask)_RP;
 
+#if (!defined(_PPC64_LIS_))
 #ifdef pci_dac_page_to_dma
 #undef pci_dac_page_to_dma
 #endif
@@ -383,6 +384,7 @@
 #define pci_dac_dma_sync_single lis_osif_pci_dac_dma_sync_single
 extern void lis_osif_pci_dac_dma_sync_single(struct pci_dev *pdev,
                    dma64_addr_t dma_addr, size_t len, int direction)_RP;
+#endif /* not _PPC64_LIS_ */
 #endif /* >= 2.4.13 */
 
 #endif /* CONFIG_PCI */
diff -Naur LiS-2.19-orig/libc/getpmsg.c LiS-2.19-patch01/libc/getpmsg.c
--- LiS-2.19-orig/libc/getpmsg.c        2006-05-18 13:06:08.000000000 -0400
+++ LiS-2.19-patch01/libc/getpmsg.c     2007-01-22 05:14:06.000000000 -0500
@@ -13,6 +13,7 @@
 typedef struct getpmsg_args6
 {
     int                  fd ;
+    int                  pad;
     unsigned long long   ctl ;
     unsigned long long   dat ;
     unsigned long long   bandp ;
diff -Naur LiS-2.19-orig/libc/mk.bdy LiS-2.19-patch01/libc/mk.bdy
--- LiS-2.19-orig/libc/mk.bdy   2006-05-18 13:06:08.000000000 -0400
+++ LiS-2.19-patch01/libc/mk.bdy        2007-01-22 05:14:58.000000000 -0500
@@ -119,7 +119,30 @@
            cat > $(DESTDIR)$(pkgdatadir)/$(relpwd)/.compiler
 
 uninstall:
-       $(nothing)
+ifeq ($(ARCH),s390x)
+       -$(Q)rm -f $(DEST_LIB64DIR)/$(LIBFILE_SHARED)
+       -$(Q)rm -f $(DEST_LIB64DIR)/$(LIBFILE_PSHARED)
+       -$(Q)rm -f $(DEST_LIB64DIR)/$(LIBFILE_STATIC)
+else
+ifeq ($(ARCH),ppc64)
+       -$(Q)rm -f $(DEST_LIB64DIR)/$(LIBFILE_SHARED)
+       -$(Q)rm -f $(DEST_LIB64DIR)/$(LIBFILE_PSHARED)
+       -$(Q)rm -f $(DEST_LIB64DIR)/$(LIBFILE_STATIC)
+else
+ifeq ($(ARCH),x86_64)
+       -$(Q)rm -f $(DEST_LIB64DIR)/$(LIBFILE_SHARED)
+       -$(Q)rm -f $(DEST_LIB64DIR)/$(LIBFILE_PSHARED)
+       -$(Q)rm -f $(DEST_LIB64DIR)/$(LIBFILE_STATIC)
+else
+       -$(Q)rm -f $(DEST_LIBDIR)/$(LIBFILE_SHARED)
+       -$(Q)rm -f $(DEST_LIBDIR)/$(LIBFILE_PSHARED)
+       -$(Q)rm -f $(DEST_LIBDIR)/$(LIBFILE_STATIC)
+endif
+endif
+endif
+ifeq ($(DESTDIR),)
+       $(Q)ldconfig
+endif
 
 
 # the following relates to the Q_CC variable, which may be set to .compiler if
diff -Naur LiS-2.19-orig/libc/putpmsg.c LiS-2.19-patch01/libc/putpmsg.c
--- LiS-2.19-orig/libc/putpmsg.c        2006-05-18 13:06:08.000000000 -0400
+++ LiS-2.19-patch01/libc/putpmsg.c     2007-01-22 05:14:06.000000000 -0500
@@ -13,6 +13,7 @@
 typedef struct putpmsg_args6
 {
     int                  fd ;
+    int                  pad;
     unsigned long long   ctl ;
     unsigned long long   dat ;
     int                  band ;
@@ -52,7 +53,7 @@
     args.band  = band ;
     args.flags = flags ;
 
-    return(ioctl(fd, I_LIS_PUTMSG, &args);
+    return(ioctl(fd, I_LIS_PUTMSG, &args));
 }
 #else
 int    putpmsg(int fd, strbuf_t *ctlptr, strbuf_t *dataptr,
diff -Naur LiS-2.19-orig/libc32over64/mk.bdy 
LiS-2.19-patch01/libc32over64/mk.bdy
--- LiS-2.19-orig/libc32over64/mk.bdy   2006-05-18 13:06:08.000000000 -0400
+++ LiS-2.19-patch01/libc32over64/mk.bdy        2007-01-22 05:14:58.000000000 
-0500
@@ -21,7 +21,7 @@
 LIB_STATIC = $(LIBDIR32OVER64)/$(LIBFILE_STATIC)
 
 ifeq ($(ARCH),s390x)
-CC += -c $(XOPTS)
+CC += -c $(XOPTS) -fPIC
 endif
 ifeq ($(ARCH),ppc64)
 CC += -c $(XOPTS) -fPIC -m32 -msoft-float -pipe -ffixed-r2 -mmultiple -mstring
@@ -85,5 +85,9 @@
 endif
 
 uninstall:
-       $(nothing)
-
+       -$(Q)rm -f $(DEST_LIBDIR)/$(LIBFILE_SHARED)
+       -$(Q)rm -f $(DEST_LIBDIR)/$(LIBFILE_PSHARED)
+       -$(Q)rm -f $(DEST_LIBDIR)/$(LIBFILE_STATIC)
+ifeq ($(DESTDIR),)
+       $(Q)ldconfig
+endif
diff -Naur LiS-2.19-orig/modules/.config LiS-2.19-patch01/modules/.config
--- LiS-2.19-orig/modules/.config       2006-05-18 13:06:09.000000000 -0400
+++ LiS-2.19-patch01/modules/.config    2007-01-22 05:14:06.000000000 -0500
@@ -28,6 +28,9 @@
 export cmd if_changed if_changed_dep
 
 CONFIG_SHELL = /bin/sh
+ifeq ($(ARCH),s390x)
+CONFIG_64BIT := YES
+endif
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
                                   -e s/arm.*/arm/ -e s/sa110/arm/ \
                                   -e s/s390x/s390/ -e s/parisc64/parisc/ )
@@ -42,4 +45,7 @@
 c_flags += $(CPPFLAGS) $(CFLAGS) -I$(KSRC)/include
 
 LDFLAGS_MODULE  = -r
+ifeq ($(ARCH),ppc64)
+LDFLAGS_MODULE  += -m elf64ppc
+endif
 
diff -Naur LiS-2.19-orig/modules/Makefile.2.6 
LiS-2.19-patch01/modules/Makefile.2.6
--- LiS-2.19-orig/modules/Makefile.2.6  2006-06-16 12:57:49.000000000 -0400
+++ LiS-2.19-patch01/modules/Makefile.2.6       2007-01-22 05:14:06.000000000 
-0500
@@ -51,6 +51,9 @@
 $(shell if [ -f $(KSRC)/scripts/basic/fixdep ] \; then cp -f 
$(KSRC)/scripts/basic/fixdep scripts/basic \; fi)
 $(shell chmod a+x $(MODVERDIR)/scripts/gcc-version.sh)
 $(shell cp $(KSRC)/scripts/Makefile.lib scripts)
+ifneq ($(wildcard $(KSRC)/scripts/Kbuild.include),)
+$(shell cp $(KSRC)/scripts/Kbuild.include scripts)
+endif
 $(shell if [ -f $(KBIN)/scripts/modpost ] \; then cp -f 
$(KBIN)/scripts/modpost scripts/mod \; fi)
 $(shell if [ -f $(KBIN)/scripts/mod/modpost ] \; then cp -f 
$(KBIN)/scripts/mod/modpost scripts/mod \; fi)
 $(shell if [ -f $(KSRC)/scripts/modpost ] \; then cp -f 
$(KSRC)/scripts/modpost scripts/mod \; fi)
diff -Naur LiS-2.19-orig/modules/Makefile.modpost 
LiS-2.19-patch01/modules/Makefile.modpost
--- LiS-2.19-orig/modules/Makefile.modpost      2006-06-16 12:57:49.000000000 
-0400
+++ LiS-2.19-patch01/modules/Makefile.modpost   2007-01-22 05:14:06.000000000 
-0500
@@ -40,6 +40,9 @@
 depfile = ".nodep"
 
 include .config
+ifneq ($(wildcard scripts/Kbuild.include),)
+include scripts/Kbuild.include
+endif
 include scripts/Makefile.lib
 
 symverfile := $(objtree)/Module.symvers



  • patch for LiS 2.19.0 Paul Landay