-
Notifications
You must be signed in to change notification settings - Fork 729
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
AArch64: Compile error in trclog.c with strncpy() #4486
Comments
I suspect a cast of the dest to |
No, casting the destination to |
interesting. On other linux platforms this only shows up when |
@dnakamura What are the implications of modifying |
It adds extra checks to c string manipulation functions. http://man7.org/linux/man-pages/man7/feature_test_macros.7.html : _FORTIFY_SOURCE (since glibc 2.3.4)Defining this macro causes some lightweight checks to be per formed to detect some buffer overflow errors when employing various string and memory manipulation functions (for example, memcpy(3),memset(3), stpcpy(3), strcpy(3), strncpy(3),strcat(3), strncat(3), sprintf(3), snprintf(3), vsprintf(3),vsnprintf(3), gets(3), and wide character variants thereof). For some functions, argument consistency is checked; for example, a check is made that open(2) has been supplied with a mode argument when the specified flags include O_CREAT. Not all problems are detected, just some common cases. If _FORTIFY_SOURCE is set to 1, with compiler optimization level 1 (gcc -O1) and above, checks that shouldn't change the behavior of conforming programs are performed. With _FORTIFY_SOURCE set to 2, some more checking is added, but some conforming programs might fail. Use of this macro requires compiler support, available with gcc(1) since version 4.0. |
Is it possible to add or change compiler options only for |
I think so, yes. I think this should work (although I haven't tested)
|
@dnakamura Thank you, it works. I apply it to #5508. |
This commit stops adding "-D_FORTIFY_SOURCE=1" to CFLAGS in runtime/rastrace when the target platform is AArch64, in order to avoid compile error with trclog.c. With this change, "--disable-warnings-as-errors-openj9" can be removed from the options for configure. Fixes: eclipse-openj9#4486 Signed-off-by: knn-k <[email protected]>
This commit stops adding "-D_FORTIFY_SOURCE=1" to CFLAGS in runtime/rastrace when the target platform is AArch64, in order to avoid compile error with trclog.c. With this change, "--disable-warnings-as-errors-openj9" can be removed from the options for configure. Fixes: eclipse-openj9#4486 Signed-off-by: knn-k <[email protected]>
I got the following error while I was compiling for linux_aarch64. It is similar to Issue #3242.
It compiles without the error when I remove
-D_FORTIFY_SOURCE=1
from the command-line option.The text was updated successfully, but these errors were encountered: