Skip to content

Commit

Permalink
aix gcc librados port
Browse files Browse the repository at this point in the history
Signed-off-by: Rohan Mars <[email protected]>
  • Loading branch information
rohanmars committed Nov 23, 2015
1 parent 90a37c7 commit a3a0e1c
Show file tree
Hide file tree
Showing 18 changed files with 394 additions and 20 deletions.
97 changes: 97 additions & 0 deletions README.aix
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@

The AIX build will only build the librados library.

Build Prerequisites
===================

The following AIX packages are required for developing and compilation, they have been installed via the AIX-rpm (rpm) packages:

AIX-rpm
tcl
tk
expect
curl
readline
libpng
mpfr
m4
autoconf
gettext
less
perl
gdbm
pcre
rsync
zlib
gcc-cpp
libffi
pkg-config
libiconv
glib2
info
libidn
openldap
python-tools
bzip2
python
sed
grep
libtool
nspr
nss-util
sqlite
nss-softokn
nss-softokn-freebl
libstdc++
gmp
coreutils
nss
nss-tools
nss-sysinit
nspr-devel
nss-util-devel
nss-softokn-devel
nss-softokn-freebl-devel
nss-devel
make
libsigsegv
automake
libmpc
libgcc
gcc
libstdc++-devel
gcc-c++
adns
tcsh
bash
getopt
db4
expat
tcl
freetype2
fontconfig
libXrender
libXft
tk
python-libs
tkinter
gdb
git


Download and Compile Boost 1.59 (or higher)

Building Ceph
=============

export CXX="c++ -maix64"
export CFLAGS="-g -maix64"
export OBJECT_MODE=64
export LDFLAGS="-L/usr/lib64 -L/opt/freeware/lib64 -L<pathtoboost>/boost_1_59_0/stage/lib -Wl,-brtl -Wl,-bbigtoc"
export CXXFLAGS="-I/opt/freeware/include -I<pathtoboost>/boost_1_59_0"

./autogen.sh
./configure --disable-server --without-fuse --without-tcmalloc --without-libatomic-ops --without-libaio --without-libxfs
cd src
gmake librados.la

6 changes: 4 additions & 2 deletions README.solaris
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ Download and Compile Boost 1.59 (or higher)
Building Ceph
=============

export LDFLAGS="-L<pathtoboost>/boost_1_59_0/stage/lib"
export CPPFLAGS="-I<pathtoboost>/boost/boost_1_59_0"
export LDFLAGS="-m64 -L<pathtoboost>/stage/lib -L/usr/lib/mps/64"
export CPPFLAGS="-m64 -I<pathtoboost>"
export CXXFLAGS="-m64"
export CFLAGS="-m64"

./autogen.sh
./configure --disable-server --without-fuse --without-tcmalloc --without-libatomic-ops --without-libaio --without-libxfs
Expand Down
20 changes: 17 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,15 @@ freebsd*)
solaris*)
solaris="yes"
;;
aix*)
aix="yes"
;;
esac
AM_CONDITIONAL(LINUX, test x"$linux" = x"yes")
AM_CONDITIONAL(FREEBSD, test x"$freebsd" = x"yes")
AM_CONDITIONAL(DARWIN, test x"$darwin" = x"yes")
AM_CONDITIONAL(SOLARIS, test x"$solaris" = x"yes")
AM_CONDITIONAL(AIX, test x"$aix" = x"yes")

# Checks for programs.
AC_PROG_CXX
Expand Down Expand Up @@ -266,6 +270,8 @@ AC_CHECK_CC_FLAG([-Wtype-limits], [WARN_TYPE_LIMITS])
AC_CHECK_CC_FLAG([-Wignored-qualifiers], [WARN_IGNORED_QUALIFIERS])
AC_CHECK_CC_FLAG([-Werror=format-security], [WARN_ERROR_FORMAT_SECURITY])

AC_CHECK_CC_FLAG([-rdynamic], [RDYNAMIC_FLAG])

# Check for compiler VTA support
AX_CHECK_COMPILE_FLAG([-fvar-tracking-assignments], [HAS_VTA_SUPPORT=1], [HAS_VTA_SUPPORT=0])
AM_CONDITIONAL(COMPILER_HAS_VTA, [test "$HAS_VTA_SUPPORT" = 1])
Expand Down Expand Up @@ -963,6 +969,7 @@ AC_CHECK_HEADERS([ \
sys/cdefs.h \
syslog.h \
utime.h \
execinfo.h
])

# name_to_handle_at
Expand Down Expand Up @@ -1000,9 +1007,16 @@ AC_CHECK_MEMBER([struct stat.st_mtimespec.tv_nsec],
[Define if you have struct stat.st_mtimespec.tv_nsec])])

# splice/tee
AC_CHECK_FUNC([splice],
[AC_DEFINE([CEPH_HAVE_SPLICE], [], [splice(2) is supported])],
[])
case "${target_os}" in
aix*)
# AIX splice() is something else
;;
*)
AC_CHECK_FUNC([splice],
[AC_DEFINE([CEPH_HAVE_SPLICE], [], [splice(2) is supported])],
[])
;;
esac

# F_SETPIPE_SZ in fcntl.h
AC_MSG_CHECKING([for F_SETPIPE_SZ in fcntl.h])
Expand Down
19 changes: 12 additions & 7 deletions src/Makefile-env.am
Original file line number Diff line number Diff line change
Expand Up @@ -118,28 +118,30 @@ AM_COMMON_CFLAGS = \
-fno-strict-aliasing \
-fsigned-char
if !CLANG
AM_COMMON_CFLAGS += -rdynamic
AM_COMMON_CFLAGS += ${RDYNAMIC_FLAG}
endif
if SOLARIS
AM_COMMON_CFLAGS += -Wno-unused-local-typedefs
endif

AM_CFLAGS = $(AM_COMMON_CFLAGS) $(HARDENING_CFLAGS)
AM_CFLAGS = $(AM_COMMON_CFLAGS)
if LINUX
AM_CFLAGS += $(HARDENING_CFLAGS)
endif
AM_CPPFLAGS = $(AM_COMMON_CPPFLAGS)
AM_CXXFLAGS = \
@AM_CXXFLAGS@ \
$(AM_COMMON_CFLAGS) \
-ftemplate-depth-1024 \
-Wnon-virtual-dtor \
-Wno-invalid-offsetof $(HARDENING_CFLAGS)
-Wno-invalid-offsetof
if LINUX
AM_CXXFLAGS += $(HARDENING_CFLAGS)
endif
if !CLANG
AM_CXXFLAGS += -Wstrict-null-sentinel
endif

# solaris harding
if SOLARIS
AM_CXXFLAGS += -lssp_nonshared
endif

# note: this is position dependant, it affects the -l options that
# come after it on the command line. when you use ${AM_LDFLAGS} in
Expand All @@ -153,6 +155,9 @@ AM_LDFLAGS =
if LINUX
AM_LDFLAGS += -Wl,--as-needed $(HARDENING_LDFLAGS)
endif
if AIX
AM_LDFLAGS += -Wl,-brtl -Wl,-bexpfull
endif

if USE_BOOST_SPIRIT_OLD_HDR
AM_CXXFLAGS += -DUSE_BOOST_SPIRIT_OLD_HDR
Expand Down
4 changes: 4 additions & 0 deletions src/common/BackTrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
#define CEPH_BACKTRACE_H

#include <iosfwd>
#ifdef HAVE_EXECINFO_H
#include <execinfo.h>
#endif
#include <stdlib.h>

namespace ceph {
Expand All @@ -16,8 +18,10 @@ struct BackTrace {
char **strings;

BackTrace(int s) : skip(s) {
#ifdef HAVE_EXECINFO_H
size = backtrace(array, max);
strings = backtrace_symbols(array, size);
#endif
}
~BackTrace() {
free(strings);
Expand Down
5 changes: 5 additions & 0 deletions src/common/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ libcommon_internal_la_SOURCES += \
common/solaris_errno.cc
endif

if AIX
libcommon_internal_la_SOURCES += \
common/aix_errno.cc
endif

if WITH_RBD
if LINUX
libcommon_internal_la_SOURCES += \
Expand Down
1 change: 1 addition & 0 deletions src/common/MemoryModel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "MemoryModel.h"
#include "common/config.h"
#include "debug.h"
#include <malloc.h>

#include <fstream>

Expand Down
2 changes: 1 addition & 1 deletion src/common/addr_parsing.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if defined(__FreeBSD__)
#if defined(__FreeBSD__) || defined(_AIX)
#include <sys/socket.h>
#include <netinet/in.h>
#endif
Expand Down
Loading

0 comments on commit a3a0e1c

Please sign in to comment.