clang, -fcatch-undefined-behavior flag, and include/mapnik/feature.hpp don't play well #1188

Closed
springmeyer opened this Issue Apr 23, 2012 · 2 comments

Comments

Projects
None yet
2 participants
Owner

springmeyer commented Apr 23, 2012

If you use clang++ on osx 10.7 and compile node-mapnik, or ruby-mapnik against mapnik using the fcatch-undefined-behavior flag you will likely see (when compiling feature bindings):

fatal error: error in backend: Cannot select: 0x7f8df5fbdd10: i64 = shl 0x7f8df5fb5f10, 0x7f8df5fbe010 [ID=22] dbg:/usr/include/architecture/i386/math.h:189:103
  0x7f8df5fb5f10: i64 = fgetsign 0x7f8df5f8ca10 [ID=20] dbg:/usr/include/architecture/i386/math.h:189:103
    0x7f8df5f8ca10: f64,ch = CopyFromReg 0x7f8df72ba2c8, 0x7f8df5fbe710 [ORD=17807] [ID=16] dbg:/usr/include/architecture/i386/math.h:189:103
      0x7f8df5fbe710: f64 = Register %vreg9 [ORD=17807] [ID=1]
  0x7f8df5fbe010: i64 = Constant<63> [ID=15]

This is likely a clang/clang++ bug. But, it only seems to happen when compiling code against include/mapnik/feature.hpp. So, logging as an issue here to track this (just in case there is something odd with include/mapnik/feature.hpp).

Full compiler line (for node-mapnik) is:

/Developer/usr/bin/clang++ -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I../../../../ext/ruby_mapnik -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE    -I/usr/local/include -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common  -I/usr/local/include -I/Users/dane/Downloads/oracle10g/include -I/opt/libpng-1.5.8/include -I/opt/freetype2.4.9/include/freetype2 -I/opt/freetype2.4.9/include -I/opt/boost-49/include -I/usr/local/Cellar/postgresql/9.1.3/include -I/usr/local/Cellar/geos/3.3.2/include -I/usr/local/Cellar/gdal/1.9.0/include -I/usr/local/Cellar/icu4c/4.8.1.1/include -I/usr/local/include -I/usr/include -I/usr/include/libxml2 -DHAVE_JPEG -DBOOST_REGEX_HAS_ICU -ansi -Wall -Wno-array-bounds -Wno-char-subscripts -Wno-parentheses-equality -Wno-unused-function -Wno-unused-parameter -Wno-missing-field-initializers -ftemplate-depth-300 -DDARWIN -DBOOST_SPIRIT_THREADSAFE -DMAPNIK_THREADSAFE -O3 -finline-functions -Wno-inline -Wno-parentheses -Wno-char-subscripts -DNDEBUG -fcatch-undefined-behavior  -DHAVE_LIBXML2    -Wall -g -c ../../../../ext/ruby_mapnik/_mapnik_feature.rb.cpp
fatal error: error in backend: Cannot select: 0x7f8df5fbdd10: i64 = shl 0x7f8df5fb5f10, 0x7f8df5fbe010 [ID=22] dbg:/usr/include/architecture/i386/math.h:189:103
  0x7f8df5fb5f10: i64 = fgetsign 0x7f8df5f8ca10 [ID=20] dbg:/usr/include/architecture/i386/math.h:189:103
    0x7f8df5f8ca10: f64,ch = CopyFromReg 0x7f8df72ba2c8, 0x7f8df5fbe710 [ORD=17807] [ID=16] dbg:/usr/include/architecture/i386/math.h:189:103
      0x7f8df5fbe710: f64 = Register %vreg9 [ORD=17807] [ID=1]
  0x7f8df5fbe010: i64 = Constant<63> [ID=15]

nlewycky commented Dec 1, 2012

This is a crash inside of LLVM itself. Please file this on llvm's bugtracker at llvm.org/bugs .

Owner

springmeyer commented Mar 13, 2013

undefined api changed in clang, so this is no longer relevant, instead see #1679

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