Bug 226970 - audio/easytag: fails to build with lld as the system linker
Summary: audio/easytag: fails to build with lld as the system linker
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Roman Bogorodskiy
Depends on:
Blocks: 214864
  Show dependency treegraph
Reported: 2018-03-27 13:02 UTC by Ed Maste
Modified: 2018-03-31 12:12 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (novel)


Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer 2018-03-27 13:02:28 UTC
I'm working on switching to LLVM's lld linker as the FreeBSD system linker (/usr/bin/ld)[1], and the port in this PR is reported as a new failure in the exp-run, PR 214864.

An excerpt from the build log[2]:
checking the id3lib version... configure: error: could not determine id3lib version
===>  Script "configure" failed unexpectedly.

FreeBSD 11 and later have lld available as /usr/bin/ld.lld, so one simple option for testing is to just symlink /usr/bin/ld to ld.lld (and restore it to ld.bfd).

A port Makefile knob, LLD_UNSAFE=yes, exists to indicate that a port does not work with lld, and requires either /usr/bin/ld.bfd or binutils from ports. This should work for the common case of ports written in C using GNU autoconf; it may have no effect on other ports.

[1] https://lists.freebsd.org/pipermail/freebsd-current/2018-March/068985.html
[2] http://package18.nyi.freebsd.org/data/headamd64PR214864-default/2018-03-21_17h43m11s/logs/errors/easytag-2.4.3_1.log
Comment 1 Ed Maste freebsd_committer 2018-03-27 21:25:42 UTC
Via tobik@ in ports r465725, BINARY_ALIAS=ld=ld.bfd may be an effective workaround if LLD_UNSAFE does not work.
Comment 2 Roman Bogorodskiy freebsd_committer 2018-03-28 16:23:16 UTC
Hm, in config.log there is more details on this failure:

configure:18938: cc -o conftest -g -fstack-protector -fno-strict-aliasing -I/usr/local/include -DHAVE_GTK  -fstack-protector conftest.c -lid3 -L/usr/local/lib >&5
configure:18938: $? = 0
configure:18938: ./conftest
/usr/local/lib/libid3-3.8.so.3: Undefined symbol "_ZTVN10__cxxabiv120__si_class_type_infoE"

It looks like it's really pulling in come c++ stuff:

$ nm --demangle -D /usr/local/lib/libid3-3.8.so.3|grep class
                 U vtable for __cxxabiv1::__class_type_info
                 U vtable for __cxxabiv1::__si_class_type_info

I can get it to build by explicitly adding -lstdc++ to id3's LIBS.

--- configure.bak       2016-12-05 23:32:24.000000000 +0400                                                                                                                                                        
+++ configure   2018-03-28 20:21:24.641935000 +0400                                                                                                                                                                
@@ -18871,7 +18871,7 @@                                                                                                                                                                                            
   return 0;                                                                                                                                                                                                       
-for ac_lib in '' "id3" "id3 -lstdc++" "id3 -lz" "id3 -lz -lstdc++"; do                                                                                                                                            
+for ac_lib in "id3 -lz -lstdc++"; do                                                                                                                                                                              
   if test -z "$ac_lib"; then                                                                                                                                                                                      
     ac_res="none required"                                                                                                                                                                                        

I'm not sure though where this comes from and why FreeBSD linker does not complain about that?
Comment 3 commit-hook freebsd_committer 2018-03-31 12:09:47 UTC
A commit references this bug:

Author: novel
Date: Sat Mar 31 12:09:11 UTC 2018
New revision: 466044
URL: https://svnweb.freebsd.org/changeset/ports/466044

  audio/easytag: fix build with lld

  When detecting libid3, make sure to add -lstdc++ to its LIBS, otherwise with
  lld easytag's configure script fails to run its test binaries it complies to
  detect libid3 and fails.

  PR:		226970
  Reported by:	emaste

Comment 4 Roman Bogorodskiy freebsd_committer 2018-03-31 12:12:47 UTC
Should be fine now, thanks for report.