[ https://issues.apache.org/jira/browse/HADOOP-12036?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14569626#comment-14569626 ]
Alan Burlison commented on HADOOP-12036: ---------------------------------------- JNI stuff will only be pulled in if you explicitly include HadoopJNI.cmake. If you want to globally change -02 to -O3 then YARN would have to be modified explicitly. Without knowing exactly what flags you are going to want to override in advance I can't see how else you can do it, unless you have a better idea. I agree that not setting _GNU_SOURCE won't enforce portability, but simply doing Solaris test builds also *won't* enforce compatibility. For example the code covered by HADOOP-7824 is wrong, but compiles on Solaris just fine. It's not clear if nightly Solaris builds would actually catch the issue. Your point about strerror_r is an interesting one as the POSIX and Linux ones aren't compatible. There are 475 references to errno in the native code and if each of them required the use of strerror_r then someone would have had to go through all those places and wrap them in a platform-independent version. Fortunately that isn't actually necessary but it does illustrate the potential scale of the problem. Also, the problems caused by globally defining _GNU_SOURCE are more insidious than just compile-time errors because in some cases _GNU_SOURCE actually changes run-time behaviour as well, e.g. in basename(3). In that case you'll potentially get mysterious behaviour at run-time on non-Linux platforms. Strictly speaking if the source is intended to be portable then _POSIX_C_SOURCE should be set to 200112L, but I'm not suggesting going that far, I've had a look at hadoop-common and as far as I can tell, _GNU_SOURCE is only needed to get the extra bits in dlfcn.h, it isn't actually needed anywhere else. It may well be that your concerns about lots of breakage being caused by not globally defining _GNU_SOURCE are not borne out, but I'd have to do more work to confirm that. I'm looking at what's involved in getting the Solaris Jenkins machines(s) working again with a current version of Solaris, but that's going to take a little time to investigate so I don;t have anything to report yet. However be assured it is on my list. > Consolidate all of the cmake extensions in one directory > -------------------------------------------------------- > > Key: HADOOP-12036 > URL: https://issues.apache.org/jira/browse/HADOOP-12036 > Project: Hadoop Common > Issue Type: Sub-task > Reporter: Allen Wittenauer > Assignee: Alan Burlison > Attachments: prototype01.txt > > > Rather than have a half-dozen redefinitions, custom extensions, etc, we > should move them all to one location so that the cmake environment is > consistent between the various native components. -- This message was sent by Atlassian JIRA (v6.3.4#6332)