8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 16:43:03 +01:00

Forward port Sparc fixes

This commit is contained in:
skidder 2003-10-10 23:56:57 +00:00
parent 41657a2193
commit 4e8605294e
14 changed files with 81 additions and 37 deletions

View File

@ -31,7 +31,7 @@
# Contributor(s):
#
#
# $Id: postinstall.sh.in,v 1.2 2003-09-23 22:38:44 skidder Exp $
# $Id: postinstall.sh.in,v 1.3 2003-10-10 23:56:50 skidder Exp $
#
# The post install script for Firebird Classic
@ -98,14 +98,14 @@ addFirebirdUser() {
if [ -z "$testStr" ]
then
groupadd -g 84 -o -r firebird
groupadd firebird
fi
testStr=`grep firebird /etc/passwd`
if [ -z "$testDir" ]
if [ -z "$testStr" ]
then
useradd -o -r -m -d $FBRootDir -s /bin/bash \
-c "Firebird Database Administrator" -g firebird -u 84 firebird
useradd -m -d $FBRootDir -s /bin/bash \
-c "Firebird Database Administrator" -g firebird firebird
# >/dev/null 2>&1
fi

View File

@ -83,14 +83,14 @@ addFirebirdUser() {
if [ -z "$testStr" ]
then
groupadd -g 84 -o -r firebird
groupadd firebird
fi
testStr=`grep firebird /etc/passwd`
if [ -z "$testDir" ]
if [ -z "$testStr" ]
then
useradd -o -r -m -d $IBRootDir -s /bin/bash \
-c "Firebird Database Administrator" -g firebird -u 84 firebird
useradd -m -d $IBRootDir -s /bin/bash \
-c "Firebird Database Administrator" -g firebird firebird
# >/dev/null 2>&1
fi

View File

@ -0,0 +1,34 @@
# The contents of this file are subject to the Interbase Public
# License Version 1.0 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy
# of the License at http://www.Inprise.com/IPL.html
#
# Software distributed under the License is distributed on an
# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
# or implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code was created by Inprise Corporation
# and its predecessors. Portions created by Inprise Corporation are
# Copyright (C) Inprise Corporation.
#
# All Rights Reserved.
# Contributor(s): ______________________________________.
# Start of file prefix.linux: $(VERSION) $(PLATFORM)
#$Id: prefix.linux_sparc32,v 1.2 2003-10-10 23:56:52 skidder Exp $
# 2 Oct 2002, Nickolay Samofatov - Major cleanup
LD=@CXX@
PROD_FLAGS=-m32 -mcpu=ultrasparc -mtune=ultrasparc -O3 -DNDEBUG -DLINUX -pipe -MMD -fPIC -Dsparc
DEV_FLAGS=-ggdb -m32 -DLINUX -DDEBUG_GDS_ALLOC -pipe -MMD -p -fPIC -Wall -Wno-switch -Dsparc
OS_ServerFiles=inet_server.cpp
LIB_LINK_OPTIONS:=-shared
LIB_LINK_RPATH:=-Wl,-rpath,
LIB_LINK_SONAME:=-Wl,-soname,
EMBED_UTIL_TARGETS=gstat gds_drop gds_relay gsec nbackup fb_lock_print
CLIENT_UTIL_TARGETS=gds_drop gds_relay gstat gsec fbguard fbmgr_bin nbackup fb_lock_print
Physical_IO_Module=unix.cpp

View File

@ -1,4 +1,4 @@
dnl $Id: configure.in,v 1.159 2003-09-30 19:26:05 brodsom Exp $
dnl $Id: configure.in,v 1.160 2003-10-10 23:56:47 skidder Exp $
dnl ############################# INITIALISATION ###############################
@ -50,6 +50,15 @@ case "$target" in
SHRLIB_EXT=so
;;
sparc*-*-linux-*)
MAKEFILE_PREFIX=linux_sparc32
PLATFORM=LINUX
AC_DEFINE(LINUX)
LOCK_MANAGER_FLG=Y
EDITLINE_FLG=Y
SHRLIB_EXT=so
;;
*-*-linux*)
MAKEFILE_PREFIX=linux
PLATFORM=LINUX

View File

@ -34,7 +34,7 @@
* Contributor(s):
*
*
* $Id: alloc.h,v 1.25 2003-09-08 20:23:32 skidder Exp $
* $Id: alloc.h,v 1.26 2003-10-10 23:56:54 skidder Exp $
*
*/
@ -59,7 +59,7 @@
#define MAX_TREE_DEPTH 4
// Must be a power of 2
#define ALLOC_ALIGNMENT 4
#define ALLOC_ALIGNMENT ALIGNMENT
#define MEM_ALIGN(X) FB_ALIGN(X,ALLOC_ALIGNMENT)

View File

@ -49,7 +49,7 @@
*
*/
/*
$Id: common.h,v 1.86 2003-10-07 09:55:59 robocop Exp $
$Id: common.h,v 1.87 2003-10-10 23:56:55 skidder Exp $
*/
#ifndef JRD_COMMON_H
@ -122,6 +122,10 @@ $Id: common.h,v 1.86 2003-10-07 09:55:59 robocop Exp $
#define IMPLEMENTATION isc_info_db_impl_i386 /* 60 next higher unique number, See you later */
#endif /* i386 */
#ifdef sparc
#define IMPLEMENTATION isc_info_db_impl_linux_sparc /* 20 */
#endif /* sparc */
#define MEMMOVE(from,to,length) memmove ((void *)to, (void *)from, (size_t) length)
#define MOVE_FAST(from,to,length) memcpy (to, from, (int) (length))
#define MOVE_FASTER(from,to,length) memcpy (to, from, (int) (length))

View File

@ -144,11 +144,11 @@ public:
SCHAR nod_scale; /* Target scale factor */
USHORT nod_count; /* Number of arguments */
dsc lit_desc;
UCHAR lit_data[1];
SINT64 lit_data[1]; // Defined this way to prevent SIGBUS error in 64-bit ports
};
typedef lit* LIT;
#define lit_delta (sizeof(dsc) / sizeof(JRD_NOD*))
#define lit_delta ((sizeof(struct lit)-sizeof(struct jrd_nod)-sizeof(SINT64)) / sizeof(JRD_NOD*))
/* Aggregate Sort Block (for DISTINCT aggregates) */

View File

@ -185,12 +185,6 @@ static const char * FB_PID_FILE = "fb_%d";
extern "C" {
#ifdef sparc
#ifndef SOLARIS
extern int ib_printf();
#endif
#endif
// Number of times to try to generate new name for temporary file
#define MAX_TMPFILE_TRIES 256

View File

@ -33,7 +33,7 @@
*
*/
/*
$Id: ibase.h,v 1.48 2003-10-08 08:42:43 robocop Exp $
$Id: ibase.h,v 1.49 2003-10-10 23:56:55 skidder Exp $
*/
#ifndef JRD_IBASE_H
@ -1567,6 +1567,8 @@ enum info_db_implementations
isc_info_db_impl_darwin = 63,
isc_info_db_impl_sinixz = 64,
isc_info_db_impl_linux_sparc = 65,
isc_info_db_impl_last_value /* Leave this LAST! */
};

View File

@ -4089,9 +4089,11 @@ static SLONG open_semaphores(
}
if (semaphores) {
union semun arg;
semid_ds buf;
arg.buf = &buf;
// Get number of semaphores in opened set
if (semctl(semid, 0, IPC_STAT, &buf) == -1) {
if (semctl(semid, 0, IPC_STAT, arg) == -1) {
error(status_vector, "semctl", errno);
return -1;
}
@ -4132,9 +4134,11 @@ static SLONG create_semaphores(
}
else
{
union semun arg;
semid_ds buf;
arg.buf = &buf;
// Get number of semaphores in opened set
if (semctl(semid, 0, IPC_STAT, &buf) == -1) {
if (semctl(semid, 0, IPC_STAT, arg) == -1) {
error(status_vector, "semctl", errno);
return -1;
}

View File

@ -6217,14 +6217,14 @@ static JRD_NOD optimize_like(TDBB tdbb, JRD_NOD like_node)
/* allocate a literal node to store the starting with string;
assume it will be shorter than the search string */
count =
lit_delta + (search_desc->dsc_length + sizeof(int) -
1) / sizeof(int);
lit_delta + (search_desc->dsc_length + sizeof(jrd_nod*) -
1) / sizeof(jrd_nod*);
node = PAR_make_node(tdbb, count);
node->nod_type = nod_literal;
node->nod_count = 0;
literal = (LIT) node;
literal->lit_desc = *search_desc;
literal->lit_desc.dsc_address = q = literal->lit_data;
literal->lit_desc.dsc_address = q = reinterpret_cast<UCHAR*>(literal->lit_data);
/* copy the string into the starting with literal, up to the first wildcard character */
p_count = search_desc->dsc_length;
for (p = search_desc->dsc_address, end =

View File

@ -34,7 +34,7 @@
*
*/
/*
$Id: par.cpp,v 1.53 2003-09-30 17:21:04 skidder Exp $
$Id: par.cpp,v 1.54 2003-10-10 23:56:56 skidder Exp $
*/
#include "firebird.h"
@ -1350,12 +1350,12 @@ static JRD_NOD par_literal(TDBB tdbb, CSB csb)
PAR_desc(csb, &desc);
count = lit_delta + (desc.dsc_length + sizeof(int) - 1) / sizeof(int);
count = lit_delta + (desc.dsc_length+sizeof(jrd_nod*)-1)/sizeof(jrd_nod*);
node = PAR_make_node(tdbb, count);
literal = (LIT) node;
node->nod_count = 0;
literal->lit_desc = desc;
literal->lit_desc.dsc_address = p = literal->lit_data;
literal->lit_desc.dsc_address = p = reinterpret_cast<UCHAR*>(literal->lit_data);
literal->lit_desc.dsc_flags = 0;
q = csb->csb_running;
l = desc.dsc_length;

View File

@ -87,12 +87,6 @@
#define statistics stat
#ifdef sparc
#ifndef SOLARIS
extern int ib_printf();
#endif
#endif
#ifdef UNIX
#define GDS_EDIT gds__edit
#endif
@ -253,7 +247,8 @@ static const TEXT *const impl_implementation[] = {
"Firebird/FreeBSD/i386", /* 61 */
"Firebird/NetBSD/i386", /* 62 */
"Firebird/Darwin/PowerPC", /* 63 */
"Firebird/SINIX-Z" /* 64 */
"Firebird/SINIX-Z", /* 64 */
"Firebird/linux Sparc" /* 65 */
};

View File

@ -42,8 +42,10 @@
#if defined(i386) || defined(I386) || defined(_M_IX86)
#define SWAP_DOUBLE
#else
#if !defined(sparc)
#error "Define SWAP_DOUBLE for your platform correctly !"
#endif
#endif
#ifdef VMS
double MTH$CVT_D_G(), MTH$CVT_G_D();