Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit06e3ec7

Browse files
committed
Implement compiler #error if spinlock code not found, add configure flag
to bypass the error, --without-spinlocks.
1 parent69a46e9 commit06e3ec7

File tree

5 files changed

+80
-6
lines changed

5 files changed

+80
-6
lines changed

‎configure

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,7 @@ Optional Packages:
869869
--with-rendezvous build with Rendezvous support
870870
--with-openssl[=DIR] build with OpenSSL support [/usr/local/ssl]
871871
--without-readline do not use Readline
872+
--without-spinlocks do not use Spinlocks
872873
--without-zlib do not use Zlib
873874
--with-gnu-ld assume the C compiler uses GNU ld default=no
874875

@@ -3493,6 +3494,36 @@ else
34933494
fi;
34943495

34953496

3497+
#
3498+
# Spinlocks
3499+
#
3500+
3501+
3502+
3503+
# Check whether --with-spinlocks or --without-spinlocks was given.
3504+
if test "${with_spinlocks+set}" = set; then
3505+
withval="$with_spinlocks"
3506+
3507+
case $withval in
3508+
yes)
3509+
:
3510+
;;
3511+
no)
3512+
:
3513+
;;
3514+
*)
3515+
{ { echo "$as_me:$LINENO: error: no argument expected for --with-spinlocks option" >&5
3516+
echo "$as_me: error: no argument expected for --with-spinlocks option" >&2;}
3517+
{ (exit 1); exit 1; }; }
3518+
;;
3519+
esac
3520+
3521+
else
3522+
with_spinlocks=yes
3523+
3524+
fi;
3525+
3526+
34963527
#
34973528
# Zlib
34983529
#
@@ -3523,7 +3554,6 @@ else
35233554
fi;
35243555

35253556

3526-
35273557
#
35283558
# Elf
35293559
#
@@ -6062,6 +6092,19 @@ fi
60626092

60636093
fi
60646094

6095+
if test "$with_spinlocks" = yes; then
6096+
6097+
cat >>confdefs.h <<\_ACEOF
6098+
#define HAVE_SPINLOCKS 1
6099+
_ACEOF
6100+
6101+
else
6102+
{ echo "$as_me:$LINENO: WARNING:
6103+
*** Not using spinlocks will cause poor performance." >&5
6104+
echo "$as_me: WARNING:
6105+
*** Not using spinlocks will cause poor performance." >&2;}
6106+
fi
6107+
60656108
if test "$with_krb4" = yes ; then
60666109

60676110
echo "$as_me:$LINENO: checking for des_encrypt in -ldes" >&5

‎configure.in

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $Header: /cvsroot/pgsql/configure.in,v 1.286 2003/09/07 16:38:05 momjian Exp $
2+
dnl $Header: /cvsroot/pgsql/configure.in,v 1.287 2003/09/12 16:10:26 momjian Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -521,13 +521,18 @@ AC_SUBST(with_openssl)
521521
PGAC_ARG_BOOL(with, readline, yes,
522522
[ --without-readline do not use Readline])
523523

524+
#
525+
# Spinlocks
526+
#
527+
PGAC_ARG_BOOL(with, spinlocks, yes,
528+
[ --without-spinlocks do not use Spinlocks])
529+
524530
#
525531
# Zlib
526532
#
527533
PGAC_ARG_BOOL(with, zlib, yes,
528534
[ --without-zlib do not use Zlib])
529535

530-
531536
#
532537
# Elf
533538
#
@@ -678,6 +683,13 @@ failure. It is possible the compiler isn't looking in the proper directory.
678683
Use --without-zlib to disable zlib support.])])
679684
fi
680685

686+
if test "$with_spinlocks" = yes; then
687+
AC_DEFINE(HAVE_SPINLOCKS, 1, [Define to 1 if you have spinlocks.])
688+
else
689+
AC_MSG_WARN([
690+
*** Not using spinlocks will cause poor performance.])
691+
fi
692+
681693
if test "$with_krb4" = yes ; then
682694
AC_CHECK_LIB(des, des_encrypt, [], [AC_MSG_ERROR([library 'des' is required for Kerberos 4])])
683695
AC_CHECK_LIB(krb, krb_sendauth, [], [AC_MSG_ERROR([library 'krb' is required for Kerberos 4])])

‎doc/src/sgml/installation.sgml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.141 2003/09/11 21:42:20 momjian Exp $ -->
1+
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.142 2003/09/12 16:10:26 momjian Exp $ -->
22

33
<chapter id="installation">
44
<title><![%standalone-include[<productname>PostgreSQL</>]]>
@@ -899,6 +899,18 @@ JAVACMD=$JAVA_HOME/bin/java
899899
</listitem>
900900
</varlistentry>
901901

902+
<varlistentry>
903+
<term><option>--without-spinlocks</option></term>
904+
<listitem>
905+
<para>
906+
Allows source builds to succeed without CPU spinlock support.
907+
Lack of spinlock support will produce poor performance.
908+
This option is to be used only by platforms without
909+
spinlock support.
910+
</para>
911+
</listitem>
912+
</varlistentry>
913+
902914
<varlistentry>
903915
<term><option>--enable-thread-safety</option></term>
904916
<listitem>

‎src/include/pg_config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,9 @@
357357
/* Define to 1 if you have the `snprintf' function. */
358358
#undef HAVE_SNPRINTF
359359

360+
/* Define to 1 if you have spinlocks. */
361+
#undef HAVE_SPINLOCKS
362+
360363
/* Define to 1 if you have the `srandom' function. */
361364
#undef HAVE_SRANDOM
362365

‎src/include/storage/s_lock.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
6464
* Portions Copyright (c) 1994, Regents of the University of California
6565
*
66-
* $Id: s_lock.h,v 1.112 2003/08/04 02:40:15 momjian Exp $
66+
* $Id: s_lock.h,v 1.113 2003/09/12 16:10:27 momjian Exp $
6767
*
6868
*-------------------------------------------------------------------------
6969
*/
@@ -537,7 +537,11 @@ extern slock_t wc_tas(volatile slock_t *lock);
537537

538538

539539

540-
#else/* !HAS_TEST_AND_SET */
540+
#else/* HAS_TEST_AND_SET */
541+
542+
#ifdefHAVE_SPINLOCKS
543+
#error This platform does not support native spinlocks. To continue the compile, rerun configure using --without-spinlocks. However, performance will be poor. Please report this to pgsql-bugs@postgresql.org.
544+
#endif
541545

542546
/*
543547
* Fake spinlock implementation using semaphores --- slow and prone

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp