#10 master: linking with LTO fails
Opened 3 years ago by kloczek. Modified 2 years ago

gcc -shared -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -flto=auto -flto-partition=none -fdata-sections -ffunction-sections -Wall -I. -fPIC -Wl,--version-script=libaio.map -Wl,-soname=libaio.so.1 -o libaio.so.1.0.1 io_queue_init.os io_queue_release.os io_queue_wait.os io_queue_run.os io_getevents.os io_submit.os io_cancel.os io_setup.os io_destroy.os io_pgetevents.os raw_syscall.os compat-0_1.os -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -flto=auto -flto-partition=none -fdata-sections -ffunction-sections -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,--gc-sections
{standard input}: Assembler messages:
{standard input}: Error: invalid attempt to declare external version name as default in symbol `io_queue_wait@@LIBAIO_0.4'
lto-wrapper: fatal error: gcc returned 1 exit status

gentle ping :smile:
Just tested 1.113 and lookd like issue still is around .. :pensive:

There's not a lot of code here to optimize, so there wouldn't likely be a benefit to enabling LTO. Additionally, in order to enable LTO, I'd have to switch to using a new "symver" attribute, which isn't supported by older compilers (it was introduced in gcc version 10).

Is there a reason you need this?

Reason is the same: LTO i s not working. Size reduction with LTO doesn't matter :smile:
https://engineering.instawork.com/death-by-a-thousand-papercuts-and-how-to-avoid-it-d2f05070b339

BTW I implemented this as part of the patch series posted some time ago at https://marc.info/?l=linux-aio&m=164999309120529&w=2. :)

It would be nice to merge that into main tree :)

Login to comment on this ticket.

Metadata