Skip to content

Commit 0b6e49a

Browse files
committed
HADOOP-7868. svn merge -c 1336491 from trunk
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2.0.0-alpha@1336493 13f79535-47bb-0310-9956-ffa450edef68
1 parent 50ad293 commit 0b6e49a

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

hadoop-common-project/hadoop-common/CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,9 @@ Release 2.0.0 - UNRELEASED
358358
HADOOP-8172. Configuration no longer sets all keys in a deprecated key
359359
list. (Anupam Seth via bobby)
360360

361+
HADOOP-7868. Hadoop native fails to compile when default linker
362+
option is -Wl,--as-needed. (Trevor Robinson via eli)
363+
361364
Release 0.23.3 - UNRELEASED
362365

363366
INCOMPATIBLE CHANGES

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# AC_COMPUTE_NEEDED_DSO(LIBRARY, PREPROC_SYMBOL)
1+
# AC_COMPUTE_NEEDED_DSO(LIBRARY, TEST_PROGRAM, PREPROC_SYMBOL)
22
# --------------------------------------------------
33
# Compute the 'actual' dynamic-library used
44
# for LIBRARY and set it to PREPROC_SYMBOL
55
AC_DEFUN([AC_COMPUTE_NEEDED_DSO],
66
[
77
AC_CACHE_CHECK([Checking for the 'actual' dynamic-library for '-l$1'], ac_cv_libname_$1,
88
[
9-
echo 'int main(int argc, char **argv){return 0;}' > conftest.c
9+
echo '$2' > conftest.c
1010
if test -z "`${CC} ${LDFLAGS} -o conftest conftest.c -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
@@ -24,5 +24,5 @@ AC_CACHE_CHECK([Checking for the 'actual' dynamic-library for '-l$1'], ac_cv_lib
2424
rm -f conftest*
2525
]
2626
)
27-
AC_DEFINE_UNQUOTED($2, ${ac_cv_libname_$1}, [The 'actual' dynamic-library for '-l$1'])
27+
AC_DEFINE_UNQUOTED($3, ${ac_cv_libname_$1}, [The 'actual' dynamic-library for '-l$1'])
2828
])# AC_COMPUTE_NEEDED_DSO

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,20 @@ CPPFLAGS=$cppflags_bak
8787
AC_SUBST([JNI_CPPFLAGS])
8888

8989
dnl Check for zlib headers
90-
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.))
90+
AC_CHECK_HEADERS([zlib.h zconf.h],
91+
AC_COMPUTE_NEEDED_DSO(z,
92+
[#include "zlib.h"
93+
int main(int argc, char **argv){zlibVersion();return 0;}],
94+
HADOOP_ZLIB_LIBRARY),
95+
AC_MSG_ERROR(Zlib headers were not found... native-hadoop library needs zlib to build. Please install the requisite zlib development package.))
9196

9297
dnl Check for snappy headers
93-
AC_CHECK_HEADERS([snappy-c.h], AC_COMPUTE_NEEDED_DSO(snappy,HADOOP_SNAPPY_LIBRARY), AC_MSG_WARN(Snappy headers were not found... building without snappy.))
98+
AC_CHECK_HEADERS([snappy-c.h],
99+
AC_COMPUTE_NEEDED_DSO(snappy,
100+
[#include "snappy-c.h"
101+
int main(int argc, char **argv){snappy_compress(0,0,0,0);return 0;}],
102+
HADOOP_SNAPPY_LIBRARY),
103+
AC_MSG_WARN(Snappy headers were not found... building without snappy.))
94104

95105
dnl Check for headers needed by the native Group resolution implementation
96106
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h], [], AC_MSG_ERROR(Some system headers not found... please ensure their presence on your platform.))

0 commit comments

Comments
 (0)