Skip to content

Commit 98eb247

Browse files
author
James Page
committed
Fix native build for hadoop
1 parent 1f6aded commit 98eb247

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

hadoop-common-project/hadoop-common/src/main/native/acinclude.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ AC_DEFUN([AC_COMPUTE_NEEDED_DSO],
77
AC_CACHE_CHECK([Checking for the 'actual' dynamic-library for '-l$1'], ac_cv_libname_$1,
88
[
99
echo 'int main(int argc, char **argv){return 0;}' > conftest.c
10-
if test -z "`${CC} ${LDFLAGS} -o conftest conftest.c -l$1 2>&1`"; then
10+
if test -z "`${CC} ${LDFLAGS} -o conftest conftest.c ${DSO_LDFLAGS} -l$1 2>&1`"; then
1111
dnl Try objdump and ldd in that order to get the dynamic library
1212
if test ! -z "`which objdump | grep -v 'no objdump'`"; then
1313
ac_cv_libname_$1="`objdump -p conftest | grep NEEDED | grep $1 | sed 's/\W*NEEDED\W*\(.*\)\W*$/\"\1\"/'`"

hadoop-common-project/hadoop-common/src/main/native/configure.ac

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ AC_CHECK_HEADERS([jni.h], [], AC_MSG_ERROR([Native java headers not found. Is \$
8484
CPPFLAGS=$cppflags_bak
8585
AC_SUBST([JNI_CPPFLAGS])
8686

87+
dnl Setup linker flags for computing required DSO's
88+
DSO_LDFLAGS="-Wl,--no-as-needed"
89+
8790
dnl Check for zlib headers
8891
AC_CHECK_HEADERS([zlib.h zconf.h], AC_COMPUTE_NEEDED_DSO(z,HADOOP_ZLIB_LIBRARY), AC_MSG_ERROR(Zlib headers were not found... native-hadoop library needs zlib to build. Please install the requisite zlib development package.))
8992

0 commit comments

Comments
 (0)