[svn-commits] r22 - in main/src: cl/hdr/hdr tools/port/jam tools/port/shell_unix
hanje04 at ingres.com
hanje04 at ingres.com
Wed Apr 23 07:31:40 PDT 2008
Author: hanje04
Date: 2008-04-23 07:31:39 -0700 (Wed, 23 Apr 2008)
New Revision: 22
Modified:
main/src/cl/hdr/hdr/csnormal.h
main/src/tools/port/jam/Jamrules
main/src/tools/port/jam/bldenv
main/src/tools/port/shell_unix/shlibinfo.sh
Log:
#109 Fix up build for x86_64 Linux. Add in-line assembler macros to csnormal.h to replace those previously defined in asm/bitops.h
Modified: main/src/cl/hdr/hdr/csnormal.h
===================================================================
--- main/src/cl/hdr/hdr/csnormal.h 2008-04-23 14:24:34 UTC (rev 21)
+++ main/src/cl/hdr/hdr/csnormal.h 2008-04-23 14:31:39 UTC (rev 22)
@@ -25,10 +25,6 @@
# if defined(sgi_us5) || defined(LNX)
# include <sched.h>
# endif /* sgi_us5 Linux */
-# if defined(a64_lnx)
-# define CONFIG_SMP
-# include <asm/bitops.h>
-# endif /* a64_lnx */
# endif /* POSIX_THREADS */
# endif /* OS_THREADS_USED */
# ifdef OSX
@@ -1840,6 +1836,10 @@
** SIR S119978
** Replace mg5_osx with OSX and add support for Intel OSX.
** Remove all OSX assembler and implement OSSpinlock calls instead
+** 20-Apr-2008 (hanje04)
+** Add in-line assembler functions for test_and_set()/clear()
+** functions. These replace those defined in the now missing
+** bitops.h
*/
# if defined(hp8_us5) || defined(hp8_bls)
@@ -2734,11 +2734,39 @@
# if defined(a64_lnx)
# define cs_aset_op
-# define CS_tas(a) test_and_set_bit((long) 0, a)
+# define CS_tas(a) test_and_set_bit((int) 0, a)
# define CS_ISSET(a) (*(a) != (CS_ASET)0)
# define CS_ACLR(a) CS_aclr(a)
# define CS_TAS(a) (!CS_tas(a))
# define CS_SPININIT(s) (MEfill(sizeof(*s),'\0',(char *)s))
+
+/*
+ * In-line assembler functions for atomic sychronization operations,
+ * based on those previously found in asm-x86_64/bitops.h. File
+ * has been removed from later Linux distributions but functions
+ * are still needed.
+ * Better soln would probably be to use GCC compiler macros but this
+ * requires further investigation.
+*/
+# define ADDR (*(CS_ASET *) addr)
+static __inline__ void clear_bit(int nr, CS_ASET * addr)
+{
+ __asm__ __volatile__( "lock;"
+ "btrl %1,%0"
+ :"=m" (ADDR)
+ :"dIr" (nr));
+}
+static __inline__ int test_and_set_bit(int nr, CS_ASET * addr)
+{
+ int oldbit;
+
+ __asm__ __volatile__( "lock ;"
+ "btsl %2,%1\n\tsbbl %0,%0"
+ :"=r" (oldbit),"=m" (ADDR)
+ :"dIr" (nr) : "memory");
+ return oldbit;
+}
+
# define CS_getspin(s) \
{ \
if (CS_tas(&(s)->cssp_bit)) \
@@ -2752,7 +2780,7 @@
static __inline__ void CS_aclr( volatile void * ptr )
{
__asm__ __volatile__("": : :"memory");
- clear_bit((long) 0, ptr);
+ clear_bit(0, ptr);
__asm__ __volatile__("": : :"memory");
}
Modified: main/src/tools/port/jam/Jamrules
===================================================================
--- main/src/tools/port/jam/Jamrules 2008-04-23 14:24:34 UTC (rev 21)
+++ main/src/tools/port/jam/Jamrules 2008-04-23 14:31:39 UTC (rev 22)
@@ -1065,6 +1065,9 @@
# 10-Mar-2008 (hanal04) Bug 119979
# Add missing readvers.bat dependency information to allow
# .pp files to be built from the local directory.
+# 23-Arp-2008 (hanje04)
+# Add ability to reference a second location for the Xerces
+# library on hybrid builds using XERCESLOCHB
#
#####
# VARIABLE DEFINITIONS for LIBBRARY VARIABLE RULES and EXCEPTIONS
@@ -6283,16 +6286,26 @@
if $(VERSHB)
{
- FILE $(INGLIB)/$(SUFHB)/$(XERCESCLIB) : $(SUFHB)/$(XERCESCLIB) ;
+ if $(XERCESLOCHB)
+ {
+ XERCESCHBLIB = $(XERCESCLIB:G=hb) ;
+ XERCESHBLOC = $(XERCESLOCHB) ;
+ }
+ else
+ {
+ XERCESCHBLIB = $(SUFHB)/$(XERCESCLIB) ;
+ XERCESHBLOC = $(XERCESLOC) ;
+ }
+ FILE $(INGLIB)/$(SUFHB)/$(XERCESCLIB) : $(XERCESCHBLIB) ;
_LINK $(SUFHB)/$(<) : $(INGLIB)/$(SUFHB)/$(XERCESCLIB) ;
_LINK $(SUFHB)/$(<:S=.$(SLSFX).$(XERCVERS)) : $(INGLIB)/$(SUFHB)/$(XERCESCLIB) ;
- DEPENDS $(SUFHB)/$(<:S=.$(SLSFX).$(XERCVERS)) : $(SUFHB)/$(XERCESCLIB) ;
+ DEPENDS $(SUFHB)/$(<:S=.$(SLSFX).$(XERCVERS)) : $(XERCESCHBLIB) ;
DEPENDS $(SUFHB)/$(<) : $(SUFHB)/$(<:S=.$(SLSFX).$(XERCVERS)) ;
DEPENDS shlibs : $(SUFHB)/$(<) ;
LOCATE on $(SUFHB)/$(<) = $(INGLIB) ;
LOCATE on $(SUFHB)/$(<:S=.$(SLSFX).$(XERCVERS)) = $(INGLIB) ;
- SEARCH on $(SUFHB)/$(XERCESCLIB) = $(XERCESLOC) ;
+ SEARCH on $(XERCESCHBLIB) = $(XERCESHBLOC) ;
MODE on $(INGLIB)/$(SUFHB)/$(XERCESCLIB) = $(EXEMODE) ;
Chmod $(INGLIB)/$(SUFHB)/$(XERCESCLIB) ;
Modified: main/src/tools/port/jam/bldenv
===================================================================
--- main/src/tools/port/jam/bldenv 2008-04-23 14:24:34 UTC (rev 21)
+++ main/src/tools/port/jam/bldenv 2008-04-23 14:31:39 UTC (rev 22)
@@ -122,7 +122,8 @@
## Make environment detection more inteligent. Search for xerces and
## kerberos in system locations and if they're not found suggest
## how they good be if package management is available.
-
+## 21-Apr-2008 (hanje04)
+## Add auto detect suport for yum (Fedora)
##
umask 002
@@ -134,6 +135,8 @@
rpm=false
deb=false
conary=false
+yum=false
+rhybrid=false
unames=`uname -s`
unamer=`uname -r`
unamem=`uname -m`
@@ -205,9 +208,11 @@
config_string=i64_lnx
xcc_need=i686-unknown-linux-gnu
xcc_name=${xcc_need}-gcc
+ rhybrid=true
;;
x86_64)
config_string=a64_lnx
+ rhybrid=true
;;
ppc64)
config_string=ppc_lnx
@@ -233,10 +238,14 @@
rpm_need=false
gtk_need=false
deb=true
+ elif [ -x /usr/bin/yum ] ; then
+ export OSVER=FEDORA
+ yum=true
fi
# Default to rpm if it's there
- if ! $conary && ! $deb && [ -x /bin/rpm -o -x /usr/bin/rpm ] ; then
+ if ! $conary && ! $deb && ! $yum && \
+ [ -x /bin/rpm -o -x /usr/bin/rpm ] ; then
rpm=true
fi
@@ -344,6 +353,8 @@
instcmd="conary update krb5:devel"
elif $deb ; then
instcmd="apt-get install libkrb5-dev"
+ elif $yum ; then
+ instcmd="yum install krb5-devel"
else
instcmd=''
fi
@@ -384,8 +395,18 @@
if [ -f /usr/include/xercesc/sax2/DefaultHandler.hpp ] ; then
XERCESCROOT=/usr
fi
-if [ -f /usr/lib/libxerces-c.so.27.0 ] ; then
- XERCLOC=/usr/lib
+if $rhybrid ; then
+ if [ -f /usr/lib64/libxerces-c.so.27.0 ] ; then
+ XERCESLOCHB=/usr/lib
+ XERCESLOC=/usr/lib64
+ fi
+else
+ if [ -f /usr/lib/libxerces-c.so.27.0 ] ; then
+ XERCESLOC=/usr/lib
+ fi
+ if [ -f /usr/lib64/libxerces-c.so.27.0 ] ; then
+ XERCESLOCHB=/usr/lib64
+ fi
fi
[ "$XERCESCROOT" ] && [ -d ${XERCESCROOT}/src/xercesc -o \
-f ${XERCESCROOT}/include/xercesc/sax2/DefaultHandler.hpp ] ||
@@ -393,7 +414,7 @@
if [ -d ${ING_ROOT}/xerces-c-src_2_7_0/src/xercesc ] ; then
export XERCESCROOT=${ING_ROOT}/xerces-c-src_2_7_0
else
- unset XERCESCROOT XERCLOC
+ unset XERCESCROOT XERCESLOC XERCESLOC64
cat << EOF
Cannot locate Xerces C headers and libraries required to build Ingres.
@@ -403,6 +424,8 @@
instcmd="conary update xerces-c:{lib,devel,devellib}"
elif $deb ; then
instcmd="apt-get install libxerces27 libxerces27-dev"
+ elif $yum ; then
+ instcmd="yum install xerces-c xerces-c-devel"
else
instcmd=""
fi
@@ -437,7 +460,7 @@
fi
}
-[ -d ${XERCESCROOT}/lib ] && \
+[ -d ${XERCESCROOT}/lib ] && [ x"$XERCESLOC" = "x" ] && \
XERCESLOC=${XERCESCROOT}/lib
while [ -z "$XERCESLOC" ] ; do
read -p "Please enter a value for XERCESLOC: " loc
@@ -454,7 +477,7 @@
break
done
-export XERCESCROOT XERCESLOC
+export XERCESCROOT XERCESLOC XERCESLOCHB
# pax for Linux
if [ "${unames}" = "Linux" ]; then
@@ -475,6 +498,8 @@
instcmd="conary update pax"
elif $deb ; then
instcmd="apt-get install pax"
+ elif $yum ; then
+ instcmd="yum install pax"
else
instcmd=""
fi
Modified: main/src/tools/port/shell_unix/shlibinfo.sh
===================================================================
--- main/src/tools/port/shell_unix/shlibinfo.sh 2008-04-23 14:24:34 UTC (rev 21)
+++ main/src/tools/port/shell_unix/shlibinfo.sh 2008-04-23 14:31:39 UTC (rev 22)
@@ -329,6 +329,9 @@
# 26-Feb-2008 (hanje04)
# SIR 119978
# Fix up shlink_opts for older OS X releases
+# 21-Apr-2008 (hanje04)
+# Remove libgcc_s fromm 32bit link line for x86_64 Linux.
+# It's not needed and causes problems because of a linker bug
#
CMD=`basename /$0`
@@ -624,7 +627,7 @@
shlink_cmd="ld -shared "
shlinkHB_cmd="ld -melf_i386 -shared "
shlink_opts=" -lm -lc -lpthread -ldl -lcrypt "
- shlinkHB_opts=" -lm -lc -lpthread -ldl -lcrypt -lgcc_s"
+ shlinkHB_opts=" -lm -lc -lpthread -ldl -lcrypt"
krblink_cmd="ld -shared"
krblinkHB_cmd="ld -melf_i386 -shared"
krblink_opts=""
More information about the svn-commits
mailing list