Description of problem: I tried building upstream QEMU using clang: /home/dgilbert/git/qemu-world3/configure' '--cc=clang' '--prefix=/home/dgilbert/try2' and it failed with the error: ERROR: configure test passed without -Werror but failed with -Werror. digging a bit deeper I find in the config.log: clang -fPIE -DPIE -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -Wno-string-plus-int -Wno-initializer-overrides -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-definition -Wtype-limits -fstack-protector-strong -I/usr/include/p11-kit-1 -I/usr/include/libpng16 -o config-temp/qemu-conf.exe config-temp/qemu-conf.c -Wl,-z,relro -Wl,-z,now -pie -m64 -g -lssh2 -specs=/usr/lib/rpm/redhat/redhat-hardened-ld clang: warning: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-hardened-ld' clang -Werror -fPIE -DPIE -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -Wno-string-plus-int -Wno-initializer-overrides -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-definition -Wtype-limits -fstack-protector-strong -I/usr/include/p11-kit-1 -I/usr/include/libpng16 -o config-temp/qemu-conf.exe config-temp/qemu-conf.c -Wl,-z,relro -Wl,-z,now -pie -m64 -g -lssh2 -specs=/usr/lib/rpm/redhat/redhat-hardened-ld clang: error: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-hardened-ld' as far as I can see, the -specs line comes from a call to [dgilbert@dgilbert-t530 ~]$ pkg-config libssh2 --libs -lssh2 -specs=/usr/lib/rpm/redhat/redhat-hardened-ld which I guess is gcc/ld specific. Version-Release number of selected component (if applicable): libssh2-devel-1.6.0-2.fc23.x86_64 ccache-3.2.4-1.fc23.x86_64 How reproducible: 100% Steps to Reproduce: 1. download upstream qemu source 2. configure as above ensuring you have libssh2-devel installed Actual results: see above Expected results: a happy build Additional info:
Related Fesco ticket (the cause of this bug): https://fedorahosted.org/fesco/ticket/1384
I think it's safe to patch the libssh2.spec.in file to remove the libdir and LDFLAGS references as the libdir reference is to a standard library directory in Fedora (/usr/lib{64)), and the LDFLAGS bit pulls in flags for the libssh2 build (-specs=...) itself that aren't necessarily wanted by downstream users of the library, which can decide for themselves whether to be hardened or not (see also Bug #1204646). Any comments Kamil?
Indeed. Dropping @LDFLAGS@ from libssh2.pc.in sounds like a good idea! I am not sure about -L${libdir} though. Output of the following command tells me it is pretty common among other packages in Fedora: grep libdir /usr/lib64/pkgconfig/*.pc
I think -L${libdir} is common because it's useful from an upstream perspective where users might want to install the library in a non-system path, and hence it gets generated by default in most projects. However, in Fedora, where we're installing into the system library path, it's just (harmless) noise.
Yes, it will have no effect in most of the cases. The question is whether there is any reason to diverge from upstream in this. @LDFLAGS@ could be removed from libssh2.pc.in also in upstream libssh2. I see a similar commit in libcurl six years ago: https://github.com/bagder/curl/commit/4c8adc8f
libssh2-1.6.0-3.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-5c08769475
libssh2-1.6.0-3.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with $ su -c 'dnf --enablerepo=updates-testing update libssh2' You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-5c08769475
libssh2-1.6.0-3.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.
Paul, are you going to send the patch upstream? I believe it would be useful for upstream libssh2, too.
(In reply to Kamil Dudka from comment #9) > Paul, are you going to send the patch upstream? I believe it would be > useful for upstream libssh2, too. I was going to do this but it slipped my mind. Thanks for following up.
No problem. Thank you for getting it fixed! Upstream commit: https://github.com/libssh2/libssh2/commit/9bf32da6