[postgis-devel] [PostGIS] #1694: PostGIS 2.0.0 does not build with clang

PostGIS trac at osgeo.org
Wed Dec 5 23:53:04 PST 2012


#1694: PostGIS 2.0.0 does not build with clang
----------------------+-----------------------------------------------------
  Reporter:  vince    |       Owner:  pramsey      
      Type:  defect   |      Status:  closed       
  Priority:  medium   |   Milestone:  PostGIS 2.0.1
 Component:  postgis  |     Version:  trunk        
Resolution:  fixed    |    Keywords:  history      
----------------------+-----------------------------------------------------
Changes (by sharpie):

 * cc: sharpie (added)


Comment:

 Looks like this is still a bug.

 I wasn't experiencing it earlier because Homebrew was using `/usr/bin/cpp`
 which is a wrapper script on OS X that points to `llvm-gcc`. However, we
 recently made some changes that cause `clang` to be used as the pre-
 processor if it is also being used as the C compiler. After these changes,
 I see the same errors Vince reported earlier.

 A diff of the SQL scripts and Postgres extension files produced by `llvm-
 gcc` as compared to `clang` (version 3.1) can be found here:

   https://gist.github.com/4d943acc25f81b1ffe9c

 (un-truncated versions can be found at
 https://gist.github.com/4d943acc25f81b1ffe9c/366d6bd1379e80f1042adfe0b580653a97fd9e19)

 The problems with Clang seem to be related to whitespace---it looks like
 all the indentation is being stripped. The trunk version of Clang has
 downgraded the errors to warnings, but the end result is still the same
 and indentation is stripped.

 Trying with GPP produces the following result:

   https://gist.github.com/65057cf9fb6a56a5929c

 GPP seems like a drop in replacement for the GCC pre-processor---except it
 has a problem inserting URLs into the comments.


 There are two unresolved issues here:

   * Apple will be dropping `llvm-gcc` from XCode followig the next major
 release, so it would be prudent to ensure Clang can be used as a pre-
 processor.

   * GPP provides a reasonable fall-back if supporting Clang is unfeasible.
 However, there is currently no way to configure a build using `gpp` as the
 preprocessor short of hacking `configure.ac` and re-running `autogen.sh`.
 This is distasteful from a packaging standpoint.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1694#comment:25>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-devel mailing list