Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 778050 - x11-libs/motif-2.3.8-r1 cannot find -lwml with rlibtool
Summary: x11-libs/motif-2.3.8-r1 cannot find -lwml with rlibtool
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Ulrich Müller
URL:
Whiteboard:
Keywords: PATCH, UPSTREAM
: 790488 (view as bug list)
Depends on:
Blocks: slibtool
  Show dependency tree
 
Reported: 2021-03-25 01:34 UTC by Alessandro Barbieri
Modified: 2022-03-30 17:09 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge_info (emerge_info,17.63 KB, text/plain)
2021-03-25 01:34 UTC, Alessandro Barbieri
Details
motif-2.3.8-r1:20210325-011443.log (motif-2.3.8-r1:20210325-011443.log,783.49 KB, text/plain)
2021-03-25 01:35 UTC, Alessandro Barbieri
Details
Makefile.in (Makefile.in,28.84 KB, text/plain)
2021-03-25 08:06 UTC, Alessandro Barbieri
Details
Makefile.am (Makefile.am,1.71 KB, text/plain)
2021-03-25 08:10 UTC, Alessandro Barbieri
Details
Patches to fix the build with slibtool. (motif-slibtool.patch,12.30 KB, patch)
2021-03-25 15:43 UTC, orbea
Details | Diff
Patches with GLEP 76 signoff (motif-2.3.8-slibtool.patch,12.38 KB, patch)
2022-03-30 00:47 UTC, orbea
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alessandro Barbieri 2021-03-25 01:34:35 UTC
This package fails to compile on an unstable system. Attached relevant logs and emerge --info
Comment 1 Alessandro Barbieri 2021-03-25 01:34:52 UTC
Created attachment 693384 [details]
emerge_info

emerge --info
Comment 2 Alessandro Barbieri 2021-03-25 01:35:21 UTC
Created attachment 693387 [details]
motif-2.3.8-r1:20210325-011443.log

build log
Comment 3 Alessandro Barbieri 2021-03-25 01:48:33 UTC
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/x11-libs/motif-2.3.8-r1/work/motif-2.3.8/tools/wml -I../../include -I../../lib/Xm -I../../lib -I/var/tmp/portage/x11-libs/motif-2.3.8-r1/work/motif-2.3.8/tools/wml/../../lib -
I/var/tmp/portage/x11-libs/motif-2.3.8-r1/work/motif-2.3.8/tools/wml/../../include    -pthread -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/syspr
of-4  -Os -pipe -march=native -fdiagnostics-color=always -Os -pipe -march=native -fdiagnostics-color=always -Wimplicit-function-declaration -Wno-error=implicit-function-declaration -fno-strict-aliasing -Wall -fno-strict-aliasing -Wno-unus
ed -Wno-comment -pthread -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4   -c -o wmloutkey.o /var/tmp/portage/x11-libs/motif-2.3.8-r1/work
/motif-2.3.8/tools/wml/wmloutkey.c                                                                                                                                                                                                            
/var/tmp/portage/x11-libs/motif-2.3.8-r1/work/motif-2.3.8/tools/wml/wmloutkey.c: In function 'wmlOutputUilKeyTabBody':
/var/tmp/portage/x11-libs/motif-2.3.8-r1/work/motif-2.3.8/tools/wml/wmloutkey.c:621:37: warning: format '%d' expects argument of type 'int', but argument 5 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]                           
  621 |     fprintf (outfil, "    {%s, %s, %d, %s, \"%s\"},\n",                                                                                                                                                                               
      |                                    ~^
      |                                     |
      |                                     int       
      |                                    %ld
......                                                                                                                 
  624 |       strlen(tokstg),
      |       ~~~~~~~~~~~~~~                 
      |       |     
      |       size_t {aka long unsigned int}
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/x11-libs/motif-2.3.8-r1/work/motif-2.3.8/tools/wml -I../../include -I../../lib/Xm -I../../lib -I/var/tmp/portage/x11-libs/motif-2.3.8-r1/work/motif-2.3.8/tools/wml/../../lib -
I/var/tmp/portage/x11-libs/motif-2.3.8-r1/work/motif-2.3.8/tools/wml/../../include    -pthread -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/syspr
of-4  -Os -pipe -march=native -fdiagnostics-color=always -Os -pipe -march=native -fdiagnostics-color=always -Wimplicit-function-declaration -Wno-error=implicit-function-declaration -fno-strict-aliasing -Wall -fno-strict-aliasing -Wno-unus
ed -Wno-comment -pthread -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4   -c -o wmlparse.o /var/tmp/portage/x11-libs/motif-2.3.8-r1/work/
motif-2.3.8/tools/wml/wmlparse.c                                                                                                                                                                                                              
rm -f libwml.a               
llvm-ar cru libwml.a wmlparse.o wml.o wmloutkey.o wmlouth.o wmloutmm.o wmloutp1.o wmlresolve.o wmlsynbld.o wmlutils.o 
llvm-ranlib libwml.a                                                                                                   
rlibtool  --tag=CC   --mode=link x86_64-pc-linux-gnu-gcc  -Os -pipe -march=native -fdiagnostics-color=always -Os -pipe -march=native -fdiagnostics-color=always -Wimplicit-function-declaration -Wno-error=implicit-function-declaration -fno-
strict-aliasing -Wall -fno-strict-aliasing -Wno-unused -Wno-comment -pthread -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4    -Wl,-O1 -W
l,--as-needed -o wml wml.o -L. -lwml -lfontconfig -lfreetype -lXft -ljpeg -lpng                                                                                                                                                               
rlibtool: lconf: {.name="libtool"}.
rlibtool: fdcwd: {.fdcwd=AT_FDCWD, .realpath="/var/tmp/portage/x11-libs/motif-2.3.8-r1/work/motif-2.3.8-abi_x86_64.amd64/tools/wml"}.
rlibtool: lconf: fstatat(AT_FDCWD,".",...) = 0 {.st_dev = 40, .st_ino = 626923}.
rlibtool: lconf: openat(AT_FDCWD,"libtool",O_RDONLY,0) = -1 [ENOENT].
rlibtool: lconf: openat(AT_FDCWD,"../",O_DIRECTORY,0) = 5.
rlibtool: lconf: fstat(5,...) = 0 {.st_dev = 40, .st_ino = 626912}.
rlibtool: lconf: openat(5,"libtool",O_RDONLY,0) = -1 [ENOENT].
rlibtool: lconf: openat(5,"../",O_DIRECTORY,0) = 6.
rlibtool: lconf: fstat(6,...) = 0 {.st_dev = 40, .st_ino = 621205}.
rlibtool: lconf: openat(6,"libtool",O_RDONLY,0) = 5.
rlibtool: lconf: found "/var/tmp/portage/x11-libs/motif-2.3.8-r1/work/motif-2.3.8-abi_x86_64.amd64/libtool".
rlibtool: link: x86_64-pc-linux-gnu-gcc wml.o -Os -pipe -march=native -fdiagnostics-color=always -Os -pipe -march=native -fdiagnostics-color=always -Wimplicit-function-declaration -Wno-error=implicit-function-declaration -fno-strict-alias
ing -Wall -fno-strict-aliasing -Wno-unused -Wno-comment -pthread -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -Wl,-O1 -Wl,--as-needed -
L./.libs -lwml -lfontconfig -lfreetype -lXft -ljpeg -lpng -o .libs/wml
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lwml
collect2: error: ld returned 1 exit status
rlibtool: exec error upon slbt_exec_link_create_executable(), line 1614: (see child process error messages).
rlibtool: < returned to > slbt_exec_link(), line 1934.
make[2]: *** [Makefile:494: wml] Error 2
make[2]: Leaving directory '/var/tmp/portage/x11-libs/motif-2.3.8-r1/work/motif-2.3.8-abi_x86_64.amd64/tools/wml'
make[1]: *** [Makefile:395: all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/x11-libs/motif-2.3.8-r1/work/motif-2.3.8-abi_x86_64.amd64/tools'
make: *** [Makefile:454: all-recursive] Error 1
 * ERROR: x11-libs/motif-2.3.8-r1::gentoo failed (compile phase):
 *   emake failed
Comment 4 Ulrich Müller gentoo-dev 2021-03-25 07:38:14 UTC
(In reply to Alessandro Barbieri from comment #3)

Not sure what is happening there. Note that an explicit -L. is passed to the linker (from tools/wml/Makefile.am which has "wml_LDADD = -L. -lwml"):

> rlibtool  --tag=CC   --mode=link x86_64-pc-linux-gnu-gcc  -Os -pipe
> -march=native -fdiagnostics-color=always -Os -pipe -march=native
> -fdiagnostics-color=always -Wimplicit-function-declaration
> -Wno-error=implicit-function-declaration -fno-
> strict-aliasing -Wall -fno-strict-aliasing -Wno-unused -Wno-comment -pthread
> -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/harfbuzz
> -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include
> -I/usr/include/sysprof-4    -Wl,-O1 -W
> l,--as-needed -o wml wml.o -L. -lwml -lfontconfig -lfreetype -lXft -ljpeg
> -lpng                                                                       

... but in the following line it has been dropped:

> rlibtool: link: x86_64-pc-linux-gnu-gcc wml.o -Os -pipe -march=native
> -fdiagnostics-color=always -Os -pipe -march=native
> -fdiagnostics-color=always -Wimplicit-function-declaration
> -Wno-error=implicit-function-declaration -fno-strict-alias
> ing -Wall -fno-strict-aliasing -Wno-unused -Wno-comment -pthread
> -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/harfbuzz
> -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include
> -I/usr/include/sysprof-4 -Wl,-O1 -Wl,--as-needed -
> L./.libs -lwml -lfontconfig -lfreetype -lXft -ljpeg -lpng -o .libs/wml
> /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/
> ld: cannot find -lwml

Can you post the Makefile from tools/wml/ in the build directory?
Comment 5 Alessandro Barbieri 2021-03-25 08:06:30 UTC
Created attachment 693393 [details]
Makefile.in

tools/wml/Makefile.in
Comment 6 Alessandro Barbieri 2021-03-25 08:10:36 UTC
Created attachment 693396 [details]
Makefile.am

tools/wml/Makefile.am
Comment 7 Ulrich Müller gentoo-dev 2021-03-25 09:08:09 UTC
(In reply to Alessandro Barbieri from comment #5)
> tools/wml/Makefile.in

That's not the generated Makefile in the build directory, but Makefile.in should be good enough.

Makefile.in has:

wml$(EXEEXT): $(wml_OBJECTS) $(wml_DEPENDENCIES) $(EXTRA_wml_DEPENDENCIES) 
	@rm -f wml$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(wml_OBJECTS) $(wml_LDADD) $(LIBS)

with:

wml_LDADD = -L. -lwml

There should be a libwml.a in /var/tmp/portage/x11-libs/motif-2.3.8-r1/work/motif-2.3.8-abi_x86_64.amd64/tools/wml/libwml.a at the time the build fails, at least the build.log suggests that (but please double check).


I'd blame rlibtool at this point, because it ignores an explicitly specified "-L." option (and things work with GNU libtool). Reassigning.
Comment 8 orbea 2021-03-25 13:48:45 UTC
> I'd blame rlibtool at this point, because it ignores an explicitly specified "-L." option (and things work with GNU libtool). Reassigning.

This is a project bug, building a static library without $(LIBTOOL) and then trying to link it with $(LIBTOOL) is wrong. GNU libtool is overly permissive and just happens to work.

The correct solution is to create an appropriate .la file and link with that, but a workaround would be link directly to the .a library and remove '-L. -lwml'.

Same issue in texlive-core and proftpd.
Comment 9 orbea 2021-03-25 15:43:30 UTC
Created attachment 693453 [details, diff]
Patches to fix the build with slibtool.

These patches are applied to the motif master branch and fix the issue with slibtool while still working with GNU libtool.
Comment 10 orbea 2021-03-25 16:59:42 UTC
Upstream issue (With patches).

http://bugs.motifzone.net/show_bug.cgi?id=1720
Comment 11 Ulrich Müller gentoo-dev 2021-03-26 07:30:18 UTC
Will apply when the patch is accepted upstream.
Comment 12 Ulrich Müller gentoo-dev 2021-05-16 11:04:48 UTC
*** Bug 790488 has been marked as a duplicate of this bug. ***
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-03-28 04:46:17 UTC
(In reply to Ulrich Müller from comment #11)
> Will apply when the patch is accepted upstream.

Can we merge this given no reply?
Comment 14 Ulrich Müller gentoo-dev 2022-03-28 12:37:23 UTC
(In reply to Sam James from comment #13)
> (In reply to Ulrich Müller from comment #11)
> > Will apply when the patch is accepted upstream.
> 
> Can we merge this given no reply?

We'd have to host the patch on Gentoo infra then.

@orbea: We need a GLEP 76 signoff for the patch from attachment 693453 [details, diff]:
https://www.gentoo.org/glep/glep-0076.html#certificate-of-origin
Posting it as a comment to this bug would sufficient.
Comment 15 orbea 2022-03-30 00:47:19 UTC
Created attachment 768171 [details, diff]
Patches with GLEP 76 signoff
Comment 16 orbea 2022-03-30 00:48:02 UTC
@Ulrich I added the updated patches.
Comment 17 Ulrich Müller gentoo-dev 2022-03-30 06:25:30 UTC
(In reply to orbea from comment #15)
> Signed-off-by: orbea <orbea@riseup.net>

https://www.gentoo.org/glep/glep-0076.html#certificate-of-origin says:
"The sign-off must contain the committer's legal name as a natural person, i.e., the name that would appear in a government issued document."
Comment 18 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2022-03-30 07:51:50 UTC
(In reply to Ulrich Müller from comment #17)
> (In reply to orbea from comment #15)
> > Signed-off-by: orbea <orbea@riseup.net>
> 
> https://www.gentoo.org/glep/glep-0076.html#certificate-of-origin says:
> "The sign-off must contain the committer's legal name as a natural person,
> i.e., the name that would appear in a government issued document."

Didn't we relax that requirement a while back? orbea does not want his real name being disclosed.
Comment 19 Ulrich Müller gentoo-dev 2022-03-30 09:19:30 UTC
(In reply to Lars Wendler (Polynomial-C) from comment #18)
> Didn't we relax that requirement a while back? orbea does not want his real
> name being disclosed.

The current guideline is here:
https://devmanual.gentoo.org/general-concepts/copyright-policy/index.html#examples-for-general-guideline

I cannot certify the contribution under point 4 unless it has a valid signoff. Arguably, it is of significant size, given the number of changed files/lines.

However, I just see that http://bugs.motifzone.net/ has a note saying: "Any patches submitted are done so under the M.I.T. License. Do not upload any patches if you do not agree."

We could count this as "an independent indication of its license" (i.e. MIT). So I could download the patch from the upstream bug tracker at http://bugs.motifzone.net/show_bug.cgi?id=1720 and certify it under point 2.
Comment 20 Larry the Git Cow gentoo-dev 2022-03-30 17:06:39 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/dev/ulm.git/commit/?id=e40f714b367a72ed709bfa08729281254f125b31

commit e40f714b367a72ed709bfa08729281254f125b31
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2022-03-30 16:50:30 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2022-03-30 16:50:30 +0000

    motif: Fix build with slibtool
    
    Bug: https://bugs.gentoo.org/778050
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 patchsets/motif/2.3.8/09_all_slibtool.patch | 276 ++++++++++++++++++++++++++++
 1 file changed, 276 insertions(+)
Comment 21 Larry the Git Cow gentoo-dev 2022-03-30 17:09:19 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bbd34e40e3916a1768613fccf7d5c56c216b9fee

commit bbd34e40e3916a1768613fccf7d5c56c216b9fee
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2022-03-30 17:00:25 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2022-03-30 17:02:37 +0000

    x11-libs/motif: Fix build with slibtool
    
    Closes: https://bugs.gentoo.org/778050
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 x11-libs/motif/Manifest              |   1 +
 x11-libs/motif/motif-2.3.8-r3.ebuild | 109 +++++++++++++++++++++++++++++++++++
 2 files changed, 110 insertions(+)