Opened 4 years ago

Closed 4 years ago

#3415 closed defect (fixed)

fails to build on OS X because of --exclude-libs

Reported by: petere Owned by: strk
Priority: high Milestone: PostGIS 2.2.1
Component: build/upgrade/install Version: 2.2.x
Keywords: Cc:

Description

Version 2.2.0 fails to build on OS X for me because of the use of the new --exclude-libs linker option. The configure test for that is incorrect, because it checks --exclude-libs as a compiler option but then later uses it as a linker option. Both clang and gcc will ignore a linker option when run with the -c option, so the test always succeeds even though the option is not supported by the system linker. In other words, this check doesn't work correctly.

I suggest you change the configure test to use AC_LIBTOOL_LINKER_OPTION instead of AC_LIBTOOL_COMPILER_OPTION.

Change History (9)

comment:1 Changed 4 years ago by gdt

FWIW, I see the same failure trying to build 2.2.0 under pkgsrc on OS X 10.9.

After manually removing --exclude-libs from config.status and rerunning config.status, postgis not only builds but make check almost worked, getting into raster tests. It failed with some proj dynamic linking stuff that may be a pkgsrc bug. The suggested fix seems right to me too.

PostgreSQL 9.3.10 on x86_64-apple-darwin13, compiled by Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn), 64-bit
  Postgis 2.2.0 - r14208 - 2015-12-31 00:26:39
  scripts 2.2.0 r14208
  GEOS: 3.5.0-CAPI-1.9.0 r4084
  PROJ: Rel. 4.9.2, 08 September 2015

comment:2 Changed 4 years ago by robe

(In [14536]) Invalid --exclude_libs (fails build on OSX) References #3415 for PostGIS 2.3

comment:3 Changed 4 years ago by robe

I made the change for trunk and my compile and make check locally still work. Did I make the right change. If it looks right, I'll backport to 2.2 and close this out.

comment:4 Changed 4 years ago by strk

It seems to be never adding --exclude-libs at link time, even if it's found to be available at configure time. This is the link line I see (make V=1):

libtool: link: gcc -shared  -fPIC -DPIC  .libs/stringbuffer.o .libs/bytebuffer.o .libs/measures.o .libs/measures3d.o .libs/box2d.o .libs/ptarray.o .libs/lwgeom_api.o .libs/lwgeom.o .libs/lwpoint.o .libs/lwline.o .libs/lwpoly.o .libs/lwtriangle.o .libs/lwmpoint.o .libs/lwmline.o .libs/lwmpoly.o .libs/lwboundingcircle.o .libs/lwcollection.o .libs/lwcircstring.o .libs/lwcompound.o .libs/lwcurvepoly.o .libs/lwmcurve.o .libs/lwmsurface.o .libs/lwpsurface.o .libs/lwtin.o .libs/lwout_wkb.o .libs/lwin_geojson.o .libs/lwin_wkb.o .libs/lwin_twkb.o .libs/lwiterator.o .libs/lwout_wkt.o .libs/lwout_twkb.o .libs/lwin_wkt_parse.o .libs/lwin_wkt_lex.o .libs/lwin_wkt.o .libs/lwin_encoded_polyline.o .libs/lwutil.o .libs/lwhomogenize.o .libs/lwalgorithm.o .libs/lwstroke.o .libs/lwlinearreferencing.o .libs/lwprint.o .libs/g_box.o .libs/g_serialized.o .libs/g_util.o .libs/lwgeodetic.o .libs/lwgeodetic_tree.o .libs/lwtree.o .libs/lwout_gml.o .libs/lwout_kml.o .libs/lwout_geojson.o .libs/lwout_svg.o .libs/lwout_x3d.o .libs/lwout_encoded_polyline.o .libs/lwgeom_debug.o .libs/lwgeom_geos.o .libs/lwgeom_geos_clean.o .libs/lwgeom_geos_cluster.o .libs/lwgeom_geos_node.o .libs/lwgeom_geos_split.o .libs/lwgeom_topo.o .libs/lwgeom_transform.o .libs/lwunionfind.o .libs/effectivearea.o .libs/varint.o .libs/lwgeom_sfcgal.o .libs/lwspheroid.o   -L/usr/local/lib /usr/local/lib/libgeos_c.so /usr/lib/libproj.so /usr/local/lib/libjson-c.so /usr/local/lib/libSFCGAL.so    -Wl,-soname -Wl,liblwgeom-2.3.so.0 -o .libs/liblwgeom-2.3.so.0.0.0

comment:5 Changed 4 years ago by strk

(In [14539]) Fix AC_LIBTOOL_LINKER_OPTION invocation.

See #3415

comment:6 Changed 4 years ago by strk

Found in /usr/share/aclocal/libtool.m4:

AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])                       
# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,                              
#                  [ACTION-SUCCESS], [ACTION-FAILURE])   

Fixed in r14539. Please test on BSD/OSX.

comment:7 Changed 4 years ago by pramsey

This commit makes things work here on OSX 10.11

comment:8 Changed 4 years ago by pramsey

(Not that anything was ever broken before for me, I never experienced this OSX issue.)

comment:9 Changed 4 years ago by strk

Resolution: fixed
Status: newclosed

(In [14541]) --exclude_libs is a linker option

Fixes #3415

Note: See TracTickets for help on using tickets.