Opened 8 months ago

#61243 assigned defect

libtool @2.4.6_9: link mode ignores specified compiler

Reported by: chrstphrchvz (Christopher Chavez) Owned by: larryv (Lawrence Velázquez)
Priority: Normal Milestone:
Component: ports Version: 2.6.3
Keywords: Cc:
Port: libtool

Description

A long-known issue (assuming it's still the same one) in libtool is that when run in link mode, it ignores the compiler specified on the command line, and instead uses whichever compiler is hardcoded in libtool, i.e. the one it was compiled with. The "workaround" is to configure your own libtool hardcoded with the compiler you intend to build other things with, as if you're not supposed to reuse a single libtool installation with other compilers.

One way this causes problems is that on macOS 10.6 (32 bit and presumably 64 bit) libtool is built with clang 3.7, and when other ports are built with another compiler (e.g. clang 9.0), libtool tries using clang 3.7 anyway during link mode. Example for recent libvterm 10.6 builds (32 bit and 64 bit):

glibtool --mode=link --tag=CC /opt/local/bin/clang-mp-9.0 -rpath /opt/local/lib -version-info 0:4:0 -o libvterm.la src/encoding.lo src/keyboard.lo src/mouse.lo src/parser.lo src/pen.lo src/screen.lo src/state.lo src/unicode.lo src/vterm.lo -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64
glibtool: link: /opt/local/bin/clang-mp-3.7 -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o .libs/libvterm.0.dylib  src/.libs/encoding.o src/.libs/keyboard.o src/.libs/mouse.o src/.libs/parser.o src/.libs/pen.o src/.libs/screen.o src/.libs/state.o src/.libs/unicode.o src/.libs/vterm.o   -L/opt/local/lib  -Wl,-headerpad_max_install_names -arch x86_64   -install_name  /opt/local/lib/libvterm.0.dylib -compatibility_version 1 -current_version 1.4 -Wl,-single_module
/opt/local/bin/glibtool: line 10550: /opt/local/bin/clang-mp-3.7: No such file or directory

Do any ports work around this? If so, are they expected to?

Change History (0)

Note: See TracTickets for help on using tickets.