> 
> Needed pfil 2.1.11 to compile in 64-bit mode for Sun Fire X2100M2 (AMD 64) so 
> applied the following changes (under Solaris 10 x86 6/06 system base)
> in order to generate a successful compilation.
> 
> Buyer beware; the resultant code is yet to be tested, and I only used 
> gcc 4.1.1; the Sun C compiler flags were guesses; somebody should confirm 
> them.
> 
> I see similar amd64 tweaks in the ip_filter code already but.
> 
> Ian D

 ...

Newer version of this patch below which corrects the package building part,
and the other patches I used for pfil 2.1.11 and ipfilter 4.1.16.

I've done some basic testing of this pfil on Sun Fire X2100 M2 (amd64) 
in 64-bit mode; seems ok.
Also tested on Sun Fire V100 (sparc 64-bit).  Needs more testing but.

(also built mine with Darren's NAT patch of 24 Dec).  

Ian D
--
*** Makefile.dist       Tue Dec 26 02:37:36 2006
--- Makefile    Tue Jan 16 01:17:29 2007
***************
*** 20,31 ****
  #
  SOLARIS="`uname -r | sed -e 's/[0-9]*\.\([0-9]*\).*/\1/'`"
  SFLAGS=-I.. -I. -D_KERNEL -DSUNDDI -DSOLARIS2=${SOLARIS} $(PFILDEBUG)
! SBITS:sh=optisa sparcv9 >/dev/null 2>&1; if [ "$?" -eq 0 ] ; then echo "64"; 
else echo "32"; fi
  MIOCPULLUP:sh=/usr/ccs/bin/nm -p /dev/ksyms|/usr/xpg4/bin/grep -q miocpullup; 
if [ "$?" -ne 0 ] ; then echo -DNEED_MIOCPULLUP; fi
! # For Sun's C compiler in /opt/SUNWSpro cc:
! S64FLAGS=-xildoff -xarch=v9 -xchip=ultra -dalign -xcode=abs32 
-DDO=pfil${SBITS}
! # For GCC
  #S64FLAGS=-m64 -mcmodel=medlow -DDO=pfil${SBITS}
  #
  TMP=/tmp
  PKG=pfil
--- 20,40 ----
  #
  SOLARIS="`uname -r | sed -e 's/[0-9]*\.\([0-9]*\).*/\1/'`"
  SFLAGS=-I.. -I. -D_KERNEL -DSUNDDI -DSOLARIS2=${SOLARIS} $(PFILDEBUG)
! SBITS:sh=optisa sparcv9 >/dev/null 2>&1; if [ "$?" -eq 0 ] ; then echo "64"; 
else optisa amd64 >/dev/null 2>&1; if [ "$?" -eq 0 ] ; then echo "64"; else 
echo "32"; fi; fi
! KTYPE:sh=optisa sparcv9 >/dev/null 2>&1; if [ "$?" -eq 0 ] ; then echo 
"sparcv9"; else optisa amd64 >/dev/null 2>&1; if [ "$?" -eq 0 ] ; then echo 
"amd64"; else echo "32-bit"; fi; fi
  MIOCPULLUP:sh=/usr/ccs/bin/nm -p /dev/ksyms|/usr/xpg4/bin/grep -q miocpullup; 
if [ "$?" -ne 0 ] ; then echo -DNEED_MIOCPULLUP; fi
! 
! #
! # see http://docs.sun.com/app/docs/doc/817-5789/6ml7kh1b3?a=view
! #
! # For Sun's C compiler in /opt/SUNWSpro cc on sparcv9:
! #S64FLAGS=-xildoff -xarch=v9 -xchip=ultra -dalign -xcode=abs32 
-DDO=pfil${SBITS}
! # For Sun's C compiler in /opt/SUNWSpro cc on amd64:
! #S64FLAGS=-Xa -xildoff -xarch=amd64 -xcode=abs32 -DDO=pfil${SBITS}
! # For GCC on sparcv9
  #S64FLAGS=-m64 -mcmodel=medlow -DDO=pfil${SBITS}
+ # For GCC on amd64
+ S64FLAGS=-m64 -mcmodel=kernel -mno-red-zone -ffreestanding -DDO=pfil${SBITS}
  #
  TMP=/tmp
  PKG=pfil
***************
*** 47,53 ****
  SunOS32: SunOS/Makefile
        (cd SunOS; make pfil "BITS=32" OS=solaris DO=pfil "ADEF=${SFLAGS}")
  
! SunOS64 sparc64 sunos64: SunOS/Makefile
        (cd SunOS; make pfil "BITS=32" OS=solaris DO=pfil "ADEF=${SFLAGS}")
        /bin/rm -f SunOS/*.o
        (cd SunOS; make pfil${SBITS} "BITS=64" OS=solaris DO=pfil64 
"ADEF=${SFLAGS} ${S64FLAGS}")
--- 56,62 ----
  SunOS32: SunOS/Makefile
        (cd SunOS; make pfil "BITS=32" OS=solaris DO=pfil "ADEF=${SFLAGS}")
  
! SunOS64 sparc64 sunos64 amd64: SunOS/Makefile
        (cd SunOS; make pfil "BITS=32" OS=solaris DO=pfil "ADEF=${SFLAGS}")
        /bin/rm -f SunOS/*.o
        (cd SunOS; make pfil${SBITS} "BITS=64" OS=solaris DO=pfil64 
"ADEF=${SFLAGS} ${S64FLAGS}")
***************
*** 108,117 ****
                                 pkginfo.dist > pkginfo)
        cat prototype.dist > prototype
        if [ -f pfil64 ] ; then \
!               echo 'd none kernel/strmod/sparcv9 ? root sys' >> prototype; \
!               echo 'l none kernel/strmod/sparcv9/pfil=../../drv/sparcv9/pfil' 
>> prototype; \
!               echo 'd none kernel/drv/sparcv9 ? root sys' >> prototype; \
!               echo 'f none kernel/drv/sparcv9/pfil=pfil64 ? root sys' >> 
prototype; \
        fi
        pkgmk -o -d $(TMP)
        pkgtrans -s $(TMP) pfil.pkg $(PKG)
--- 117,126 ----
                                 pkginfo.dist > pkginfo)
        cat prototype.dist > prototype
        if [ -f pfil64 ] ; then \
!               echo "d none kernel/strmod/$(KTYPE) ? root sys" >> prototype; \
!               echo "l none kernel/strmod/$(KTYPE)/pfil=../../drv/$KTYPE/pfil" 
>> prototype; \
!               echo "d none kernel/drv/$(KTYPE) ? root sys" >> prototype; \
!               echo "f none kernel/drv/$(KTYPE)/pfil=pfil64 ? root sys" >> 
prototype; \
        fi
        pkgmk -o -d $(TMP)
        pkgtrans -s $(TMP) pfil.pkg $(PKG)



*** SunOS5/prototype_amd64.dist Sat Aug 20 13:42:02 2005
--- SunOS5/prototype_amd64      Tue Jan 16 01:37:13 2007
***************
*** 1,6 ****
  i pkginfo
  i copyright=../copyright
! default 0755 root root
  d none /usr ? ? ?
  d none /usr/kernel ? ? ?
  d none /usr/kernel/drv ? ? ?
--- 1,6 ----
  i pkginfo
  i copyright=../copyright
! !default 0755 root root
  d none /usr ? ? ?
  d none /usr/kernel ? ? ?
  d none /usr/kernel/drv ? ? ?


*** ip_log.c_old        Mon Dec 18 04:57:29 2006
--- ip_log.c    Tue Dec 26 03:44:50 2006
***************
*** 151,157 ****
  # if defined(linux) && defined(_KERNEL)
  wait_queue_head_t     iplh_linux[IPL_LOGSIZE];
  # endif
! # if SOLARIS
  extern        kcondvar_t      iplwait;
  extern        struct pollhead iplpollhead[IPL_LOGSIZE];
  # endif
--- 151,157 ----
  # if defined(linux) && defined(_KERNEL)
  wait_queue_head_t     iplh_linux[IPL_LOGSIZE];
  # endif
! # if SOLARIS && defined(_KERNEL)
  extern        kcondvar_t      iplwait;
  extern        struct pollhead iplpollhead[IPL_LOGSIZE];
  # endif

Reply via email to