Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 723028 - dev-libs/libmowgli calls ar directly
Summary: dev-libs/libmowgli calls ar directly
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Wade Cline
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: tc-directly
  Show dependency tree
 
Reported: 2020-05-14 15:35 UTC by Agostino Sarubbo
Modified: 2020-09-20 19:14 UTC (History)
2 users (show)

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


Attachments
build.log (build.log,15.03 KB, text/plain)
2020-05-14 15:35 UTC, Agostino Sarubbo
Details
ar fix (patch,8.73 KB, patch)
2020-05-31 22:16 UTC, Wade Cline
Details | Diff
ar_fix_v2 (broken) (patch,2.62 KB, patch)
2020-09-06 23:48 UTC, Wade Cline
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2020-05-14 15:35:09 UTC
This is an auto-filled bug because dev-libs/libmowgli calls ar directly.
The issue was originally discovered on amd64, but it may be reproducible on other arches as well.
If you think that a different summary clarifies the issue better, feel free to change it.
Attached build log and emerge --info.

NOTE:
If you think it doesn't make sense fix these type of issues, I'd like to point out that won't be possible use a different AR implementation (like llvm-ar) by setting the AR variable. So this issue has been reproduced by setting the AR variable to x86_64-pc-linux-gnu-ar and by removing the /usr/bin/ar binary.
Comment 1 Agostino Sarubbo gentoo-dev 2020-05-14 15:35:19 UTC
Created attachment 638994 [details]
build.log

build log and emerge --info
Comment 2 Wade Cline 2020-05-31 22:16:38 UTC
Created attachment 642954 [details, diff]
ar fix
Comment 3 Wade Cline 2020-05-31 22:18:05 UTC
Please try out the attached patch and let me know if it fixes the issue.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-08-31 04:27:58 UTC
(In reply to Wade Cline from comment #3)
> Please try out the attached patch and let me know if it fixes the issue.

It's better to just include the .ac patch and eautoreconf in the ebuild so that we're not carrying large patches in the tree.

Anyway, this got upstreamed here (by Wade): https://github.com/atheme/libmowgli-2/commit/e930ad346fbd929165f2eb15fb28678f46902297

Wade: if it works after moving /usr/bin/ar to /usr/bin/ar.bak or similar, just make a PR for it. :)
Comment 5 Wade Cline 2020-09-06 23:47:04 UTC
>It's better to just include the .ac patch and eautoreconf in the ebuild so that we're not carrying large patches in the tree.
I gave that a quick try but it didn't work:

configure.ac:36: error: possibly undefined macro: AC_DEFINE
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.

I could dig into this more if it's required for merging.  I'll attach the v2 attempt thus far.

>Wade: if it works after moving /usr/bin/ar to /usr/bin/ar.bak or similar, just make a PR for it. :)
Will do!
Comment 6 Wade Cline 2020-09-06 23:48:50 UTC
Created attachment 658840 [details, diff]
ar_fix_v2 (broken)

Patch version that attempts to use re-generate the configuration file (WARNING: incomplete; does not appear to work properly).
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-09-14 02:19:55 UTC
(In reply to Wade Cline from comment #6)
> Created attachment 658840 [details, diff] [details, diff]
> ar_fix_v2 (broken)
> 
> Patch version that attempts to use re-generate the configuration file
> (WARNING: incomplete; does not appear to work properly).

This is good, and nearly there. Notice that when we do configure, we get:
checking for PS_STRINGS... no
checking for x86_64-pc-linux-gnu-ar... x86_64-pc-linux-gnu-ar
checking for x86_64-pc-linux-gnu-ranlib... x86_64-pc-linux-gnu-ranlib
./configure: 4041: BUILDSYS_SHARED_LIB: not found <--- key stuff here
./configure: 4042: BUILDSYS_PROG_IMPLIB: not found
[...]
configure: error: Invalid --with-openssl value

The openssl thing is a red herring. We need to tell eautoreconf about upstream's M4 macros, which are in the 'm4' directory here (grep for BUILDSYS_SHARED_LIB showed this, but also obvious first place to check).

So, AT_M4DIR="m4" eautoreconf worked for me.

I then wanted to deal with some warnings:
>make[1]: warning: -jN forced in submake: disabling jobserver mode.

This is because buildsys.mk.in invokes ${MAKE} with ${MFLAGS} which is redundant for modern GNU Make (make will recognise it is calling make and pass in parameters by itself).
Comment 8 Larry the Git Cow gentoo-dev 2020-09-14 02:21:21 UTC
The bug has been referenced in the following commit(s):

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

commit 9a238bd0556fd612644eab4e0f329f60ab6f970b
Author:     Wade Cline <wadecline@hotmail.com>
AuthorDate: 2020-05-31 21:58:30 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2020-09-14 01:55:49 +0000

    dev-libs/libmowgli: Fix 'ar' bug
    
    Bug: https://bugs.gentoo.org/723028
    Signed-off-by: Wade Cline <wadecline@hotmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/17449
    Signed-off-by: Sam James <sam@gentoo.org>

 ...li-2.1.3-use-host-tools-for-ar-and-ranlib.patch | 231 +++++++++++++++++++++
 ...i-2.1.3-r1.ebuild => libmowgli-2.1.3-r2.ebuild} |   6 +-
 2 files changed, 236 insertions(+), 1 deletion(-)
Comment 9 Wade Cline 2020-09-20 19:14:50 UTC
Thanks for the amendments.  I'll keep those techniques in mind next time.