diff --git a/CHANGES.txt b/CHANGES.txt index fd168c00464..f19a34e47fb 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -740,6 +740,9 @@ Release 0.22.0 - Unreleased HADOOP-7146. RPC server leaks file descriptors (todd) + HADOOP-7276. Hadoop native builds fail on ARM due to -m32 (Trevor Robinson + via eli) + Release 0.21.1 - Unreleased IMPROVEMENTS diff --git a/src/native/Makefile.am b/src/native/Makefile.am index 39192707f00..6475359fa71 100644 --- a/src/native/Makefile.am +++ b/src/native/Makefile.am @@ -36,8 +36,12 @@ AM_CPPFLAGS = @JNI_CPPFLAGS@ -I$(HADOOP_NATIVE_SRCDIR)/src \ -Isrc/org/apache/hadoop/io/compress/zlib \ -Isrc/org/apache/hadoop/security \ -Isrc/org/apache/hadoop/io/nativeio/ -AM_LDFLAGS = @JNI_LDFLAGS@ -m$(JVM_DATA_MODEL) -AM_CFLAGS = -g -Wall -fPIC -O2 -m$(JVM_DATA_MODEL) +AM_LDFLAGS = @JNI_LDFLAGS@ +AM_CFLAGS = -g -Wall -fPIC -O2 +if SPECIFY_DATA_MODEL +AM_LDFLAGS += -m$(JVM_DATA_MODEL) +AM_CFLAGS += -m$(JVM_DATA_MODEL) +endif lib_LTLIBRARIES = libhadoop.la libhadoop_la_SOURCES = src/org/apache/hadoop/io/compress/zlib/ZlibCompressor.c \ diff --git a/src/native/configure.ac b/src/native/configure.ac index c2d2dc18fcd..a1ce73c15c2 100644 --- a/src/native/configure.ac +++ b/src/native/configure.ac @@ -100,6 +100,8 @@ AC_CHECK_FUNCS([memset]) # Check for nonstandard STRERROR_R AC_FUNC_STRERROR_R +AM_CONDITIONAL([SPECIFY_DATA_MODEL], [case $host_cpu in arm*) false;; *) true;; esac]) + AC_CONFIG_FILES([Makefile]) AC_OUTPUT diff --git a/src/native/lib/Makefile.am b/src/native/lib/Makefile.am index 99c03602d1d..9b536ff440c 100644 --- a/src/native/lib/Makefile.am +++ b/src/native/lib/Makefile.am @@ -32,7 +32,10 @@ # Add .lo files in $(SUBDIRS) to construct libhadoop.so HADOOP_OBJS = $(foreach path,$(addprefix ../,$(SUBDIRS)),$(wildcard $(path)/*.lo)) -AM_LDFLAGS = @JNI_LDFLAGS@ -m$(JVM_DATA_MODEL) +AM_LDFLAGS = @JNI_LDFLAGS@ +if SPECIFY_DATA_MODEL +AM_LDFLAGS += -m$(JVM_DATA_MODEL) +endif lib_LTLIBRARIES = libhadoop.la libhadoop_la_SOURCES = diff --git a/src/native/src/org/apache/hadoop/io/compress/zlib/Makefile.am b/src/native/src/org/apache/hadoop/io/compress/zlib/Makefile.am index 7849ed77623..821f33f0527 100644 --- a/src/native/src/org/apache/hadoop/io/compress/zlib/Makefile.am +++ b/src/native/src/org/apache/hadoop/io/compress/zlib/Makefile.am @@ -39,7 +39,10 @@ vpath %.c $(HADOOP_NATIVE_SRCDIR)/$(subdir) AM_CPPFLAGS = @JNI_CPPFLAGS@ -I$(HADOOP_NATIVE_SRCDIR)/src AM_LDFLAGS = @JNI_LDFLAGS@ -AM_CFLAGS = -g -Wall -fPIC -O2 -m$(JVM_DATA_MODEL) +AM_CFLAGS = -g -Wall -fPIC -O2 +if SPECIFY_DATA_MODEL +AM_CFLAGS += -m$(JVM_DATA_MODEL) +endif noinst_LTLIBRARIES = libnativezlib.la libnativezlib_la_SOURCES = ZlibCompressor.c ZlibDecompressor.c