libaio custom CFLAGS no longer required
Description:
# libaio is a thin wrapper around kernel syscalls, it does not use stdlib and
# other helpers like stack protection libraries
CFLAGS="-march=${CARCH/_/-} -mtune=generic -O2 -pipe"
Since upstream introduced commit 672eaeb Link against libgcc to avoid unresolved symbols which is part of 0.3.113 this is no longer correct.
$ git clone https://pagure.io/libaio.git
Cloning into 'libaio'...
remote: Enumerating objects: 1166, done.
remote: Counting objects: 100% (1166/1166), done.
remote: Compressing objects: 100% (440/440), done.
remote: Total 1166 (delta 830), reused 993 (delta 711), pack-reused 0
Receiving objects: 100% (1166/1166), 201.37 KiB | 375.00 KiB/s, done.
Resolving deltas: 100% (830/830), done.
$ cd libaio/
$ git tag --contains 672eaebd131c789a528e3a9cd089b4b69a82012b
libaio-0.3.112
libaio-0.3.113
libaio can now use CFLAGS but it can not use LTO. Fedora's libaio is still on 0.3.111 but with libaio-remove-nostartfiles-nostdlib-from-build-flags.patch. The flags used by Fedora for libaio-0.3.111-19.fc40.x86_64:
$ curl -O https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/debug/tree/Packages/l/libaio-debuginfo-0.3.111-19.fc40.x86_64.rpm
$ bsdtar -xf libaio-debuginfo-0.3.111-19.fc40.x86_64.rpm
$ readelf -wi ./usr/lib/debug/usr/lib64/libaio.so.1.0.0-0.3.111-19.fc40.x86_64.debug | grep DW_AT_producer
<2cc> DW_AT_producer : (alt indirect string, offset: 0x104) GNU C17 14.0.1 20240118 (Red Hat 14.0.1-0) -m64 -mtune=generic -mno-omit-leaf-frame-pointer -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-omit-frame-pointer -fPIC -fplugin=annobin
<365> DW_AT_producer : (alt indirect string, offset: 0x104) GNU C17 14.0.1 20240118 (Red Hat 14.0.1-0) -m64 -mtune=generic -mno-omit-leaf-frame-pointer -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-omit-frame-pointer -fPIC -fplugin=annobin
<3ec> DW_AT_producer : (alt indirect string, offset: 0x104) GNU C17 14.0.1 20240118 (Red Hat 14.0.1-0) -m64 -mtune=generic -mno-omit-leaf-frame-pointer -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-omit-frame-pointer -fPIC -fplugin=annobin
<484> DW_AT_producer : (alt indirect string, offset: 0x104) GNU C17 14.0.1 20240118 (Red Hat 14.0.1-0) -m64 -mtune=generic -mno-omit-leaf-frame-pointer -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-omit-frame-pointer -fPIC -fplugin=annobin
<5bf> DW_AT_producer : (alt indirect string, offset: 0x104) GNU C17 14.0.1 20240118 (Red Hat 14.0.1-0) -m64 -mtune=generic -mno-omit-leaf-frame-pointer -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-omit-frame-pointer -fPIC -fplugin=annobin
<7f1> DW_AT_producer : (alt indirect string, offset: 0x104) GNU C17 14.0.1 20240118 (Red Hat 14.0.1-0) -m64 -mtune=generic -mno-omit-leaf-frame-pointer -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-omit-frame-pointer -fPIC -fplugin=annobin
<8ce> DW_AT_producer : (alt indirect string, offset: 0x104) GNU C17 14.0.1 20240118 (Red Hat 14.0.1-0) -m64 -mtune=generic -mno-omit-leaf-frame-pointer -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-omit-frame-pointer -fPIC -fplugin=annobin
<9ae> DW_AT_producer : (alt indirect string, offset: 0x104) GNU C17 14.0.1 20240118 (Red Hat 14.0.1-0) -m64 -mtune=generic -mno-omit-leaf-frame-pointer -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-omit-frame-pointer -fPIC -fplugin=annobin
<a73> DW_AT_producer : (alt indirect string, offset: 0x104) GNU C17 14.0.1 20240118 (Red Hat 14.0.1-0) -m64 -mtune=generic -mno-omit-leaf-frame-pointer -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-omit-frame-pointer -fPIC -fplugin=annobin
<b1b> DW_AT_producer : (alt indirect string, offset: 0x104) GNU C17 14.0.1 20240118 (Red Hat 14.0.1-0) -m64 -mtune=generic -mno-omit-leaf-frame-pointer -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-omit-frame-pointer -fPIC -fplugin=annobin
<b3f> DW_AT_producer : (alt indirect string, offset: 0x104) GNU C17 14.0.1 20240118 (Red Hat 14.0.1-0) -m64 -mtune=generic -mno-omit-leaf-frame-pointer -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-omit-frame-pointer -fPIC -fplugin=annobin
$ readelf -wi ./usr/lib/debug/usr/lib64/libaio.so.1.0.1-0.3.111-19.fc40.x86_64.debug | grep DW_AT_producer
<2cc> DW_AT_producer : (alt indirect string, offset: 0x104) GNU C17 14.0.1 20240118 (Red Hat 14.0.1-0) -m64 -mtune=generic -mno-omit-leaf-frame-pointer -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-omit-frame-pointer -fPIC -fplugin=annobin
<365> DW_AT_producer : (alt indirect string, offset: 0x104) GNU C17 14.0.1 20240118 (Red Hat 14.0.1-0) -m64 -mtune=generic -mno-omit-leaf-frame-pointer -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-omit-frame-pointer -fPIC -fplugin=annobin
<3ec> DW_AT_producer : (alt indirect string, offset: 0x104) GNU C17 14.0.1 20240118 (Red Hat 14.0.1-0) -m64 -mtune=generic -mno-omit-leaf-frame-pointer -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-omit-frame-pointer -fPIC -fplugin=annobin
<484> DW_AT_producer : (alt indirect string, offset: 0x104) GNU C17 14.0.1 20240118 (Red Hat 14.0.1-0) -m64 -mtune=generic -mno-omit-leaf-frame-pointer -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-omit-frame-pointer -fPIC -fplugin=annobin
<5bf> DW_AT_producer : (alt indirect string, offset: 0x104) GNU C17 14.0.1 20240118 (Red Hat 14.0.1-0) -m64 -mtune=generic -mno-omit-leaf-frame-pointer -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-omit-frame-pointer -fPIC -fplugin=annobin
<7f1> DW_AT_producer : (alt indirect string, offset: 0x104) GNU C17 14.0.1 20240118 (Red Hat 14.0.1-0) -m64 -mtune=generic -mno-omit-leaf-frame-pointer -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-omit-frame-pointer -fPIC -fplugin=annobin
<8ce> DW_AT_producer : (alt indirect string, offset: 0x104) GNU C17 14.0.1 20240118 (Red Hat 14.0.1-0) -m64 -mtune=generic -mno-omit-leaf-frame-pointer -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-omit-frame-pointer -fPIC -fplugin=annobin
<9ae> DW_AT_producer : (alt indirect string, offset: 0x104) GNU C17 14.0.1 20240118 (Red Hat 14.0.1-0) -m64 -mtune=generic -mno-omit-leaf-frame-pointer -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-omit-frame-pointer -fPIC -fplugin=annobin
<a73> DW_AT_producer : (alt indirect string, offset: 0x104) GNU C17 14.0.1 20240118 (Red Hat 14.0.1-0) -m64 -mtune=generic -mno-omit-leaf-frame-pointer -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-omit-frame-pointer -fPIC -fplugin=annobin
<b1b> DW_AT_producer : (alt indirect string, offset: 0x104) GNU C17 14.0.1 20240118 (Red Hat 14.0.1-0) -m64 -mtune=generic -mno-omit-leaf-frame-pointer -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-omit-frame-pointer -fPIC -fplugin=annobin
<b3f> DW_AT_producer : (alt indirect string, offset: 0x104) GNU C17 14.0.1 20240118 (Red Hat 14.0.1-0) -m64 -mtune=generic -mno-omit-leaf-frame-pointer -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-omit-frame-pointer -fPIC -fplugin=annobin
Compared to Arch flags:
-m64 -mtune=generic -mno-omit-leaf-frame-pointer -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full -fno-omit-frame-pointer -fPIC -fplugin=annobin
-mtune=generic -march=x86-64 -g -O2 -fexceptions -fstack-clash-protection -fcf-protection -fPIC -Wformat -Werror=format-security -ffile-prefix-map=/build/libaio/src=/usr/src/debug/libaio -pipe -fno-plt -Wp,-D_FORTIFY_SOURCE=2 -Wall -I.
Additional info:
- libaio 0.3.113-2
- https://pagure.io/libaio/c/672eaebd131c789a528e3a9cd089b4b69a82012b
- https://src.fedoraproject.org/rpms/libaio/c/fecfaf7d70b9ef98d8cb17d85545445b8201f3f5?branch=rawhide
- https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/debug/tree/Packages/l/libaio-debuginfo-0.3.111-19.fc40.x86_64.rpm
Steps to reproduce:
$ lddtree /usr/lib/libaio.so.1.0.2
/usr/lib/libaio.so.1.0.2 (interpreter => None)
libc.so.6 => /usr/lib/libc.so.6
ld-linux-x86-64.so.2 => /usr/lib/ld-linux-x86-64.so.2