summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/BuildInstructionsAIX.md207
-rw-r--r--cpp/config/Make.rules7
-rw-r--r--cpp/config/Make.rules.AIX55
-rw-r--r--cpp/config/Make.rules.Darwin3
-rw-r--r--cpp/include/Ice/SlicedData.h6
-rw-r--r--cpp/include/IceUtil/Config.h11
-rw-r--r--cpp/src/Freeze/BackgroundSaveEvictorI.h16
-rw-r--r--cpp/src/Freeze/MapI.cpp8
-rw-r--r--cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifierI.cpp40
-rw-r--r--cpp/src/Ice/Instance.cpp2
-rw-r--r--cpp/src/Ice/PluginManagerI.cpp5
-rw-r--r--cpp/src/Ice/RetryQueue.cpp2
-rw-r--r--cpp/src/Ice/WSConnector.h4
-rw-r--r--cpp/src/IceBox/ServiceManagerI.cpp5
-rw-r--r--cpp/src/IceGrid/Activator.cpp2
-rw-r--r--cpp/src/IceGridLib/PluginFacadeI.cpp12
-rw-r--r--cpp/src/IcePatch2Lib/Makefile8
-rw-r--r--cpp/src/Slice/PythonUtil.cpp10
-rw-r--r--cpp/src/Slice/RubyUtil.cpp10
-rw-r--r--cpp/src/slice2cpp/Gen.cpp18
-rw-r--r--cpp/src/slice2cs/Gen.cpp27
-rw-r--r--cpp/src/slice2js/Gen.cpp10
-rw-r--r--cpp/test/Ice/operations/Makefile7
-rwxr-xr-xcpp/test/Ice/properties/run.py9
-rw-r--r--cpp/test/Ice/stringConverter/Client.cpp22
-rw-r--r--cpp/test/IceGrid/replicaGroup/RegistryPlugin.cpp5
-rw-r--r--cpp/test/IceSSL/configuration/AllTests.cpp8
-rwxr-xr-xcpp/test/IceSSL/configuration/run.py2
-rwxr-xr-xcpp/test/Slice/headers/run.py1
29 files changed, 381 insertions, 141 deletions
diff --git a/cpp/BuildInstructionsAIX.md b/cpp/BuildInstructionsAIX.md
new file mode 100644
index 00000000000..cda7de3ab76
--- /dev/null
+++ b/cpp/BuildInstructionsAIX.md
@@ -0,0 +1,207 @@
+# Building Ice for C++ on AIX
+
+This document provides step-by-step instructions for building Ice for C++
+from sources on AIX.
+
+## Unsupported Platform
+
+AIX is currently an unsupported platform. Only minimal testing was performed
+on AIX, and there is no guarantee future releases of Ice will build or run
+on this platform.
+
+## Recommended Operating System and C++ Compiler
+
+ - AIX 6.1, AIX 7.1
+ - IBM XL C/C++ 12.1 with latest Fix Pack
+ - 32 bit or 64 bit
+
+## Build Pre-Requisites
+
+Before building Ice, you need to install or build a number of third-party
+packages that Ice depends on, and install some build tools.
+
+### Third-Party Packages
+
+Ice depends on several open-source packages: Berkeley DB 5.3, bzip2 1.0,
+expat 2.x, mcpp 2.7.2 (+patches) and OpenSSL.
+
+OpenSSL is a system package on AIX. RPM packages for bzip2 and expat are
+available in the [AIX Toolbox for Linux Applications][1]. You can install
+them as follows:
+
+```
+# As root
+rpm -i ftp://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/bzip2/bzip2-1.0.5-3.aix5.3.ppc.rpm
+rpm -i ftp://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/expat/expat-2.0.1-2.aix5.3.ppc.rpm
+rpm -i ftp://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/expat/expat-devel-2.0.1-2.aix5.3.ppc.rpm
+
+```
+
+Berkeley DB and mcpp must be built from sources, as described below.
+
+### Build Tools
+
+You need GNU make (gmake) to build Ice:
+```
+# As root
+rpm -i ftp://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/make/make-4.1-2.aix6.1.ppc.rpm
+```
+
+The preferred way to retrieve the Ice and mcpp source distributions is with
+git. A RPM for git is available from [bullfreeware.com][2].
+
+You also need wget, GNU tar and GNU patch to retrieve and build Berkeley DB:
+```
+# As root
+rpm -i ftp://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/wget/wget-1.9.1-1.aix5.1.ppc.rpm
+rpm -i ftp://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/tar/tar-1.22-1.aix6.1.ppc.rpm
+rpm -i ftp://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/patch/patch-2.5.4-4.aix4.3.ppc.rpm
+```
+
+### Building mcpp from Sources
+
+If building 64-bit binaries, set `OBJECT_MODE` to 64:
+```
+export OBJECT_MODE=64
+```
+Otherwise, leave `OBJECT_MODE` unset.
+
+Then clone the zeroc-ice/mcpp repository and build with gmake:
+```
+git clone https://github.com/zeroc-ice/mcpp.git
+cd mcpp
+gmake
+```
+
+This build creates a static library, `lib/libmcpp.a`. `libmcpp.a` is used
+only when building Ice from sources, and does not need to be installed.
+
+### Building Berkeley DB from Sources
+
+#### Download Sources
+
+Download the Berkeley DB 5.3.28 source archive from [Oracle][3] or ZeroC. You
+may use the distribution with encryption or without encryption. Since Ice does
+not use Berkeley DB's encryption features, we recommend downloading the
+no-encryption (-NC) source archive:
+
+```
+wget http://zeroc.com/download/berkeley-db/db-5.3.28.NC.tar.gz
+```
+
+Then unpack this archive:
+```
+gtar xzf db-5.3.28.NC.tar.gz
+```
+
+#### Patch
+
+Patch Berkeley DB with GNU patch:
+```
+wget http://zeroc.com/download/berkeley-db/berkeley-db.5.3.28.patch
+cd db-5.3.28.NC
+/opt/freeware/bin/patch -p0 < ../berkeley-db.5.3.28.patch
+```
+
+#### Configure
+
+If building 64-bit binaries, set `OBJECT_MODE` to 64:
+```
+export OBJECT_MODE=64
+```
+Otherwise, leave `OBJECT_MODE` unset.
+
+Then configure Berkeley DB with C++ support, and set the installation prefix,
+for example:
+```
+cd build_unix
+../dist/configure --enable-cxx --prefix=/opt/db53
+```
+
+#### Build and Install
+```
+gmake
+...
+
+# run gmake install as root or change permissions on /opt/db53 before install
+gmake install
+```
+
+## Building Ice for C++
+
+### Clone zeroc-ice/ice
+
+```
+git clone -b 3.6 https://github.com/zeroc-ice/ice.git
+cd ice/cpp
+```
+
+### Configure
+
+Edit `config/Make.rules` to establish your build configuration. The comments
+in the file provide more information.
+
+Make sure to set `DB_HOME` to your Berkeley DB 5.3 installation directory
+(`/opt/db53` if built as described above), and `MCPP_HOME` to your mcpp build
+directory (for example `$(HOME)/builds/mcpp`).
+
+`LP64` is not used on AIX. To build 64 bit binaries, set the environment
+variable `OBJECT_MODE` to 64:
+```
+export OBJECT_MODE=64
+```
+Otherwise, leave this environment variable unset.
+
+### Build
+
+Use the gmake `-j` option to speed up the build:
+
+```
+gmake -j8
+```
+
+This builds the Ice core libraries, services, and tests.
+
+### Install
+
+```
+gmake install
+```
+
+This installs Ice for C++ in the directory specified by `prefix` in
+`config/Make.rules`. By default, all Ice binaries embed the library path
+`prefix/lib:$DB_HOME/lib:/usr/lib`.
+
+After installation, make sure that the `prefix/bin` directory is in your `PATH`.
+
+### Run the Test Suite (Optional)
+
+Python is required to run the test suite. You can install Python as follows:
+```
+# As root
+rpm -i ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/python/python-2.7.10-1.aix6.1.ppc.rpm
+rpm -i ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/python/python-tools-2.7.10-1.aix6.1.ppc.rpm
+rpm -i ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/python/python-devel-2.7.10-1.aix6.1.ppc.rpm
+```
+
+Additionally, the Glacier2 tests require the Python module `passlib`, available
+from the Python Package Index:
+```
+# As root
+wget https://bootstrap.pypa.io/get-pip.py
+python get-pip.py
+export PATH=/opt/freeware/bin:$PATH
+pip install passlib
+```
+
+Then run the test suite with:
+```
+python allTests.py
+```
+
+If everything worked out, you should see lots of `ok` messages. In case of a
+failure, the tests abort with `failed`.
+
+[1]: http://www-03.ibm.com/systems/power/software/aix/linux
+[2]: http://www.bullfreeware.com
+[3]: http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index.html
diff --git a/cpp/config/Make.rules b/cpp/config/Make.rules
index 52c625cd278..c3170555785 100644
--- a/cpp/config/Make.rules
+++ b/cpp/config/Make.rules
@@ -292,6 +292,10 @@ else
endif
endif
+ifeq ($(MAKEDEPENDFLAGS),)
+ MAKEDEPENDFLAGS := -MMD
+endif
+
ifeq ($(FLEX_NOLINE),yes)
FLEXFLAGS := -L
else
@@ -382,9 +386,8 @@ endif
all:: $(TARGETS)
.cpp.o:
- $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $<
@mkdir -p .depend
- @$(CXX) -DMAKEDEPEND -MM $(CPPFLAGS) $< > .depend/$(*F).d
+ $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(MAKEDEPENDFLAGS) $< -MF .depend/$(*F).d
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
diff --git a/cpp/config/Make.rules.AIX b/cpp/config/Make.rules.AIX
index 5ac5108cad3..bc7d80a3908 100644
--- a/cpp/config/Make.rules.AIX
+++ b/cpp/config/Make.rules.AIX
@@ -7,22 +7,17 @@
#
# **********************************************************************
-$(warning ===================================================================)
-$(warning AIX is currently an unsupported platform. The Ice team does)
-$(warning not maintain AIX specific portions of the source code or build)
-$(warning system. Contact sales@zeroc.com if you wish to sponsor official)
-$(warning support.)
-$(warning ===================================================================)
-
#
# This file is included by Make.rules when uname is AIX.
#
CXX = xlC_r
-CC = xlc_r -qcpluscmt
+CC = xlc_r
+
+XLC_COMPILER = yes
-#
-# -qstaticinline: make inline functions that were not inlined (typically
+#
+# -qstaticinline: make inline functions that were not inlined (typically
# in debug mode or when the function is too big) static instead of
# extern (the default). This eliminates lots of "Duplicate symbol"
# warnings at link time, and surprisingly reduces the size of the
@@ -33,27 +28,51 @@ CC = xlc_r -qcpluscmt
# std::_LSF_ON. It would be nice to find a better solution, and get
# rid of this define.
#
-# -qalign=natural: You should add this option if you plan to use or
-# build Ice with libraries built with GCC. The default alignment for GCC
+# -qalign=natural: You should add this option if you plan to use or
+# build Ice with libraries built with GCC. The default alignment for GCC
# is "natural", while the default for xlC is "power".
#
ifneq ($(OBJECT_MODE),64)
- CXXARCHFLAGS += -D_LARGE_FILES
+ CXXARCHFLAGS += -D_LARGE_FILES
endif
-CXXFLAGS = -brtl -qrtti=all -qstaticinline $(CXXARCHFLAGS)
+CXXFLAGS = -brtl -qrtti=all -qstaticinline -qhalt=i $(CXXARCHFLAGS)
+
+MAKEDEPENDFLAGS = -qmakedep=gcc
ifeq ($(OPTIMIZE),yes)
- CXXFLAGS += -O2 -DNDEBUG -qinline
+ CXXFLAGS += -O2 -DNDEBUG -qinline -qmaxmem=65536
else
CXXFLAGS += -g
endif
+ifeq ($(embedded_runpath),yes)
+ #
+ # Our default for embedded runpath prefix on AIX is $(prefix)
+ #
+ ifeq ($(embedded_runpath_prefix),)
+ embedded_runpath_prefix = $(prefix)
+ endif
+endif
+
+#
+# Note that this -blibpath is only useful for programs; for shared objects,
+# such as libFreze.so.xx, it's only there "for info".
+# When embedded_runpath_prefix and DB_HOME are both set, we embed DB_HOME/lib as
+# well because icebox needs it to load successfully the IceStormService.
+#
ifneq ($(embedded_runpath_prefix),)
- LDPLATFORMFLAGS = -Wl,-blibpath:$(runpath_libdir):/usr/lpp/xlopt:/usr/lib/threads:/usr/vacpp/lib:/usr/lib:/lib
+
+ ifneq ($(DB_HOME),)
+ runpath_libdir = $(embedded_runpath_prefix)/$(libsubdir):$(DB_HOME)/$(libsubdir)
+ else
+ runpath_libdir = $(embedded_runpath_prefix)/$(libsubdir)
+ endif
+
+ LDPLATFORMFLAGS = -Wl,-blibpath:$(runpath_libdir):/usr/lib
else
- LDPLATFORMFLAGS = -Wl,-blibpath:/usr/lpp/xlopt:/usr/lib/threads:/usr/vacpp/lib:/usr/lib:/lib
+ LDPLATFORMFLAGS = -Wl,-blibpath:/usr/lib
endif
mklibfilename = lib$(1).a
@@ -75,6 +94,8 @@ installlib = $(INSTALL) $(2)/$(3) $(1)
BASELIBS = -lIceUtil
LIBS = -lIce $(BASELIBS)
+ICONV_LIB = -liconv
+
ICEUTIL_OS_LIBS = -lcrypto
ICE_OS_LIBS =
diff --git a/cpp/config/Make.rules.Darwin b/cpp/config/Make.rules.Darwin
index 478ad229617..90b82bee1c0 100644
--- a/cpp/config/Make.rules.Darwin
+++ b/cpp/config/Make.rules.Darwin
@@ -18,6 +18,9 @@ CXX = xcrun clang++
CPPFLAGS += -pthread -fvisibility=hidden
CXXFLAGS += -Wall -Werror -mmacosx-version-min=$(OSX_TARGET_MIN_SDK_VERSION)
+# clang++ accepts most g++ options
+GCC_COMPILER := yes
+
# If MAXWARN is set then enable extra warnings
ifeq ($(MAXWARN),yes)
CXXFLAGS += -Wextra -Wshadow -Wredundant-decls
diff --git a/cpp/include/Ice/SlicedData.h b/cpp/include/Ice/SlicedData.h
index 5168890c567..919dc54c187 100644
--- a/cpp/include/Ice/SlicedData.h
+++ b/cpp/include/Ice/SlicedData.h
@@ -69,7 +69,13 @@ public:
//
// Unknown sliced object holds instance of unknown type.
//
+
+#ifdef __IBMCPP__
+// xlC does not handle properly the public/private multiple inheritance from Object
+class ICE_API UnknownSlicedObject : public IceInternal::GCObject
+#else
class ICE_API UnknownSlicedObject : virtual public Object, private IceInternal::GCObject
+#endif
{
public:
diff --git a/cpp/include/IceUtil/Config.h b/cpp/include/IceUtil/Config.h
index c70f6350a77..0f8d19b8a26 100644
--- a/cpp/include/IceUtil/Config.h
+++ b/cpp/include/IceUtil/Config.h
@@ -175,6 +175,17 @@
# include <TargetConditionals.h>
#endif
+#if defined(_AIX) && defined(_LARGE_FILES)
+ // defines macros such as open that we want to use consistently everywhere
+# include <fcntl.h>
+#endif
+
+#ifdef __IBMCPP__
+// TODO: better fix for this warning
+# pragma report(disable, "1540-0198") // private inheritance without private keyword
+#endif
+
+
#if !defined(ICE_BUILDING_ICE_UTIL) && defined(ICE_UTIL_API_EXPORTS)
# define ICE_BUILDING_ICE_UTIL
#endif
diff --git a/cpp/src/Freeze/BackgroundSaveEvictorI.h b/cpp/src/Freeze/BackgroundSaveEvictorI.h
index a328f1ecb8a..f3af1e6e475 100644
--- a/cpp/src/Freeze/BackgroundSaveEvictorI.h
+++ b/cpp/src/Freeze/BackgroundSaveEvictorI.h
@@ -15,19 +15,6 @@
namespace Freeze
{
-
-#if defined(_MSC_VER) && (_MSC_VER <= 1200) || defined(__IBMCPP__)
-
- enum
- {
- clean = 0,
- created = 1,
- modified = 2,
- destroyed = 3,
- dead = 4
- };
-
-#else
//
// Clean object; can become modified or destroyed
//
@@ -55,9 +42,6 @@ namespace Freeze
//
static const Ice::Byte dead = 4;
-#endif
-
-
class BackgroundSaveEvictorI;
struct BackgroundSaveEvictorElement;
diff --git a/cpp/src/Freeze/MapI.cpp b/cpp/src/Freeze/MapI.cpp
index a12ef25b0b8..a94c79e6d5c 100644
--- a/cpp/src/Freeze/MapI.cpp
+++ b/cpp/src/Freeze/MapI.cpp
@@ -2093,28 +2093,28 @@ Freeze::MapIndexI::secondaryKeyCreate(Db* /*secondary*/, const Dbt* /*dbKey*/, c
// Print for the various exception types.
//
void
-Freeze::DeadlockException::ice_print(ostream& out) const
+Freeze::DeadlockException::ice_print(std::ostream& out) const
{
Exception::ice_print(out);
out << ":\ndatabase deadlock:\n" << message;
}
void
-Freeze::NotFoundException::ice_print(ostream& out) const
+Freeze::NotFoundException::ice_print(std::ostream& out) const
{
Exception::ice_print(out);
out << ":\ndatabase record not found:\n" << message;
}
void
-Freeze::DatabaseException::ice_print(ostream& out) const
+Freeze::DatabaseException::ice_print(std::ostream& out) const
{
Exception::ice_print(out);
out << ":\n" << message;
}
void
-Freeze::IndexNotFoundException::ice_print(ostream& out) const
+Freeze::IndexNotFoundException::ice_print(std::ostream& out) const
{
Exception::ice_print(out);
out << ":\ncould not find index \"" << indexName << "\" on map \"" << mapName << "\"";
diff --git a/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifierI.cpp b/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifierI.cpp
index af9630db528..9bc1ea38a5c 100644
--- a/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifierI.cpp
+++ b/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifierI.cpp
@@ -14,8 +14,9 @@
#include <IceUtil/FileUtil.h>
#include <IceUtil/StringUtil.h>
#include <IceUtil/InputUtil.h>
+#include <IceUtil/Mutex.h>
-#if defined(__GLIBC__)
+#if defined(__GLIBC__) || defined(_AIX)
# include <crypt.h>
#elif defined(__APPLE__)
# include <CoreFoundation/CoreFoundation.h>
@@ -44,6 +45,7 @@ public:
private:
const map<string, string> _passwords;
+ IceUtil::Mutex _cryptMutex; // for old thread-unsafe crypt()
};
class CryptPermissionsVerifierPlugin : public Ice::Plugin
@@ -51,12 +53,12 @@ class CryptPermissionsVerifierPlugin : public Ice::Plugin
public:
CryptPermissionsVerifierPlugin(const CommunicatorPtr&);
-
+
virtual void initialize();
virtual void destroy();
private:
-
+
CommunicatorPtr _communicator;
};
@@ -165,7 +167,7 @@ CryptPermissionsVerifierI::checkPermissions(const string& userId, const string&
struct crypt_data data;
data.initialized = 0;
return p->second == crypt_r(password.c_str(), salt.c_str(), &data);
-#elif defined(__APPLE__) || defined(_WIN32)
+#elif defined(__APPLE__) || defined(_WIN32)
//
// Pbkdf2 string format:
//
@@ -174,7 +176,7 @@ CryptPermissionsVerifierI::checkPermissions(const string& userId, const string&
//
size_t beg = 0;
size_t end = 0;
-
+
//
// Determine the digest algorithm
//
@@ -373,7 +375,7 @@ CryptPermissionsVerifierI::checkPermissions(const string& userId, const string&
vector<BYTE> passwordBuffer(password.begin(), password.end());
- DWORD status = BCryptDeriveKeyPBKDF2(algorithmHandle, &passwordBuffer[0],
+ DWORD status = BCryptDeriveKeyPBKDF2(algorithmHandle, &passwordBuffer[0],
static_cast<DWORD>(passwordBuffer.size()),
&saltBuffer[0], saltLength, rounds,
&checksumBuffer1[0], static_cast<DWORD>(checksumLength), 0);
@@ -388,7 +390,7 @@ CryptPermissionsVerifierI::checkPermissions(const string& userId, const string&
DWORD checksumBuffer2Length = checksumLength;
vector<BYTE> checksumBuffer2(checksumLength);
- if(!CryptStringToBinary(checksum.c_str(), static_cast<DWORD>(checksum.size()),
+ if(!CryptStringToBinary(checksum.c_str(), static_cast<DWORD>(checksum.size()),
CRYPT_STRING_BASE64, &checksumBuffer2[0],
&checksumBuffer2Length, 0, 0))
{
@@ -397,7 +399,17 @@ CryptPermissionsVerifierI::checkPermissions(const string& userId, const string&
return checksumBuffer1 == checksumBuffer2;
# endif
#else
-# error Password hashing not implemented
+ // Fallback to plain crypt() - DES-style
+
+ if(p->second.size() != 13)
+ {
+ return false;
+ }
+ string salt = p->second.substr(0, 2);
+
+ IceUtil::Mutex::Lock lock(_cryptMutex);
+ return p->second == crypt(password.c_str(), salt.c_str());
+
#endif
}
@@ -412,13 +424,13 @@ CryptPermissionsVerifierPlugin::initialize()
{
const string prefix = "Glacier2CryptPermissionsVerifier.";
const PropertyDict props = _communicator->getProperties()->getPropertiesForPrefix(prefix);
-
+
if(!props.empty())
{
ObjectAdapterPtr adapter = _communicator->createObjectAdapter(""); // colloc-only adapter
-
+
// Each prop represents a property to set + the associated password file
-
+
for(PropertyDict::const_iterator p = props.begin(); p != props.end(); ++p)
{
string name = p->first.substr(prefix.size());
@@ -426,9 +438,9 @@ CryptPermissionsVerifierPlugin::initialize()
id.name = IceUtil::generateUUID();
id.category = "Glacier2CryptPermissionsVerifier";
ObjectPrx prx = adapter->add(new CryptPermissionsVerifierI(retrievePasswordMap(p->second)), id);
- _communicator->getProperties()->setProperty(name, _communicator->proxyToString(prx));
+ _communicator->getProperties()->setProperty(name, _communicator->proxyToString(prx));
}
-
+
adapter->activate();
}
}
@@ -463,7 +475,7 @@ createCryptPermissionsVerifier(const CommunicatorPtr& communicator, const string
out << "Plugin " << name << ": too many arguments";
return 0;
}
-
+
return new CryptPermissionsVerifierPlugin(communicator);
}
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index c08a021c02f..27826fd75f5 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -61,7 +61,7 @@
# include <sys/types.h>
#endif
-#if defined(__linux) || defined(__sun)
+#if defined(__linux) || defined(__sun) || defined(_AIX)
# include <grp.h> // for initgroups
#endif
diff --git a/cpp/src/Ice/PluginManagerI.cpp b/cpp/src/Ice/PluginManagerI.cpp
index e424f9c7794..2152d955cbd 100644
--- a/cpp/src/Ice/PluginManagerI.cpp
+++ b/cpp/src/Ice/PluginManagerI.cpp
@@ -480,6 +480,11 @@ Ice::PluginManagerI::loadPlugin(const string& name, const string& pluginSpec, St
ex.reason = out.str();
throw ex;
}
+#ifdef __IBMCPP__
+ // xlC warns when casting a void* to function pointer
+#pragma report(disable, "1540-0216")
+#endif
+
factory = reinterpret_cast<PLUGIN_FACTORY>(sym);
}
diff --git a/cpp/src/Ice/RetryQueue.cpp b/cpp/src/Ice/RetryQueue.cpp
index aff3ff67f96..c9513f1710c 100644
--- a/cpp/src/Ice/RetryQueue.cpp
+++ b/cpp/src/Ice/RetryQueue.cpp
@@ -116,7 +116,7 @@ IceInternal::RetryQueue::destroy()
Lock sync(*this);
assert(_instance);
- set<RetryTaskPtr>::const_iterator p = _requests.begin();
+ set<RetryTaskPtr>::iterator p = _requests.begin();
while(p != _requests.end())
{
if(_instance->timer()->cancel(*p))
diff --git a/cpp/src/Ice/WSConnector.h b/cpp/src/Ice/WSConnector.h
index 17c002a8db0..3c26a06ab45 100644
--- a/cpp/src/Ice/WSConnector.h
+++ b/cpp/src/Ice/WSConnector.h
@@ -33,12 +33,12 @@ public:
virtual bool operator!=(const Connector&) const;
virtual bool operator<(const Connector&) const;
-private:
WSConnector(const ProtocolInstancePtr&, const ConnectorPtr&, const std::string&, int, const std::string&);
virtual ~WSConnector();
- friend class WSEndpoint;
+private:
+
const ProtocolInstancePtr _instance;
const ConnectorPtr _delegate;
const std::string _host;
diff --git a/cpp/src/IceBox/ServiceManagerI.cpp b/cpp/src/IceBox/ServiceManagerI.cpp
index 3f21bcc6e25..695b2bf47c1 100644
--- a/cpp/src/IceBox/ServiceManagerI.cpp
+++ b/cpp/src/IceBox/ServiceManagerI.cpp
@@ -664,6 +664,11 @@ IceBox::ServiceManagerI::start(const string& service, const string& entryPoint,
//
// Invoke the factory function.
//
+#ifdef __IBMCPP__
+ // xlC warns when casting a void* to function pointer
+# pragma report(disable, "1540-0216")
+#endif
+
SERVICE_FACTORY factory = reinterpret_cast<SERVICE_FACTORY>(sym);
try
{
diff --git a/cpp/src/IceGrid/Activator.cpp b/cpp/src/IceGrid/Activator.cpp
index 3127ed47f83..b9aafc93d7b 100644
--- a/cpp/src/IceGrid/Activator.cpp
+++ b/cpp/src/IceGrid/Activator.cpp
@@ -37,7 +37,7 @@
#endif
#endif
-#if defined(__linux) || defined(__sun)
+#if defined(__linux) || defined(__sun) || defined(_AIX)
# include <grp.h> // for initgroups
#endif
diff --git a/cpp/src/IceGridLib/PluginFacadeI.cpp b/cpp/src/IceGridLib/PluginFacadeI.cpp
index 6bcd4f92358..0b1748a852b 100644
--- a/cpp/src/IceGridLib/PluginFacadeI.cpp
+++ b/cpp/src/IceGridLib/PluginFacadeI.cpp
@@ -18,7 +18,7 @@ using namespace IceGrid;
namespace
{
-RegistryPluginFacadePtr pluginFacade;
+RegistryPluginFacade* pluginFacade = 0;
};
@@ -38,5 +38,13 @@ IceGrid::getRegistryPluginFacade()
void
IceGrid::setRegistryPluginFacade(const RegistryPluginFacadePtr& facade)
{
- pluginFacade = facade;
+ if(pluginFacade)
+ {
+ pluginFacade->__decRef();
+ }
+ pluginFacade = facade.get();
+ if(pluginFacade)
+ {
+ pluginFacade->__incRef();
+ }
}
diff --git a/cpp/src/IcePatch2Lib/Makefile b/cpp/src/IcePatch2Lib/Makefile
index e8b6d4e5565..4c1f938f0ee 100644
--- a/cpp/src/IcePatch2Lib/Makefile
+++ b/cpp/src/IcePatch2Lib/Makefile
@@ -27,7 +27,13 @@ SDIR = $(slicedir)/IcePatch2
include $(top_srcdir)/config/Make.rules
-CPPFLAGS := -I. -I.. $(CPPFLAGS) $(BZIP2_FLAGS) -Wno-deprecated-declarations
+CPPFLAGS := -I. -I.. $(CPPFLAGS) $(BZIP2_FLAGS)
+
+ifeq ($(GCC_COMPILER),yes)
+ CPPFLAGS := $(CPPFLAGS) -Wno-deprecated-declarations
+endif
+
+
SLICE2CPPFLAGS := --ice --include-dir IcePatch2 --dll-export ICE_PATCH2_API $(SLICE2CPPFLAGS)
LINKWITH := $(BZIP2_RPATH_LINK) -lIce -lIceUtil $(BZIP2_LIBS)
diff --git a/cpp/src/Slice/PythonUtil.cpp b/cpp/src/Slice/PythonUtil.cpp
index 4848dfcbcff..0caebc4ef4d 100644
--- a/cpp/src/Slice/PythonUtil.cpp
+++ b/cpp/src/Slice/PythonUtil.cpp
@@ -518,17 +518,7 @@ Slice::Python::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
//
ClassList allBases = p->allBases();
StringList ids;
-#if defined(__IBMCPP__) && defined(NDEBUG)
-//
-// VisualAge C++ 6.0 does not see that ClassDef is a Contained,
-// when inlining is on. The code below issues a warning: better
-// than an error!
-//
- transform(allBases.begin(), allBases.end(), back_inserter(ids),
- IceUtil::constMemFun<string,ClassDef>(&Contained::scoped));
-#else
transform(allBases.begin(), allBases.end(), back_inserter(ids), IceUtil::constMemFun(&Contained::scoped));
-#endif
StringList other;
other.push_back(scoped);
other.push_back("::Ice::Object");
diff --git a/cpp/src/Slice/RubyUtil.cpp b/cpp/src/Slice/RubyUtil.cpp
index 3639a53b185..6364e88133e 100644
--- a/cpp/src/Slice/RubyUtil.cpp
+++ b/cpp/src/Slice/RubyUtil.cpp
@@ -245,17 +245,7 @@ Slice::Ruby::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
//
ClassList allBases = p->allBases();
StringList ids;
-#if defined(__IBMCPP__) && defined(NDEBUG)
-//
-// VisualAge C++ 6.0 does not see that ClassDef is a Contained,
-// when inlining is on. The code below issues a warning: better
-// than an error!
-//
- transform(allBases.begin(), allBases.end(), back_inserter(ids),
- IceUtil::constMemFun<string,ClassDef>(&Contained::scoped));
-#else
transform(allBases.begin(), allBases.end(), back_inserter(ids), IceUtil::constMemFun(&Contained::scoped));
-#endif
StringList other;
other.push_back(scoped);
other.push_back("::Ice::Object");
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 05de885e742..6da3a90e809 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -3088,16 +3088,7 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p)
ClassList allBases = p->allBases();
StringList ids;
-#if defined(__IBMCPP__) && defined(NDEBUG)
-//
-// VisualAge C++ 6.0 does not see that ClassDef is a Contained,
-// when inlining is on. The code below issues a warning: better
-// than an error!
-//
- transform(allBases.begin(), allBases.end(), back_inserter(ids), ::IceUtil::constMemFun<string,ClassDef>(&Contained::scoped));
-#else
transform(allBases.begin(), allBases.end(), back_inserter(ids), ::IceUtil::constMemFun(&Contained::scoped));
-#endif
StringList other;
other.push_back(p->scoped());
other.push_back("::Ice::Object");
@@ -3211,16 +3202,9 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p)
if(!allOps.empty())
{
StringList allOpNames;
-#if defined(__IBMCPP__) && defined(NDEBUG)
-//
-// See comment for transform above
-//
- transform(allOps.begin(), allOps.end(), back_inserter(allOpNames),
- ::IceUtil::constMemFun<string,Operation>(&Contained::name));
-#else
transform(allOps.begin(), allOps.end(), back_inserter(allOpNames),
::IceUtil::constMemFun(&Contained::name));
-#endif
+
allOpNames.push_back("ice_id");
allOpNames.push_back("ice_ids");
allOpNames.push_back("ice_isA");
diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp
index 76ef3049cbc..59c2ccae3ad 100644
--- a/cpp/src/slice2cs/Gen.cpp
+++ b/cpp/src/slice2cs/Gen.cpp
@@ -714,18 +714,7 @@ Slice::CsVisitor::writeDispatchAndMarshalling(const ClassDefPtr& p, bool stream)
StringList ids;
ClassList bases = p->bases();
bool hasBaseClass = !bases.empty() && !bases.front()->isInterface();
-
-#if defined(__IBMCPP__) && defined(NDEBUG)
- //
- // VisualAge C++ 6.0 does not see that ClassDef is a Contained,
- // when inlining is on. The code below issues a warning: better
- // than an error!
- //
- transform(allBases.begin(), allBases.end(), back_inserter(ids), constMemFun<string,ClassDef>(&Contained::scoped));
-#else
transform(allBases.begin(), allBases.end(), back_inserter(ids), constMemFun(&Contained::scoped));
-#endif
-
StringList other;
other.push_back(p->scoped());
other.push_back("::Ice::Object");
@@ -1130,14 +1119,7 @@ Slice::CsVisitor::writeDispatchAndMarshalling(const ClassDefPtr& p, bool stream)
if(!allOps.empty() || (!p->isInterface() && !hasBaseClass))
{
StringList allOpNames;
-#if defined(__IBMCPP__) && defined(NDEBUG)
- //
- // See comment for transform above
- //
- transform(allOps.begin(), allOps.end(), back_inserter(allOpNames), constMemFun<string,Operation>(&Contained::name));
-#else
transform(allOps.begin(), allOps.end(), back_inserter(allOpNames), constMemFun(&Contained::name));
-#endif
allOpNames.push_back("ice_id");
allOpNames.push_back("ice_ids");
allOpNames.push_back("ice_isA");
@@ -6061,16 +6043,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p)
string scoped = p->scoped();
ClassList allBases = p->allBases();
StringList ids;
-#if defined(__IBMCPP__) && defined(NDEBUG)
- //
- // VisualAge C++ 6.0 does not see that ClassDef is a Contained,
- // when inlining is on. The code below issues a warning: better
- // than an error!
- //
- transform(allBases.begin(), allBases.end(), back_inserter(ids), ::IceUtil::constMemFun<string,ClassDef>(&Contained::scoped));
-#else
transform(allBases.begin(), allBases.end(), back_inserter(ids), ::IceUtil::constMemFun(&Contained::scoped));
-#endif
StringList other;
other.push_back(p->scoped());
other.push_back("::Ice::Object");
diff --git a/cpp/src/slice2js/Gen.cpp b/cpp/src/slice2js/Gen.cpp
index 573d0180c67..9e55b8b65f2 100644
--- a/cpp/src/slice2js/Gen.cpp
+++ b/cpp/src/slice2js/Gen.cpp
@@ -1294,17 +1294,7 @@ Slice::Gen::TypesVisitor::visitClassDefStart(const ClassDefPtr& p)
_out << ", undefined";
}
-#if defined(__IBMCPP__) && defined(NDEBUG)
- //
- // VisualAge C++ 6.0 does not see that ClassDef is a Contained,
- // when inlining is on. The code below issues a warning: better
- // than an error!
- //
- transform(allBases.begin(), allBases.end(), back_inserter(ids),
- ::IceUtil::constMemFun<string,ClassDef>(&Contained::scoped));
-#else
transform(allBases.begin(), allBases.end(), back_inserter(ids), ::IceUtil::constMemFun(&Contained::scoped));
-#endif
StringList other;
other.push_back(scoped);
other.push_back("::Ice::Object");
diff --git a/cpp/test/Ice/operations/Makefile b/cpp/test/Ice/operations/Makefile
index f19a50642a5..2cfbc69f2d5 100644
--- a/cpp/test/Ice/operations/Makefile
+++ b/cpp/test/Ice/operations/Makefile
@@ -54,7 +54,12 @@ OBJS = $(COBJS) \
include $(top_srcdir)/config/Make.rules
-CPPFLAGS := -I. -I../../include $(CPPFLAGS)
+CPPFLAGS := -I. -I../../include $(CPPFLAGS)
+
+ifeq ($(XLC_COMPILER),yes)
+ CPPFLAGS := -qsuppress="1540-0895" $(CPPFLAGS)
+endif
+
$(CLIENT): $(COBJS)
rm -f $@
diff --git a/cpp/test/Ice/properties/run.py b/cpp/test/Ice/properties/run.py
index e50cca27fe7..3a4d9e21d24 100755
--- a/cpp/test/Ice/properties/run.py
+++ b/cpp/test/Ice/properties/run.py
@@ -9,7 +9,7 @@
#
# **********************************************************************
-import os, sys
+import os, sys, locale
path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
head = os.path.dirname(sys.argv[0])
@@ -23,6 +23,13 @@ import TestUtil
client = os.path.join(os.getcwd(), "client")
+if TestUtil.isAIX():
+ encoding = locale.getdefaultlocale()[1]
+ if encoding != "UTF-8":
+ print("Please set LC_ALL to xx_xx.UTF-8, for example FR_FR.UTF-8")
+ print("Skipping test")
+ sys.exit(0)
+
#
# Write config
#
diff --git a/cpp/test/Ice/stringConverter/Client.cpp b/cpp/test/Ice/stringConverter/Client.cpp
index 89530b5b45b..c43a6454dd3 100644
--- a/cpp/test/Ice/stringConverter/Client.cpp
+++ b/cpp/test/Ice/stringConverter/Client.cpp
@@ -63,6 +63,28 @@ main(int argc, char* argv[])
IceUtil::setProcessStringConverter(new IceUtil::IconvStringConverter<char>("iso815"));
}
IceUtil::setProcessWstringConverter(new IceUtil::IconvStringConverter<wchar_t>("ucs4"));
+
+#elif defined(_AIX)
+
+ // Always big-endian
+
+ if(useLocale)
+ {
+ IceUtil::setProcessStringConverter(new IceUtil::IconvStringConverter<char>());
+ }
+ else
+ {
+ IceUtil::setProcessStringConverter(new IceUtil::IconvStringConverter<char>("ISO8859-15"));
+ }
+
+ if(sizeof(wchar_t) == 4)
+ {
+ IceUtil::setProcessWstringConverter(new IceUtil::IconvStringConverter<wchar_t>("UTF-32"));
+ }
+ else
+ {
+ IceUtil::setProcessWstringConverter(new IceUtil::IconvStringConverter<wchar_t>("UTF-16"));
+ }
#else
if(useLocale)
diff --git a/cpp/test/IceGrid/replicaGroup/RegistryPlugin.cpp b/cpp/test/IceGrid/replicaGroup/RegistryPlugin.cpp
index 9fcc117d627..6172e9e689e 100644
--- a/cpp/test/IceGrid/replicaGroup/RegistryPlugin.cpp
+++ b/cpp/test/IceGrid/replicaGroup/RegistryPlugin.cpp
@@ -52,8 +52,11 @@ public:
{
test(_facade->getApplicationInfo(_facade->getAdapterApplication(*p)).descriptor.name == "Test");
test(_facade->getServerInfo(_facade->getAdapterServer(*p)).application == "Test");
- test(_facade->getNodeInfo(_facade->getAdapterNode(*p)).name == "localnode");
+ test(_facade->getNodeInfo(_facade->getAdapterNode(*p)).name == "localnode");
+#ifndef _AIX
+ // On AIX, icegridnode needs read permissions on /dev/kmem
test(_facade->getNodeLoad(_facade->getAdapterNode(*p)).avg1 >= 0.0);
+#endif
test(_facade->getAdapterInfo(*p)[0].replicaGroupId == id);
test(_facade->getPropertyForAdapter(*p, "Identity") == id);
}
diff --git a/cpp/test/IceSSL/configuration/AllTests.cpp b/cpp/test/IceSSL/configuration/AllTests.cpp
index 4a0cad36e52..d0235809622 100644
--- a/cpp/test/IceSSL/configuration/AllTests.cpp
+++ b/cpp/test/IceSSL/configuration/AllTests.cpp
@@ -2024,9 +2024,9 @@ allTests(const CommunicatorPtr& communicator, const string& testDir, bool p12, b
#endif
//
- // No DSA support in Secure Transport.
+ // No DSA support in Secure Transport / AIX 7.1
//
-#ifndef ICE_USE_SECURE_TRANSPORT
+#if !defined(ICE_USE_SECURE_TRANSPORT) && !defined(_AIX)
{
//
@@ -3192,6 +3192,9 @@ allTests(const CommunicatorPtr& communicator, const string& testDir, bool p12, b
#endif
}
+#ifndef _AIX
+ // On AIX 6.1, the default root certificates don't validate demo.zeroc.com
+
cout << "testing system CAs... " << flush;
{
InitializationData initData;
@@ -3236,6 +3239,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir, bool p12, b
comm->destroy();
}
cout << "ok" << endl;
+#endif
if(shutdown)
{
diff --git a/cpp/test/IceSSL/configuration/run.py b/cpp/test/IceSSL/configuration/run.py
index 07e001c4fdc..fea76d43f3f 100755
--- a/cpp/test/IceSSL/configuration/run.py
+++ b/cpp/test/IceSSL/configuration/run.py
@@ -43,7 +43,7 @@ if TestUtil.isDarwin():
os.system("security create-keychain -p password %s" % keychainPath)
for cert in ["s_rsa_ca1.p12", "c_rsa_ca1.p12"]:
os.system("security import %s -f pkcs12 -A -P password -k %s" % (os.path.join(certsPath, cert), keychainPath))
-elif TestUtil.isLinux():
+elif TestUtil.isLinux() or TestUtil.isAIX():
#
# Create copies of the CA certificates named after the subject
# hash. This is used by the tests to find the CA certificates in
diff --git a/cpp/test/Slice/headers/run.py b/cpp/test/Slice/headers/run.py
index 6950839019d..907e9c937b4 100755
--- a/cpp/test/Slice/headers/run.py
+++ b/cpp/test/Slice/headers/run.py
@@ -37,6 +37,7 @@ os.symlink("a3.ice", os.path.join("slices", "dir1", "linktoa3.ice"))
os.symlink("dir2", os.path.join("slices", "linktodir2"))
slice2cpp = TestUtil.getSliceTranslator()
+TestUtil.addLdPath(TestUtil.getCppLibDir())
basedir = os.path.dirname(os.path.abspath(__file__))
slicedir = TestUtil.getSliceDir()