Cygwin Binutils Package Support for Link-Time Optimization?
Matthew Sheets
ms.github@outlook.com
Sat Nov 14 12:18:54 GMT 2026
Is the Cygwin Binutils package not currently built and packaged with support for Link-Time Optimization?
A build that succeeds under Ubuntu fails under Cygwin, with the following “plugin needed to handle lto object” messages found in the output logs:
```
checking command to parse nm output... nm: conftest.o: plugin needed to handle lto object
nm: conftest.o: plugin needed to handle lto object
…
ar rc ./libiberty.a \
./regex.o ./cplus-dem.o ./cp-demangle.o ./md5.o ./sha1.o ./alloca.o ./argv.o ./choose-temp.o ./concat.o ./cp-demint.o ./dyn-string.o ./fdmatch.o ./fibheap.o ./filename_cmp.o ./floatformat.o ./fnmatch.o ./fopen_unlocked.o ./getopt.o ./getopt1.o ./getpwd.o ./getruntime.o ./hashtab.o ./hex.o ./lbasename.o ./lrealpath.o ./make-relative-prefix.o ./make-temp-file.o ./objalloc.o ./obstack.o ./partition.o ./pexecute.o ./physmem.o ./pex-common.o ./pex-one.o ./pex-unix.o ./safe-ctype.o ./sort.o ./spaces.o ./splay-tree.o ./strerror.o ./strsignal.o ./unlink-if-ordinary.o ./xatexit.o ./xexit.o ./xmalloc.o ./xmemdup.o ./xstrdup.o ./xstrerror.o ./xstrndup.o ./sigsetmask.o
ar: ./regex.o: plugin needed to handle lto object
ranlib ./libiberty.a
ranlib: ./libiberty.a(regex.o): plugin needed to handle lto object
```
Man pages for Binutils tools such as `nm` and `ar` note the following under `--plugins` documentation:
“In order to make [nm | ar | etc ] use the linker plugin it must be copied into the ${libdir}/bfd-plugins directory. For GCC based compilations the linker plugin is called liblto_plugin.so.0.0.0.”
A package contents search for "liblto" finds no matches:
https://cygwin.com/cgi-bin2/package-grep.cgi?grep=liblto
Are there any known issues or impediments to enabling Link-Time Optimization (-flto) capabilities within Binutils?
Thank you,
Matthew
More information about the Cygwin-apps
mailing list