openzfs / zfs

OpenZFS on Linux and FreeBSD
https://openzfs.github.io/openzfs-docs
Other
10.72k stars 1.76k forks source link

gcc-annobin.so expanded from short plugin name gcc-annobin: No such file or directory #14386

Open mightyspiky opened 1 year ago

mightyspiky commented 1 year ago

System information

Type Version/Name
Distribution Name Oracle Linux
Distribution Version 8.7
Kernel Version 5.15.0-6.80.3.1.el8uek
Architecture aarch64
OpenZFS Version 2.1.7

Describe the problem you're observing

I get the following error while compiling ZFS 2.1.7 with kernel 5.15.0-6.80.3.1.el8uek.aarch64 from Oracle:

cc1: fatal error: inaccessible plugin file /opt/rh/gcc-toolset-11/root/usr/lib/gcc/aarch64-redhat-linux/11/plugin/gcc-annobin.so expanded from short plugin name gcc-annobin: No such file or directory

A workaround to make compilation works is to make the following symlink by hand:

[root@server ~]# cd /opt/rh/gcc-toolset-11/root/usr/lib/gcc/aarch64-redhat-linux/11/plugin/
[root@server plugin]# ln -s annobin.so gcc-annobin.so

After that, compilation works. I just don't know if it's a bug with OpenZFS or with a package from Oracle. Please note that I only have the problem on aarch64, not on x86_64, which I've also tried with same kernel and zfs version.

Describe how to reproduce the problem

[root@server ~]# cd zfs-2.1.7
[root@server zfs-2.1.7]# scl enable gcc-toolset-11 "./configure --with-spec=redhat"
...
[root@server zfs-2.1.7]# scl enable gcc-toolset-11 "make -j1 rpm-kmod"
...

Include any warning/errors/backtraces from the system logs

...
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/tmp/zfs-build-root-IR0ZIJze/BUILD/zfs-2.1.7':
configure: error: C compiler cannot create executables
See `config.log' for more details
error: Bad exit status from /tmp/zfs-build-root-IR0ZIJze/TMP/rpm-tmp.dSjwZP (%build)

RPM build errors:
    Bad exit status from /tmp/zfs-build-root-IR0ZIJze/TMP/rpm-tmp.dSjwZP (%build)
make[1]: *** [Makefile:1692: rpm-common] Error 1
make[1]: Leaving directory '/root/20230112_123622/zfs-2.1.7'
make: *** [Makefile:1631: rpm-kmod] Error 2
[root@server zfs-2.1.7]#
[root@server zfs-2.1.7]# cat /tmp/zfs-build-root-IR0ZIJze/BUILD/zfs-2.1.7/config.log
…
cc1: fatal error: inaccessible plugin file /opt/rh/gcc-toolset-11/root/usr/lib/gcc/aarch64-redhat-linux/11/plugin/gcc-annobin.so expanded from short plugin name gcc-annobin: No such file or directory
…
[root@server ~]# ls -l /opt/rh/gcc-toolset-11/root/usr/lib/gcc/aarch64-redhat-linux/11/plugin/
total 34
lrwxrwxrwx. 1 root root    16 Apr  1  2022 annobin.so -> annobin.so.0.0.0
lrwxrwxrwx. 1 root root    16 Apr  1  2022 annobin.so.0 -> annobin.so.0.0.0
-rwxr-xr-x. 1 root root 69784 Apr  1  2022 annobin.so.0.0.0
[root@server ~]# 
[root@server ~]# 
[root@server ~]# cd /opt/rh/gcc-toolset-11/root/usr/lib/gcc/aarch64-redhat-linux/11/plugin/
[root@server plugin]# ln -s annobin.so gcc-annobin.so
[root@server plugin]# ls -l
total 34
lrwxrwxrwx. 1 root root    16 Apr  1  2022 annobin.so -> annobin.so.0.0.0
lrwxrwxrwx. 1 root root    16 Apr  1  2022 annobin.so.0 -> annobin.so.0.0.0
-rwxr-xr-x. 1 root root 69784 Apr  1  2022 annobin.so.0.0.0
lrwxrwxrwx. 1 root root    10 Jan 12 12:44 gcc-annobin.so -> annobin.so
[root@server plugin]#
rincebrain commented 1 year ago

I believe it's still the case that Oracle's distro does things to the package naming and tooling that make it unique compared to other centos/redhat derivatives, and that nobody's written and gotten a fix merged that doesn't require terrible hacks.

Not to say they'd be unwelcome if someone offered them, but I don't know of anyone who regularly writes fixes who runs Oracle UEL.

mightyspiky commented 1 year ago

Good to read you again @rincebrain !! I knew you would be the first to respond to my issue :) . At least, do you think I can be relatively sure I won't get any bad surprise from using my compiled ZFS that has use the mentioned hack (creating symlink gcc-annobin.so pointing at annobin.so) during compilation?

rincebrain commented 1 year ago

That plugin looks like it's just used to shove extra metadata in the binaries, so I wouldn't inherently expect any excitement about it, but I can't promise anything about a compiler plugin not being exciting.

toracat commented 6 months ago

Just saw this report and wanted to provide a link to the "official" statement from RH:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/developing_c_and_cpp_applications_in_rhel_9/assembly_additional-toolsets-for-development-rhel-9_developing-applications#ref_specifics-of-annobin-in-gcc-toolset-12_gcc-toolset-12

"To work around the problem, create a symbolic link in the plugin directory from the annobin.so file to the gcc-annobin.so file"