Opened 5 years ago

Last modified 5 years ago

#51815 reopened defect

librsvg @2.40.16 does not build on PPC Mac OS X 10.5.8, Leopard, because of "./libtool: eval: line 1085: syntax error near unexpected token `|' "

Reported by: ballapete (Peter Dyballa) Owned by: larryv (Lawrence Velázquez)
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: Cc: dbevans (David B. Evans), pixilla (Bradley Giesbrecht), jeremyhu (Jeremy Huddleston Sequoia), ryandesign (Ryan Schmidt)
Port: libtool

Description

This is the error:

mv -f .deps/librsvg_2_la-rsvg-xml.Tpo .deps/librsvg_2_la-rsvg-xml.Plo
/bin/sh ./libtool  --tag=CC   --mode=link /usr/bin/gcc-4.2 -arch ppc -DRSVG_COMPILATION -D_REENTRANT -I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/libpng16 -I/opt/local/include/pango-1.0 -I/opt/local/include/harfbuzz -I/opt/local/include -I/opt/local/include/pango-1.0 -I/opt/local/include/cairo -I/opt/local/include/pixman-1 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include/libpng16 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include/libpng16 -I/opt/local/include/libcroco-0.6 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -I/opt/local/include/libxml2  -pipe -Os -arch ppc  -version-info 42:16:40 -export-dynamic -no-undefined -export-symbols-regex "^rsvg_.*"  -L/opt/local/lib -Wl,-headerpad_max_install_names -arch ppc -o librsvg-2.la -rpath /opt/local/lib librsvg_2_la-librsvg-features.lo librsvg_2_la-rsvg-css.lo librsvg_2_la-rsvg-defs.lo librsvg_2_la-rsvg-image.lo librsvg_2_la-rsvg-io.lo librsvg_2_la-rsvg-paint-server.lo librsvg_2_la-rsvg-path.lo librsvg_2_la-rsvg-base-file-util.lo librsvg_2_la-rsvg-filter.lo librsvg_2_la-rsvg-marker.lo librsvg_2_la-rsvg-mask.lo librsvg_2_la-rsvg-shapes.lo librsvg_2_la-rsvg-structure.lo librsvg_2_la-rsvg-styles.lo librsvg_2_la-rsvg-text.lo librsvg_2_la-rsvg-cond.lo librsvg_2_la-rsvg-base.lo librsvg_2_la-librsvg-enum-types.lo librsvg_2_la-rsvg-cairo-draw.lo librsvg_2_la-rsvg-cairo-render.lo librsvg_2_la-rsvg-cairo-clip.lo librsvg_2_la-rsvg.lo librsvg_2_la-rsvg-gobject.lo librsvg_2_la-rsvg-file-util.lo librsvg_2_la-rsvg-size-callback.lo librsvg_2_la-rsvg-xml.lo  -L/opt/local/lib -lgdk_pixbuf-2.0 -lgio-2.0 -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lcairo -lpng16 -lcroco-0.6 -lglib-2.0 -lintl -lxml2  
libtool: link: /opt/local/bin/nm -B  .libs/librsvg_2_la-librsvg-features.o .libs/librsvg_2_la-rsvg-css.o .libs/librsvg_2_la-rsvg-defs.o .libs/librsvg_2_la-rsvg-image.o .libs/librsvg_2_la-rsvg-io.o .libs/librsvg_2_la-rsvg-paint-server.o .libs/librsvg_2_la-rsvg-path.o .libs/librsvg_2_la-rsvg-base-file-util.o .libs/librsvg_2_la-rsvg-filter.o .libs/librsvg_2_la-rsvg-marker.o .libs/librsvg_2_la-rsvg-mask.o .libs/librsvg_2_la-rsvg-shapes.o .libs/librsvg_2_la-rsvg-structure.o .libs/librsvg_2_la-rsvg-styles.o .libs/librsvg_2_la-rsvg-text.o .libs/librsvg_2_la-rsvg-cond.o .libs/librsvg_2_la-rsvg-base.o .libs/librsvg_2_la-librsvg-enum-types.o .libs/librsvg_2_la-rsvg-cairo-draw.o .libs/librsvg_2_la-rsvg-cairo-render.o .libs/librsvg_2_la-rsvg-cairo-clip.o .libs/librsvg_2_la-rsvg.o .libs/librsvg_2_la-rsvg-gobject.o .libs/librsvg_2_la-rsvg-file-util.o .libs/librsvg_2_la-rsvg-size-callback.o .libs/librsvg_2_la-rsvg-xml.o   |  | /opt/local/bin/gsed 's/.* //' | sort | uniq > .libs/librsvg-2.exp
./libtool: eval: line 1085: syntax error near unexpected token `|'
./libtool: eval: line 1085: `/opt/local/bin/nm -B  .libs/librsvg_2_la-librsvg-features.o .libs/librsvg_2_la-rsvg-css.o .libs/librsvg_2_la-rsvg-defs.o .libs/librsvg_2_la-rsvg-image.o .libs/librsvg_2_la-rsvg-io.o .libs/librsvg_2_la-rsvg-paint-server.o .libs/librsvg_2_la-rsvg-path.o .libs/librsvg_2_la-rsvg-base-file-util.o .libs/librsvg_2_la-rsvg-filter.o .libs/librsvg_2_la-rsvg-marker.o .libs/librsvg_2_la-rsvg-mask.o .libs/librsvg_2_la-rsvg-shapes.o .libs/librsvg_2_la-rsvg-structure.o .libs/librsvg_2_la-rsvg-styles.o .libs/librsvg_2_la-rsvg-text.o .libs/librsvg_2_la-rsvg-cond.o .libs/librsvg_2_la-rsvg-base.o .libs/librsvg_2_la-librsvg-enum-types.o .libs/librsvg_2_la-rsvg-cairo-draw.o .libs/librsvg_2_la-rsvg-cairo-render.o .libs/librsvg_2_la-rsvg-cairo-clip.o .libs/librsvg_2_la-rsvg.o .libs/librsvg_2_la-rsvg-gobject.o .libs/librsvg_2_la-rsvg-file-util.o .libs/librsvg_2_la-rsvg-size-callback.o .libs/librsvg_2_la-rsvg-xml.o   |  | /opt/local/bin/gsed 's/.* //' | sort | uniq > .libs/librsvg-2.exp'
make[2]: *** [librsvg-2.la] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_librsvg/librsvg/work/librsvg-2.40.16'

It has to do, obviously, with this function in libtool:

 1070	# func_show_eval cmd [fail_exp]
 1071	# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
 1072	# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
 1073	# is given, then evaluate it.
 1074	func_show_eval ()
 1075	{
 1076	    my_cmd="$1"
 1077	    my_fail_exp="${2-:}"
 1078	
 1079	    ${opt_silent-false} || {
 1080	      func_quote_for_expand "$my_cmd"
 1081	      eval "func_echo $func_quote_for_expand_result"
 1082	    }
 1083	
 1084	    if ${opt_dry_run-false}; then :; else
 1085	      eval "$my_cmd"
 1086	      my_status=$?
 1087	      if test "$my_status" -eq 0; then :; else
 1088		eval "(exit $my_status); $my_fail_exp"
 1089	      fi
 1090	    fi
 1091	}

but I have no idea how to test libtool, I even do not understand how the text is output… But it's obvious that this is being evaluated:

  407		# The commands to list exported symbols.
  408		export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"

And $global_symbol_pipe is defined as:

  172		# Take the output of nm and produce a listing of raw symbols and C names.
  173		global_symbol_pipe=""

So defining export_symbols_cmds as

  407		# The commands to list exported symbols.
  408		export_symbols_cmds="\$NM \$libobjs \$convenience | \$SED 's/.* //' | sort | uniq > \$export_symbols"

should work properly.

It's the first time that this shell script is used to link an executable – and it fails at once…

Attachments (2)

main.log (105.7 KB) - added by ballapete (Peter Dyballa) 5 years ago.
main.log from the failure
patch-libtool.diff (540 bytes) - added by ballapete (Peter Dyballa) 5 years ago.
Proposed patch to libtool

Download all attachments as: .zip

Change History (16)

Changed 5 years ago by ballapete (Peter Dyballa)

Attachment: main.log added

main.log from the failure

Changed 5 years ago by ballapete (Peter Dyballa)

Attachment: patch-libtool.diff added

Proposed patch to libtool

comment:1 Changed 5 years ago by ballapete (Peter Dyballa)

Libtool is created by configure, so it can't be patched this usual way… Should m4/libtool.m4 be patched instead?

comment:2 in reply to:  description ; Changed 5 years ago by ryandesign (Ryan Schmidt)

Cc: jeremyhu@… added

Replying to Peter_Dyballa@…:

but I have no idea how to test libtool, I even do not understand how the text is output… But it's obvious that this is being evaluated:

  407		# The commands to list exported symbols.
  408		export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"

And $global_symbol_pipe is defined as:

  172		# Take the output of nm and produce a listing of raw symbols and C names.
  173		global_symbol_pipe=""

So defining export_symbols_cmds as

  407		# The commands to list exported symbols.
  408		export_symbols_cmds="\$NM \$libobjs \$convenience | \$SED 's/.* //' | sort | uniq > \$export_symbols"

should work properly.

Well no. If global_symbol_pipe is empty, then the command being evaluated is:

export_symbols_cmds="$NM $libobjs $convenience | | $SED 's/.* //' | sort | uniq > $export_symbols"

The double pipe is what leads to the error message about the unexpected pipe symbol. I would say it was never intended for global_symbol_pipe to be empty, and the fact that global_symbol_pipe is empty in your case is what needs to be fixed.

This problem was described on the libtool mailing list before. It seems to be a problem with nm, and that the configure script does not exit after detecting nm's failure to parse the compiler's output.

comment:3 Changed 5 years ago by jeremyhu (Jeremy Huddleston Sequoia)

It is not a problem with nm. It's not nm's fault that it's being fed into a buggy command line.

The bug is that global_symbol_pipe is empty. Why is that the case?

comment:4 Changed 5 years ago by jeremyhu (Jeremy Huddleston Sequoia)

librsvg was configured with libtool 2.4.2. I wonder if this has been fixed at some point upstream. If you autoreconf, does it address the issue?

comment:5 Changed 5 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Oh wait... we do autoreconf... so no.

comment:6 Changed 5 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Owner: changed from macports-tickets@… to larryv@…
Port: libtool added; librsvg removed

comment:7 Changed 5 years ago by jeremyhu (Jeremy Huddleston Sequoia)

FWIW, I've got:

# Take the output of nm and produce a listing of raw symbols and C names.
global_symbol_pipe="sed -n -e 's/^.*[    ]\\([BCDEGRST][BCDEGRST]*\\)[   ][      ]*_\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 _\\2 \\2/p' | sed '/ __gnu_lto/d'"

comment:8 in reply to:  2 Changed 5 years ago by ballapete (Peter Dyballa)

Replying to ryandesign@…:

Replying to Peter_Dyballa@…:

This problem was described on the libtool mailing list before. It seems to be a problem with nm, and that the configure script does not exit after detecting nm's failure to parse the compiler's output.

On PPC Tiger, Mac OS X 10.4.11, I have the same problem.

If it's true that a misconfigured nm produces this fault, then /usb/bin/nm should be used instead of /opt/local/bin/nm, which comes from LLVM version 3.4.2. Invoking configure on the command line this nm produces a clear failure:

+ printf '%s\n' 'configure:7787: result: failed'

Setting NM=/usr/bin/nm seems to bring more success:

+ printf '%s\n' 'configure:7790: result: ok'

It seems to produce this value: lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([BCDEGRST][BCDEGRST]*\)[ ][ ]*_\([_A-Za-z][_A-Za-z0-9]*\)$/\1 _\2 \2/p'\'' | sed '\''/ __gnu_lto/d'\'''

comment:9 Changed 5 years ago by ballapete (Peter Dyballa)

On PPC Tiger it helps to add to the configure.args in Portfile the line

lt_cv_path_NM=/usr/bin/nm

and the link command now works:

libtool: link: /usr/bin/nm  .libs/librsvg_2_la-librsvg-features.o .libs/librsvg_2_la-rsvg-css.o .libs/librsvg_2_la-rsvg-defs.o .libs/librsvg_2_la-rsvg-image.o .libs/librsvg_\
2_la-rsvg-io.o .libs/librsvg_2_la-rsvg-paint-server.o .libs/librsvg_2_la-rsvg-path.o .libs/librsvg_2_la-rsvg-base-file-util.o .libs/librsvg_2_la-rsvg-filter.o .libs/librsvg_\
2_la-rsvg-marker.o .libs/librsvg_2_la-rsvg-mask.o .libs/librsvg_2_la-rsvg-shapes.o .libs/librsvg_2_la-rsvg-structure.o .libs/librsvg_2_la-rsvg-styles.o .libs/librsvg_2_la-rs\
vg-text.o .libs/librsvg_2_la-rsvg-cond.o .libs/librsvg_2_la-rsvg-base.o .libs/librsvg_2_la-librsvg-enum-types.o .libs/librsvg_2_la-rsvg-cairo-draw.o .libs/librsvg_2_la-rsvg-\
cairo-render.o .libs/librsvg_2_la-rsvg-cairo-clip.o .libs/librsvg_2_la-rsvg.o .libs/librsvg_2_la-rsvg-gobject.o .libs/librsvg_2_la-rsvg-file-util.o .libs/librsvg_2_la-rsvg-s\
ize-callback.o .libs/librsvg_2_la-rsvg-xml.o   | sed -n -e 's/^.*[      ]\([BCDEGRST][BCDEGRST]*\)[     ][      ]*_\([_A-Za-z][_A-Za-z0-9]*\)$/\1 _\2 \2/p' | sed '/ __gnu_lt\
o/d' | /opt/local/bin/gsed 's/.* //' | sort | uniq > .libs/librsvg-2.exp

The port finally built and was installed.

I think the cause of this event is that I fiddled with port select --set and set values for clang and llvm since I had finally working versions of them, needed for some other port(s)…

comment:10 Changed 5 years ago by ballapete (Peter Dyballa)

And the upgrade of ImageMagick fails due to the same reason… I think the next time, in four weeks, in August, I'll try with Clang and llvm 3.3 – I think this was the previous working setting.

comment:11 Changed 5 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: newclosed

Ok, I think r150060 should help you out.

comment:12 Changed 5 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: closedreopened

comment:13 Changed 5 years ago by jeremyhu (Jeremy Huddleston Sequoia)

(leaving this open to track a fix in libtool)

comment:14 in reply to:  10 Changed 5 years ago by ryandesign (Ryan Schmidt)

Cc: ryandesign@… added

Replying to Peter_Dyballa@…:

And the upgrade of ImageMagick fails due to the same reason…

which was filed as #51819, though that's on El Capitan.

Note: See TracTickets for help on using tickets.