hi Mattia,
On Sat, Apr 30, 2022 at 6:09 PM Mattia Verga via devel
<devel(a)lists.fedoraproject.org> wrote:
Hello folks,
while updating package wcstools to the latest release, I've been trying
to clean up the specfile. I could use some help from someone with better
gcc knowledge to resolve a build problem when trying to use
'%make_build' instead of plain 'make'. Can someone take a look at the
build logs [1] and give me some advice? Is the failure due to parallel
build usage or can be fixed by patching out the code somewhere?
the failure was due to the missing wcstools library when the linker
was trying to link simpos.
=== quote begin ===
gcc -O2 -flto=auto -ffat-lto-objects -fexceptions -g
-grecord-gcc-switches -pipe -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1
-m64 -mtune=generic -fasynchronous-unwind-tables
-fstack-clash-protection -fcf-protection -Wl,-z,relro -Wl,--as-needed
-Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1
-Wl,-dT,/builddir/build/BUILD/wcstools-3.9.7/.package_note-wcstools-3.9.7-1.fc37.x86_64.ld
-o bin/simpos simpos.c -L libwcs -lwcstools -lm
simpos.c: In function 'main':
simpos.c:86:20: warning: suggest parentheses around assignment used as
truth value [-Wparentheses]
86 | while (c = *++str) {
| ^
simpos.c:186:13: warning: ignoring return value of 'fgets' declared
with attribute 'warn_unused_result' [-Wunused-result]
186 | fgets (newobj, 32, flist);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: cannot find -lwcstools: No such file or directory
=== quote end ===
but at the end of the log, it seems GNU make was actually building
libwcstools.a and libwcstools.so.1
=== quote begin ===
ranlib libwcstools.a
make[1]: Leaving directory '/builddir/build/BUILD/wcstools-3.9.7/libwcs'
ar: creating libwcstools.a
...
ln -s libwcstools.so.1.0.0 libwcstools.so.1
ln -s
libwcstools.so.1.0.0 libwcstools.so
=== quote end ===
so my guess is that the upstream makefile just fails to explain the
build dependency correctly. and we should disable the parallel build
to workaround this. probably a better way is to fix the Makefile
though.
HTH.
cheers.
--
Regards
Kefu Chai