Skip to content

HADOOP-19551. Fix compilation error of native libraries on newer GCC. #7644

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

iwasakims
Copy link
Member

https://issues.apache.org/jira/browse/HADOOP-19551

Building with -Pnative by using GCC 14 on Fedora 40 failed due to imcompatible changes of GCC.

-Wno-error=implicit-function-declaration should be added to CFLAGS in order to retain old behavior on GCC >= 14.

[WARNING] make[2]: *** [CMakeFiles/hadoop_static.dir/build.make:286: CMakeFiles/hadoop_static.dir/main/native/src/org/apache/hadoop/crypto/random/OpensslSecureRandom.c.o] Error 1
[WARNING] make[2]: *** Waiting for unfinished jobs....
[WARNING] /hadoop/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/crypto/random/OpensslSecureRandom.c: In function ‘locks_setup’:
[WARNING] /hadoop/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/crypto/random/OpensslSecureRandom.c:250:33: error: implicit declaration of function ‘dlsym_CRYPTO_num_locks’; did you mean ‘dlsym_CRYPTO_malloc’? [-Wimplicit-function-declaration]
[WARNING]   250 |   lock_cs = dlsym_CRYPTO_malloc(dlsym_CRYPTO_num_locks() *  \
[WARNING]       |                                 ^~~~~~~~~~~~~~~~~~~~~~
[WARNING]       |                                 dlsym_CRYPTO_malloc
[WARNING] /hadoop/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/crypto/random/OpensslSecureRandom.c:257:3: error: implicit declaration of function ‘dlsym_CRYPTO_set_id_callback’; did you mean ‘CRYPTO_set_id_callback’? [-Wimplicit-function-declaration]
[WARNING]   257 |   dlsym_CRYPTO_set_id_callback((unsigned long (*)())pthreads_thread_id);
[WARNING]       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
[WARNING]       |   CRYPTO_set_id_callback
[WARNING] /hadoop/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/crypto/random/OpensslSecureRandom.c:258:3: error: implicit declaration of function ‘dlsym_CRYPTO_set_locking_callback’; did you mean ‘CRYPTO_set_locking_callback’? [-Wimplicit-function-declaration]
[WARNING]   258 |   dlsym_CRYPTO_set_locking_callback((void (*)())pthreads_locking_callback);
[WARNING]       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[WARNING]       |   CRYPTO_set_locking_callback

and cstdint must be explicitly included on GCC >= 13.

[WARNING] /hadoop/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/uri.h:60:3: error: ‘uint16_t’ does not name a type
[WARNING]    60 |   uint16_t get_port() const;
[WARNING]       |   ^~~~~~~~
[WARNING] /hadoop/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/uri.h:25:1: note: ‘uint16_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
[WARNING]    24 | #include <vector>
[WARNING]   +++ |+#include <cstdint>
[WARNING]    25 | #include <stdexcept>
...

@iwasakims
Copy link
Member Author

and cstdint must be explicitly included on GCC >= 13.

This will be covered by HDFS-17226 (#6191). I will merge it first then update this PR.

@github-actions github-actions bot removed the HDFS label Apr 22, 2025
@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 19m 21s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+0 🆗 mvndep 6m 23s Maven dependency ordering for branch
-1 ❌ mvninstall 23m 8s /branch-mvninstall-root.txt root in trunk failed.
-1 ❌ compile 6m 15s /branch-compile-root.txt root in trunk failed.
+1 💚 mvnsite 1m 27s trunk passed
+1 💚 shadedclient 57m 15s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 24s Maven dependency ordering for patch
+1 💚 mvninstall 0m 47s the patch passed
-1 ❌ compile 6m 21s /patch-compile-root.txt root in the patch failed.
-1 ❌ cc 6m 21s /patch-compile-root.txt root in the patch failed.
-1 ❌ golang 6m 21s /patch-compile-root.txt root in the patch failed.
-1 ❌ javac 6m 21s /patch-compile-root.txt root in the patch failed.
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 mvnsite 1m 13s the patch passed
+1 💚 shadedclient 21m 15s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 12m 7s /patch-unit-hadoop-common-project_hadoop-common.txt hadoop-common in the patch passed.
+1 💚 unit 5m 49s hadoop-hdfs-native-client in the patch passed.
+1 💚 asflicense 0m 32s The patch does not generate ASF License warnings.
124m 58s
Reason Tests
Failed junit tests hadoop.util.TestNativeCodeLoader
hadoop.crypto.TestCryptoCodec
Subsystem Report/Notes
Docker ClientAPI=1.49 ServerAPI=1.49 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7644/1/artifact/out/Dockerfile
GITHUB PR #7644
Optional Tests dupname asflicense compile cc mvnsite javac unit codespell detsecrets golang
uname Linux 4da04698fd54 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / ae00f4d
Default Java Red Hat, Inc.-1.8.0_412-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7644/1/testReport/
Max. process+thread count 1266 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-common hadoop-hdfs-project/hadoop-hdfs-native-client U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7644/1/console
versions git=2.9.5 maven=3.6.3
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 20m 40s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 💚 mvninstall 41m 3s trunk passed
+1 💚 compile 17m 39s trunk passed with JDK Ubuntu-11.0.26+4-post-Ubuntu-1ubuntu120.04
+1 💚 compile 15m 49s trunk passed with JDK Private Build-1.8.0_442-8u442-b06us1-0ubuntu120.04-b06
+1 💚 mvnsite 1m 37s trunk passed
+1 💚 shadedclient 115m 4s branch has no errors when building and testing our client artifacts.
-0 ⚠️ patch 115m 31s Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 54s the patch passed
+1 💚 compile 16m 36s the patch passed with JDK Ubuntu-11.0.26+4-post-Ubuntu-1ubuntu120.04
+1 💚 cc 16m 36s the patch passed
+1 💚 javac 16m 36s the patch passed
+1 💚 compile 14m 53s the patch passed with JDK Private Build-1.8.0_442-8u442-b06us1-0ubuntu120.04-b06
+1 💚 cc 14m 53s the patch passed
+1 💚 javac 14m 53s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 mvnsite 1m 37s the patch passed
+1 💚 shadedclient 40m 23s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 14m 50s hadoop-common in the patch passed.
+1 💚 asflicense 1m 4s The patch does not generate ASF License warnings.
226m 29s
Subsystem Report/Notes
Docker ClientAPI=1.49 ServerAPI=1.49 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7644/2/artifact/out/Dockerfile
GITHUB PR #7644
Optional Tests dupname asflicense compile cc mvnsite javac unit codespell detsecrets
uname Linux 23bb49fc9af8 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / bfc1fb4
Default Java Private Build-1.8.0_442-8u442-b06us1-0ubuntu120.04-b06
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.26+4-post-Ubuntu-1ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_442-8u442-b06us1-0ubuntu120.04-b06
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7644/2/testReport/
Max. process+thread count 1286 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7644/2/console
versions git=2.25.1 maven=3.6.3
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

Copy link
Contributor

@cnauroth cnauroth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. Thank you for the patch, @iwasakims .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants