This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: atomicity.h?
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: bkoz at redhat dot com (Benjamin Kosnik)
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Fri, 27 Feb 2004 16:26:05 -0500 (EST)
- Subject: Re: atomicity.h?
> >> on hppa64-hp-hpux11.11.
> >>
> >> The build fails with the following error:
> >
> >The hppa-linux build also fails:
>
> Try this patch please and let me know if it solves these issues.
The following resolves the build problem on hppa-linux and I expect
it will also resolve the problem under hpux. Note it doesn't include
the aix fix, or the two new irix files.
It has new fixes to hppa/atomicity.h and hpux/os_defines.h.
It will take awhile to fully test it.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
? config/os/irix/atomic_word.h
? config/os/irix/atomicity.h
Index: configure.host
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.host,v
retrieving revision 1.24
diff -u -3 -p -r1.24 configure.host
--- configure.host 27 Feb 2004 00:49:43 -0000 1.24
+++ configure.host 27 Feb 2004 21:12:30 -0000
@@ -170,11 +170,13 @@ case "${host_os}" in
irix[1-6] | irix[1-5].* | irix6.[0-4]*)
# This is known to work on at least IRIX 5.2 and 6.3.
os_include_dir="os/irix/irix5.2"
- atomicity_dir=$os_include_dir
+ atomicity_dir=os/irix
+ atomic_word_dir=os/irix
;;
irix6.5*)
os_include_dir="os/irix/irix6.5"
- atomicity_dir=$os_include_dir
+ atomicity_dir=os/irix
+ atomic_word_dir=os/irix
;;
mingw32*)
os_include_dir="os/mingw32"
Index: config/cpu/hppa/atomicity.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/cpu/hppa/atomicity.h,v
retrieving revision 1.6
diff -u -3 -p -r1.6 atomicity.h
--- config/cpu/hppa/atomicity.h 27 Feb 2004 00:49:47 -0000 1.6
+++ config/cpu/hppa/atomicity.h 27 Feb 2004 21:12:31 -0000
@@ -27,24 +27,24 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
+#include <bits/c++config.h>
#include <bits/atomicity.h>
namespace __gnu_cxx
{
- template<int __inst>
+ template<int _Inst>
struct __Atomicity_lock
{
static volatile int _S_atomicity_lock;
};
- template<int __inst>
+ template<int _Inst>
volatile int
- __Atomicity_lock<__inst>::_S_atomicity_lock __attribute__ ((aligned (16))) = 1;
+ __Atomicity_lock<_Inst>::_S_atomicity_lock __attribute__ ((aligned (16))) = 1;
- /* Because of the lack of weak support when using the hpux
- som linker, we explicitly instantiate the atomicity lock
- in src/misc-inst.cc when _GLIBCXX_INST_ATOMICITY_LOCK
- is defined. */
+ // Because of the lack of weak support when using the hpux som
+ // linker, we explicitly instantiate the atomicity lock in
+ // src/misc-inst.cc when _GLIBCXX_INST_ATOMICITY_LOCK is defined.
#ifndef _GLIBCXX_INST_ATOMICITY_LOCK
template volatile int __Atomicity_lock<0>::_S_atomicity_lock;
#endif
@@ -76,7 +76,7 @@ namespace __gnu_cxx
void
__attribute__ ((__unused__))
- __atomic_add(_Atomic_word* __mem, int __val)
+ __atomic_add(volatile _Atomic_word* __mem, int __val)
{
int tmp;
volatile int& lock = __Atomicity_lock<0>::_S_atomicity_lock;
Index: config/os/hpux/os_defines.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/os/hpux/os_defines.h,v
retrieving revision 1.9
diff -u -3 -p -r1.9 os_defines.h
--- config/os/hpux/os_defines.h 26 Aug 2003 06:54:15 -0000 1.9
+++ config/os/hpux/os_defines.h 27 Feb 2004 21:12:31 -0000
@@ -1,6 +1,6 @@
// Specific definitions for HPUX -*- C++ -*-
-// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -93,7 +93,7 @@ typedef long int __padding_type;
/* We need explicit instantiation of the atomicity lock on HPPA if
there is no weak support. */
-#if !defined(_GLIBCXX_SUPPORTS_WEAK) && defined (__hppa__)
+#if !__GXX_WEAK__ && defined (__hppa__)
#define _GLIBCXX_INST_ATOMICITY_LOCK 1
#endif
Index: src/misc-inst.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/misc-inst.cc,v
retrieving revision 1.25
diff -u -3 -p -r1.25 misc-inst.cc
--- src/misc-inst.cc 11 Nov 2003 20:09:13 -0000 1.25
+++ src/misc-inst.cc 27 Feb 2004 21:12:31 -0000
@@ -1,6 +1,6 @@
// Explicit instantiation file.
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -42,10 +42,6 @@
namespace std
{
-#ifdef _GLIBCXX_INST_ATOMICITY_LOCK
- template volatile int __Atomicity_lock<0>::_S_atomicity_lock;
-#endif
-
// string related to iostreams
template
basic_istream<char>&
@@ -77,6 +73,10 @@ namespace std
namespace __gnu_cxx
{
+#ifdef _GLIBCXX_INST_ATOMICITY_LOCK
+ template volatile int __Atomicity_lock<0>::_S_atomicity_lock;
+#endif
+
#ifdef _GLIBCXX_NEED_GENERIC_MUTEX
#ifdef __GTHREAD_MUTEX_INIT
__gthread_mutex_t _Atomic_add_mutex = __GTHREAD_MUTEX_INIT;