Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
3.4.0
-
Windows 10
Description
The library target hdfspp_test_shim_static is built using the following sources, which causes duplicate symbols to be defined -
1. hdfs_shim.c
2. ${LIBHDFSPP_BINDING_C}/hdfs.cc
https://github.com/apache/hadoop/blob/8774f178686487007dcf8c418c989b785a529000/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/CMakeLists.txt#L153
And fails the compilation -
H:\hadoop-hdfs-project\hadoop-hdfs-native-client\src\out\build\x64-Debug\hdfspp_test_shim_static.lib(hdfs_shim.obj) : error LNK2005: hdfsAllowSnapshot already defined in hdfspp_test_shim_static.lib(hdfs.obj) H:\hadoop-hdfs-project\hadoop-hdfs-native-client\src\out\build\x64-Debug\hdfspp_test_shim_static.lib(hdfs_shim.obj) : error LNK2005: hdfsAvailable already defined in hdfspp_test_shim_static.lib(hdfs.obj) H:\hadoop-hdfs-project\hadoop-hdfs-native-client\src\out\build\x64-Debug\hdfspp_test_shim_static.lib(hdfs_shim.obj) : error LNK2005: hdfsBuilderConfSetStr already defined in hdfspp_test_shim_static.lib(hdfs.obj) H:\hadoop-hdfs-project\hadoop-hdfs-native-client\src\out\build\x64-Debug\hdfspp_test_shim_static.lib(hdfs_shim.obj) : error LNK2005: hdfsBuilderConnect already defined in hdfspp_test_shim_static.lib(hdfs.obj)
Duplicate symbols defined by hdfs_shim.c - https://github.com/apache/hadoop/blob/440f4c2b28515d2007b81ac00b549bbf14fa9f64/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/hdfs_shim.c#L583-L585.
Adding the source ${LIBHDFSPP_BINDING_C}/hdfs.cc is redundant here since this file is transitively included in hdfs_shim.c through libhdfspp_wrapper.h - https://github.com/apache/hadoop/blob/440f4c2b28515d2007b81ac00b549bbf14fa9f64/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/hdfs_shim.c#L20. Thus, we need to exclude ${LIBHDFSPP_BINDING_C}/hdfs.cc to fix this issue.
Attachments
Attachments
Issue Links
- is a child of
-
HADOOP-17193 Compile Hadoop on Windows natively
- Open
- links to