Skip to content

Commit 2717203

Browse files
authored
HADOOP-17569. Building native code fails on Fedora 33. (#2886)
1 parent 9179638 commit 2717203

File tree

2 files changed

+4
-2
lines changed
  • hadoop-common-project/hadoop-common/src/main/native/src
  • hadoop-hdfs-project/hadoop-hdfs-native-client/src

2 files changed

+4
-2
lines changed

hadoop-common-project/hadoop-common/src/main/native/src/exception.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ jthrowable newIOException(JNIEnv* env, const char *fmt, ...)
111111
const char* terror(int errnum)
112112
{
113113

114-
#if defined(__sun)
115-
// MT-Safe under Solaris which doesn't support sys_errlist/sys_nerr
114+
#if defined(__sun) || defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 32)
115+
// MT-Safe under Solaris or glibc >= 2.32 not supporting sys_errlist/sys_nerr
116116
return strerror(errnum);
117117
#else
118118
if ((errnum < 0) || (errnum >= sys_nerr)) {

hadoop-hdfs-project/hadoop-hdfs-native-client/src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ if(WIN32)
6969
set(OUT_DIR bin)
7070
else()
7171
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
72+
# using old default behavior on GCC >= 10.0
73+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcommon")
7274
set(OS_DIR ${CMAKE_SOURCE_DIR}/main/native/libhdfs/os/posix)
7375

7476
# IMPORTANT: OUT_DIR MUST be relative to maven's

0 commit comments

Comments
 (0)