Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions builds/posix/prefix.linux_loongarch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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)
# 14 Apr 2008 Alan Barclay alan AT escribe.co.uk
# 2018, "Manuel A. Fernandez Montecelo" <[email protected]>


#LD=@CXX@

#PROD_FLAGS=-ggdb -O3 -fno-omit-frame-pointer -DLINUX -pipe -MMD -fPIC
#DEV_FLAGS=-ggdb -DLINUX -DDEBUG_GDS_ALLOC -pipe -MMD -p -fPIC -Werror=delete-incomplete -Wall -Wno-switch

PROD_FLAGS=-O3 -DLINUX -DLOONGARCH -pipe -p -MMD -fPIC -fsigned-char -fmessage-length=0 -std=gnu++03 -fno-delete-null-pointer-checks
DEV_FLAGS=-ggdb -DLINUX -DLOONGARCH -pipe -p -MMD -fPIC -Werror=delete-incomplete -Wall -fsigned-char -fmessage-length=0 -Wno-non-virtual-dtor
12 changes: 12 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,18 @@ dnl CPU_TYPE=ppc64
libdir=/usr/lib64
;;

loongarch*-*-linux*)
MAKEFILE_PREFIX=linux_loongarch
INSTALL_PREFIX=linux
PLATFORM=LINUX
AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
EDITLINE_FLG=Y
SHRLIB_EXT=so
STD_EDITLINE=true
STD_ICU=true
libdir=/usr/lib64
;;

riscv64*-*-linux*)
MAKEFILE_PREFIX=linux_riscv64
INSTALL_PREFIX=linux
Expand Down
3 changes: 3 additions & 0 deletions extern/editline/config.guess
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,9 @@ EOF
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
loongarch32:Linux:*:* | loongarch64:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
Expand Down
1 change: 1 addition & 0 deletions extern/editline/config.sub
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ case $basic_machine in
| k1om \
| le32 | le64 \
| lm32 \
| loongarch32 | loongarch64 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
Expand Down
5 changes: 5 additions & 0 deletions extern/libcds/cds/compiler/gcc/compiler_macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@
# else
# define CDS_BUILD_BITS 32
# endif
#elif defined(__loongarch__)
# define CDS_PROCESSOR_ARCH CDS_PROCESSOR_LOONGARCH
# define CDS_PROCESSOR__NAME "LOONGARCH"
# define CDS_PROCESSOR__NICK "loongarch"
# define CDS_BUILD_BITS 64
#else
# if defined(CDS_USE_LIBCDS_ATOMIC)
# error "Libcds does not support atomic implementation for the processor architecture. Try to use C++11-compatible compiler and remove CDS_USE_LIBCDS_ATOMIC flag from compiler command line"
Expand Down
2 changes: 2 additions & 0 deletions extern/libcds/cds/details/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ namespace cds {}
- CDS_PROCESSOR_PPC64 PowerPC64
- CDS_PROCESSOR_ARM7 ARM v7
- CDS_PROCESSOR_ARM8 ARM v8
- CDS_PROCESSOR_LOONGARCH LoongArch
- CDS_PROCESSOR_UNKNOWN undefined processor architecture

CDS_PROCESSOR__NAME The name (string) of processor architecture
Expand Down Expand Up @@ -278,6 +279,7 @@ namespace cds {}
#define CDS_PROCESSOR_PPC64 5 // PowerPC 64bit
#define CDS_PROCESSOR_ARM7 7
#define CDS_PROCESSOR_ARM8 8
#define CDS_PROCESSOR_LOONGARCH 9
#define CDS_PROCESSOR_UNKNOWN -1

// Supported OS interfaces
Expand Down
28 changes: 15 additions & 13 deletions src/common/classes/DbImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ static const UCHAR CpuPowerPc64el = 16;
static const UCHAR CpuM68k = 17;
static const UCHAR CpuRiscV64 = 18;
static const UCHAR CpuMips64el = 19;
static const UCHAR CpuLoongArch = 20;

static const UCHAR OsWindows = 0;
static const UCHAR OsLinux = 1;
Expand Down Expand Up @@ -93,7 +94,8 @@ const char* hardware[] = {
"PowerPC64el",
"M68k",
"RiscV64",
"MIPS64EL"
"MIPS64EL",
"LOONGARCH"
};

const char* operatingSystem[] = {
Expand All @@ -120,23 +122,23 @@ const char* compiler[] = {
// This table lists pre-fb3 implementation codes
const UCHAR backwardTable[FB_NELEM(hardware) * FB_NELEM(operatingSystem)] =
{
// Intel AMD Sparc PPC PPC64 MIPSEL MIPS ARM IA64 s390 s390x SH SHEB HPPA Alpha ARM64 PPC64el M68k RiscV64 MIPS64EL
/* Windows */ 50, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* Linux */ 60, 66, 65, 69, 86, 71, 72, 75, 76, 79, 78, 80, 81, 82, 83, 84, 85, 87, 88, 90,
/* Darwin */ 70, 73, 0, 63, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* Solaris */ 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* HPUX */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0,
/* AIX */ 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* MVS */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* FreeBSD */ 61, 67, 0, 92, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 0, 0, 0,
/* NetBSD */ 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
// Intel AMD Sparc PPC PPC64 MIPSEL MIPS ARM IA64 s390 s390x SH SHEB HPPA Alpha ARM64 PPC64el M68k RiscV64 MIPS64EL LoongArch
/* Windows */ 50, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* Linux */ 60, 66, 65, 69, 86, 71, 72, 75, 76, 79, 78, 80, 81, 82, 83, 84, 85, 87, 88, 90, 93,
/* Darwin */ 70, 73, 0, 63, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* Solaris */ 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* HPUX */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0,
/* AIX */ 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* MVS */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* FreeBSD */ 61, 67, 0, 92, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 0, 0, 0, 0,
/* NetBSD */ 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};


const UCHAR backEndianess[FB_NELEM(hardware)] =
{
// Intel AMD Sparc PPC PPC64 MIPSEL MIPS ARM IA64 s390 s390x SH SHEB HPPA Alpha ARM64 PPC64el M68k RiscV64 MIPS64EL
0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0,
// Intel AMD Sparc PPC PPC64 MIPSEL MIPS ARM IA64 s390 s390x SH SHEB HPPA Alpha ARM64 PPC64el M68k RiscV64 MIPS64EL LoongArch
0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0,
};

} // anonymous namespace
Expand Down
4 changes: 4 additions & 0 deletions src/common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@
#define FB_CPU CpuRiscV64
#endif /* RISCV64 */

#ifdef LOONGARCH
#define FB_CPU CpuLoongArch
#endif /* LOONGARCH */

#ifdef sparc
#define FB_CPU CpuUltraSparc
#define RISC_ALIGNMENT
Expand Down
4 changes: 4 additions & 0 deletions src/jrd/license.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,12 @@
#endif

#ifdef LINUX
#if defined(__loongarch__)
#define FB_PLATFORM "LL" // Linux/LoongArch
#else
#define FB_PLATFORM "LI" // Linux on Intel
#endif
#endif

#ifdef FREEBSD
#define FB_PLATFORM "FB" // FreeBSD/i386
Expand Down