Skip to content
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

在centos中 编译时报错 :/TencentKona-8/hotspot/src/share/vm/runtime/arguments.cpp #38

Open
Gaoyan1999 opened this issue Jun 14, 2021 · 4 comments

Comments

@Gaoyan1999
Copy link

Gaoyan1999 commented Jun 14, 2021

Compiling /home/tx/TencentKona-8/hotspot/src/share/vm/runtime/arguments.cpp
In function ‘char* get_shared_archive_path()’,
    inlined from ‘static jint Arguments::parse(const JavaVMInitArgs*)’ at /home/tx/TencentKona-8/hotspot/src/share/vm/runtime/arguments.cpp:4031:46:
/home/tx/TencentKona-8/hotspot/src/share/vm/runtime/arguments.cpp:3887:14: error: ‘char* strncpy(char*, const char*, size_t)’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
       strncpy(shared_archive_path, SharedArchiveFile, strlen(SharedArchiveFile) + 1);
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tx/TencentKona-8/hotspot/src/share/vm/runtime/arguments.cpp: In static member function ‘static jint Arguments::parse(const JavaVMInitArgs*)’:
/home/tx/TencentKona-8/hotspot/src/share/vm/runtime/arguments.cpp:3887:61: note: length computed here
       strncpy(shared_archive_path, SharedArchiveFile, strlen(SharedArchiveFile) + 1);
                                                       ~~~~~~^~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
@shiyuexw
Copy link
Collaborator

shiyuexw commented Jun 15, 2021

please send your configure and the version of gcc

@shiyuexw
Copy link
Collaborator

you can cherry-pick the commit "FIX(runtime): solve compiler warning with get_shared_archive_path" in dev branch.

@Gaoyan1999
Copy link
Author

Gaoyan1999 commented Jun 16, 2021

I found the reason why throw this error. In centos 8, I run yum install libstdc++-static, occurred an error: Unable to find a match: libstdc++-static. Maybe this why I can't complie kona sucessfully.
However, it's work in contos 7.
Over the last few days, I've encountered some problems about the compiling environment, and I solved it.In order to make others avoid these problem, I wanna write a document about how to compile kona sucessfully with the help of docker. :)

@shiyuexw
Copy link
Collaborator

We almostly built Kona JDK on centos6 or centos7. This is a good find that there are some issues in centos 8.
If you can share your documentation, we can share it in the wiki.

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

No branches or pull requests

2 participants