[cfe-dev] CentOS 5.9 build bust: rt sanitizer & incompatible TCP/IP headers
Mark Deric
codetech at dericnet.com
Sat Jul 13 15:15:33 PDT 2013
This is the same issue as reported in the "Trouble compiling CLANG on on
RHEL 3.0" from 18 June. It applies to CentOS/RHEL 5 as well. Afaict, the
bust was introduced on 7 June in check in "[compiler-rt] r183517 -
[sanitizer] ioctl interceptor"; though that's from code inspection, not
from having tried the immediate predecessor. The Clang 3.3 certainly
builds fine on CentOS/RHEL 5 using gcc upgraded to 4.8.1 from the distro's
stock gcc 4.1.2. I did not automate the SVN checkout and build until 24
June and have been getting this bust since then; here's last night's try:
In file included from /mnt/share/RHEL5_local/buildroot/llvm_projects/llvm_svn_wtest_20130712_191043/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:76:
In file included from /usr/include/linux/mroute.h:5:
/usr/include/linux/in.h:26:3: error: redefinition of enumerator 'IPPROTO_IP'
IPPROTO_IP = 0, /* Dummy protocol for TCP */
^
/usr/include/netinet/in.h:34:21: note: expanded from macro 'IPPROTO_IP'
#define IPPROTO_IP IPPROTO_IP
^
/usr/include/netinet/in.h:33:5: note: previous definition is here
IPPROTO_IP = 0, /* Dummy protocol for TCP. */
^
IPPROTO_ICMP, IPPROTO_IGMP, IPPROTO_TCP and a number of other manifest
constants/enums collide in later messages. Further, if the build got by
this issue, I think it would land on the rocks again with the subsequent
include of <linux/mroute6.h> on the next line of
sanitizer_platform_limits_posix.cc since that file does not exist in the
CentOS/RHEL 5 distribution.
I did a code check of these headers on Ubuntu 12.04 and the organization
seems updated and consistent with the compiler-rt sanitizer code. It also
appears as though there is some effort to do OS/platform detection using
manifest constants SANITIZER_LINUX, SANITIZER_ANDROID, etc. But these are
based on things like "#if defined(__linux__)" and do not appear to be
granular enough to accomodate the header differences among Linux'es.
I'm a newbie to building/using and looking at Clang so I don't know the
idioms for OS/platform detection or the consumer side of sanitizer; and I
suspect fixups in those areas are the right way to address this bust.
+eugenis following Kostya Serebryany's lead
--
Mark Deric <codetech at dericnet.com>
More information about the cfe-dev
mailing list