Bug 201922 - [exp-run] devel/libtool: mishandles export-symbols
Summary: [exp-run] devel/libtool: mishandles export-symbols
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Tijl Coosemans
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-27 14:58 UTC by Philip Homburg
Modified: 2015-08-02 15:07 UTC (History)
2 users (show)

See Also:


Attachments
patch (778 bytes, patch)
2015-07-27 20:20 UTC, Tijl Coosemans
no flags Details | Diff
patch2 (12.84 KB, patch)
2015-07-31 19:13 UTC, Tijl Coosemans
no flags Details | Diff
ports with -export-symbols in their build log (4.58 KB, text/plain)
2015-08-02 08:06 UTC, Antoine Brodin
no flags Details
extra audio/calf patch (412 bytes, patch)
2015-08-02 10:55 UTC, Tijl Coosemans
no flags Details | Diff
another audio/calf patch (545 bytes, patch)
2015-08-02 13:25 UTC, Tijl Coosemans
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Homburg 2015-07-27 14:58:57 UTC
libunbound on FreeBSD has an issue the if the application defines a function with the name log_init the library fails.

According to the unbound maintainer, this can be traced back to libtool doing the wrong thing.

I can try to report this to the libtool devs, but they don't mention supporting llvm/clang in their documentation.
Comment 1 Tijl Coosemans freebsd_committer freebsd_triage 2015-07-27 20:20:59 UTC
Created attachment 159317 [details]
patch

By default libtool replaces -export-symbols <file> with -retain-symbols-file <file> on ELF systems, but this doesn't really do what -export-symbols is meant to do.  On GNU ELF systems it converts <file> to a simple version script and uses -version-script instead of -retain-symbols-file.

This patch lets USES=libtool fix libtool scripts so they use -version-script.

When you rebuild dns/unbound after applying the patch to your ports tree it should no longer export log_init.
Comment 2 Tijl Coosemans freebsd_committer freebsd_triage 2015-07-27 20:22:33 UTC
Assign to portmgr for exp-run.
Comment 3 Antoine Brodin freebsd_committer freebsd_triage 2015-07-27 20:31:16 UTC
Take
Comment 4 Tijl Coosemans freebsd_committer freebsd_triage 2015-07-27 20:45:53 UTC
(In reply to Antoine Brodin from comment #3)
Can you also search the build logs for "-export-symbols" so those ports can get a PORTREVISION bump?
Comment 5 Philip Homburg 2015-07-27 20:51:47 UTC
(In reply to Tijl Coosemans from comment #1)

Great. It works!
Comment 6 Antoine Brodin freebsd_committer freebsd_triage 2015-07-31 08:25:51 UTC
Exp-run results on 10.2 amd64:

http://package23.nyi.freebsd.org/build.html?mastername=102amd64-default-PR201922&build=2015-07-31_07h19m32s

4 new failures:

+ {"origin"=>"audio/calf", "pkgname"=>"calf-0.0.60", "phase"=>"build", "errortype"=>"linker_error"}
+ {"origin"=>"japanese/scim-honoka", "pkgname"=>"ja-scim-honoka-0.9.1_12", "phase"=>"build", "errortype"=>"linker_error"}
+ {"origin"=>"multimedia/schroedinger", "pkgname"=>"schroedinger-1.0.11_3", "phase"=>"build", "errortype"=>"linker_error"}
+ {"origin"=>"textproc/scim-input-pad", "pkgname"=>"scim-input-pad-0.1.3.1_4", "phase"=>"build", "errortype"=>"linker_error"}

Failure logs:

http://package23.nyi.freebsd.org/data/102amd64-default-PR201922/2015-07-31_07h19m32s/logs/errors/calf-0.0.60.log 
http://package23.nyi.freebsd.org/data/102amd64-default-PR201922/2015-07-31_07h19m32s/logs/errors/ja-scim-honoka-0.9.1_12.log 
http://package23.nyi.freebsd.org/data/102amd64-default-PR201922/2015-07-31_07h19m32s/logs/errors/schroedinger-1.0.11_3.log 
http://package23.nyi.freebsd.org/data/102amd64-default-PR201922/2015-07-31_07h19m32s/logs/errors/scim-input-pad-0.1.3.1_4.log
Comment 7 Antoine Brodin freebsd_committer freebsd_triage 2015-07-31 13:53:48 UTC
On 9.3 amd64 there are 4 new failures,  the same as above.
Comment 8 Tijl Coosemans freebsd_committer freebsd_triage 2015-07-31 19:13:35 UTC
Created attachment 159420 [details]
patch2

audio/calf: This port builds a module that now exports only one function, but it also builds a number of executables that link to this module and expects to see other functions.  Because it's already a bit dodgy to link to a module (libtool warns about this) let the module continue to export only one function and instead build an ordinary library from the same source that the executables can link to.  Fix a number of other issues in the same Makefile.am and clean up the port Makefile.

japanese/scim-honoka: Tries to hide all symbols that start with an underscore, but because this library is written in C++ all symbols start with _Z so it ends up hiding everything.  Just don't hide anything at all like the textproc/scim configure script does.

multimedia/schroedinger: Apply an upstream patch.

textproc/scim-input-pad: Same as japanese/scim-honoka.
Comment 10 Antoine Brodin freebsd_committer freebsd_triage 2015-08-02 08:06:05 UTC
Created attachment 159453 [details]
ports with -export-symbols in their build log

Attached is the list of ports with "-export-symbols" in their build log
Comment 11 Tijl Coosemans freebsd_committer freebsd_triage 2015-08-02 09:37:43 UTC
(In reply to Antoine Brodin from comment #9)
Does changing USES=compiler into USES=compiler:c++11-lang work?
Comment 13 Tijl Coosemans freebsd_committer freebsd_triage 2015-08-02 10:55:33 UTC
Created attachment 159456 [details]
extra audio/calf patch

Here's an extra patch for audio/calf/files/
Comment 15 Tijl Coosemans freebsd_committer freebsd_triage 2015-08-02 13:25:44 UTC
Created attachment 159458 [details]
another audio/calf patch

Another patch for audio/calf/files
Comment 17 commit-hook freebsd_committer freebsd_triage 2015-08-02 15:04:17 UTC
A commit references this bug:

Author: tijl
Date: Sun Aug  2 15:03:52 UTC 2015
New revision: 393429
URL: https://svnweb.freebsd.org/changeset/ports/393429

Log:
  By default libtool replaces -export-symbols <file> with -retain-symbols-file
  <file> on ELF systems, but this doesn't really do what -export-symbols is
  meant to do.  On GNU ELF systems it converts <file> to a simple version
  script first and then uses -version-script instead of -retain-symbols-file.
  Let USES=libtool patch libtool scripts to do this on all systems with GNU
  ld(1).

  Bump PORTREVISION on all ports where the build log contains -export-symbols.

  audio/calf: This port builds a module that now exports only one function,
  but it also builds a number of executables that link to this module and
  expect to see other functions.  Because it's already a bit dodgy to link to
  a module (libtool warns about this) let the module continue to export only
  one function and instead build an ordinary library from the same source that
  the executables can link to.  Fix a number of other issues in the same
  Makefile.am and clean up the port Makefile.

  japanese/scim-honoka: Tries to hide all symbols that start with an
  underscore, but because this library is written in C++ all symbols start
  with _Z so it ends up hiding everything.  Just don't hide anything at all
  like the textproc/scim configure script does.

  multimedia/schroedinger: Apply an upstream patch.

  textproc/scim-input-pad: Same as japanese/scim-honoka.

  PR:		201922
  Approved by:	portmgr (antoine)
  Exp-run by:	antoine

Changes:
  head/Mk/Uses/libtool.mk
  head/accessibility/at-spi/Makefile
  head/audio/audacity/Makefile
  head/audio/calf/Makefile
  head/audio/calf/files/patch-configure.ac
  head/audio/calf/files/patch-src-Makefile.am
  head/audio/calf/files/patch-src-giface.cpp
  head/audio/calf/files/patch-src-monosynth.cpp
  head/audio/calf/pkg-plist
  head/audio/deadbeef/Makefile
  head/audio/gstreamer-plugins-fluendo-mp3/Makefile
  head/audio/gstreamer-plugins-moodbar/Makefile
  head/audio/libaacplus/Makefile
  head/audio/libaudiofile/Makefile
  head/audio/mpg123/Makefile
  head/audio/portaudio/Makefile
  head/audio/shairplay/Makefile
  head/audio/wavpack/Makefile
  head/audio/xfce4-mixer/Makefile
  head/audio/xfce4-mpc-plugin/Makefile
  head/chinese/scim-array/Makefile
  head/chinese/scim-pinyin/Makefile
  head/converters/fribidi/Makefile
  head/databases/courier-authlib-mysql/Makefile
  head/databases/courier-authlib-pgsql/Makefile
  head/databases/courier-authlib-userdb/Makefile
  head/databases/courier-authlib-usergdbm/Makefile
  head/databases/glom/Makefile
  head/databases/ipa_sdb/Makefile
  head/databases/libgda4/Makefile
  head/databases/libgda5/Makefile
  head/databases/libiodbc/Makefile
  head/databases/mdbtools/Makefile
  head/databases/mysql-workbench51/Makefile
  head/databases/oracle_odbc_driver/Makefile
  head/databases/rrdtool/Makefile
  head/databases/unixODBC/Makefile
  head/databases/virtuoso/Makefile
  head/deskutils/orage/Makefile
  head/deskutils/spice-gtk/Makefile
  head/devel/alf/Makefile
  head/devel/appstream-glib/Makefile
  head/devel/cutter/Makefile
  head/devel/fam/Makefile
  head/devel/gconf2/Makefile
  head/devel/gitg/Makefile
  head/devel/gnome-vfs/Makefile
  head/devel/google-perftools/Makefile
  head/devel/gvfs/Makefile
  head/devel/jansson/Makefile
  head/devel/libcheck/Makefile
  head/devel/libdatrie/Makefile
  head/devel/libdbusmenu/Makefile
  head/devel/libglade2/Makefile
  head/devel/libgtop/Makefile
  head/devel/liblcfg/Makefile
  head/devel/libmaa/Makefile
  head/devel/liboil/Makefile
  head/devel/libpeas/Makefile
  head/devel/librcc/Makefile
  head/devel/librevisa/Makefile
  head/devel/libthai/Makefile
  head/devel/libzookeeper/Makefile
  head/devel/orc/Makefile
  head/devel/privman/Makefile
  head/devel/pthsem/Makefile
  head/devel/py-dbus/Makefile
  head/devel/py-gobject/Makefile
  head/devel/py-notify/Makefile
  head/devel/py-orbit/Makefile
  head/devel/py3-dbus/Makefile
  head/devel/pydbus-common/Makefile
  head/devel/streamhtmlparser/Makefile
  head/devel/upnp/Makefile
  head/dns/getdns/Makefile
  head/dns/knot/Makefile
  head/dns/ldns/Makefile
  head/dns/unbound/Makefile
  head/ftp/wzdftpd/Makefile
  head/graphics/GraphicsMagick/Makefile
  head/graphics/ImageMagick/Makefile
  head/graphics/ImageMagick7/Makefile
  head/graphics/atril/Makefile
  head/graphics/atril-lite/Makefile
  head/graphics/bugle/Makefile
  head/graphics/cogl/Makefile
  head/graphics/colord/Makefile
  head/graphics/diacanvas2/Makefile
  head/graphics/evince/Makefile
  head/graphics/evince-lite/Makefile
  head/graphics/goom/Makefile
  head/graphics/gstreamer-plugins-gl/Makefile
  head/graphics/gstreamer1-plugins-gl/Makefile
  head/graphics/libchamplain/Makefile
  head/graphics/libchamplain08/Makefile
  head/graphics/libexif/Makefile
  head/graphics/libgphoto2/Makefile
  head/graphics/libgxps/Makefile
  head/graphics/libpotrace/Makefile
  head/graphics/potrace/Makefile
  head/graphics/py-goocanvas/Makefile
  head/graphics/py-poppler/Makefile
  head/graphics/swfdec/Makefile
  head/graphics/zbar/Makefile
  head/irc/charybdis/Makefile
  head/irc/ircd-ratbox/Makefile
  head/irc/ircd-ratbox-devel/Makefile
  head/japanese/libskk/Makefile
  head/japanese/libtomoe-gtk/Makefile
  head/japanese/scim-anthy/Makefile
  head/japanese/scim-canna/Makefile
  head/japanese/scim-honoka/Makefile
  head/japanese/scim-honoka/files/patch-configure
  head/japanese/scim-honoka-plugin-romkan/Makefile
  head/japanese/scim-honoka-plugin-wnn/Makefile
  head/japanese/scim-skk/Makefile
  head/japanese/scim-tomoe/Makefile
  head/japanese/scim-uim/Makefile
  head/japanese/tomoe/Makefile
  head/korean/scim-hangul/Makefile
  head/lang/gcc5/Makefile
  head/lang/gcc5-devel/Makefile
  head/lang/gcc6-devel/Makefile
  head/lang/smalltalk/Makefile
  head/mail/courier-authlib-vchkpw/Makefile
  head/mail/opendkim/Makefile
  head/math/glpk/Makefile
  head/misc/ipa_conv/Makefile
  head/misc/xfce4-weather-plugin/Makefile
  head/multimedia/cheese/Makefile
  head/multimedia/dirac/Makefile
  head/multimedia/gavl/Makefile
  head/multimedia/gmerlin/Makefile
  head/multimedia/gmerlin-avdecoder/Makefile
  head/multimedia/gstreamer/Makefile
  head/multimedia/gstreamer-plugins/Makefile
  head/multimedia/gstreamer-plugins-bad/Makefile
  head/multimedia/gstreamer-plugins-buzztard/Makefile
  head/multimedia/gstreamer-plugins-fluendo-mpegdemux/Makefile
  head/multimedia/gstreamer-plugins-vdpau/Makefile
  head/multimedia/gstreamer1/Makefile
  head/multimedia/gstreamer1-plugins/Makefile
  head/multimedia/gstreamer1-plugins-bad/Makefile
  head/multimedia/gstreamer1-vaapi/Makefile
  head/multimedia/libdc1394/Makefile
  head/multimedia/libmtp/Makefile
  head/multimedia/schroedinger/Makefile
  head/multimedia/vlc/Makefile
  head/multimedia/xmms/Makefile
  head/net/avahi-app/Makefile
  head/net/courier-authlib-ldap/Makefile
  head/net/libgnetwork/Makefile
  head/net/libnss-mysql/Makefile
  head/net/liboauth/Makefile
  head/net/librouteros/Makefile
  head/net/mpich2/Makefile
  head/net/ndpi/Makefile
  head/net-im/farsight2/Makefile
  head/net-im/farstream/Makefile
  head/net-im/folks/Makefile
  head/net-im/libaccounts-glib/Makefile
  head/net-im/libstrophe/Makefile
  head/net-im/libtelepathy/Makefile
  head/net-im/loudmouth/Makefile
  head/net-im/telepathy-mission-control/Makefile
  head/net-mgmt/netxms/Makefile
  head/ports-mgmt/packagekit/Makefile
  head/security/courier-authlib-base/Makefile
  head/security/duo/Makefile
  head/security/engine_pkcs11/Makefile
  head/security/fwknop/Makefile
  head/security/gcr/Makefile
  head/security/libmcrypt/Makefile
  head/security/libntlm/Makefile
  head/security/libp11/Makefile
  head/security/libprelude/Makefile
  head/security/libpreludedb/Makefile
  head/security/libssh2/Makefile
  head/security/munge/Makefile
  head/security/opensc/Makefile
  head/security/openvpn/Makefile
  head/security/openvpn-devel/Makefile
  head/security/pam_krb5/Makefile
  head/security/pam_krb5-rh/Makefile
  head/security/pkcs11-helper/Makefile
  head/sysutils/cinnamon-control-center/Makefile
  head/sysutils/garcon/Makefile
  head/sysutils/libieee1284/Makefile
  head/sysutils/policykit/Makefile
  head/sysutils/polkit/Makefile
  head/sysutils/tracker/Makefile
  head/sysutils/xfce4-battery-plugin/Makefile
  head/sysutils/xfce4-cpugraph-plugin/Makefile
  head/sysutils/xfce4-diskperf-plugin/Makefile
  head/sysutils/xfce4-fsguard-plugin/Makefile
  head/sysutils/xfce4-genmon-plugin/Makefile
  head/sysutils/xfce4-mount-plugin/Makefile
  head/sysutils/xfce4-systemload-plugin/Makefile
  head/sysutils/xfce4-wavelan-plugin/Makefile
  head/textproc/libextractor/Makefile
  head/textproc/link-grammar/Makefile
  head/textproc/rarian/Makefile
  head/textproc/scim-input-pad/Makefile
  head/textproc/scim-m17n/Makefile
  head/textproc/scim-openvanilla/Makefile
  head/textproc/scim-table-imengine/Makefile
  head/www/apache22/Makefile
  head/www/apache24/Makefile
  head/www/htdigest/Makefile
  head/www/mod_musicindex/Makefile
  head/www/mod_spdy/Makefile
  head/www/py-webkitgtk/Makefile
  head/www/shellinabox/Makefile
  head/www/swfdec-plugin/Makefile
  head/www/trafficserver/Makefile
  head/www/xfce4-smartbookmark-plugin/Makefile
  head/x11/keybinder/Makefile
  head/x11/libfm/Makefile
  head/x11/libxfce4menu/Makefile
  head/x11/mate-menus/Makefile
  head/x11/xfce4-verve-plugin/Makefile
  head/x11-clocks/xfce4-datetime-plugin/Makefile
  head/x11-clocks/xfce4-timer-out-plugin/Makefile
  head/x11-fm/thunar/Makefile
  head/x11-toolkits/gtk20/Makefile
  head/x11-toolkits/gtkglext/Makefile
  head/x11-toolkits/pango/Makefile
  head/x11-toolkits/py-gnome2/Makefile
  head/x11-toolkits/py-gtk2/Makefile
  head/x11-toolkits/py-gtkglext/Makefile
  head/x11-toolkits/py-gtksourceview/Makefile
  head/x11-toolkits/py-sexy/Makefile
  head/x11-wm/compizconfig-python/Makefile
  head/x11-wm/xfce4-panel/Makefile