Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 892686 - dev-libs/nss-3.87:build fail without binutils as [llvm/musl]
Summary: dev-libs/nss-3.87:build fail without binutils as [llvm/musl]
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-31 04:14 UTC by 464270342
Modified: 2023-02-10 08:57 UTC (History)
1 user (show)

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


Attachments
emerge-info (emerge-info,6.42 KB, text/plain)
2023-01-31 05:09 UTC, 464270342
Details
nss build log (nss-build.log,468.40 KB, text/x-log)
2023-01-31 05:10 UTC, 464270342
Details
Confirming repro of this as well: Executable "as" doesn't exist (build.log,589.86 KB, text/x-log)
2023-02-04 01:19 UTC, Josh Klar (klardotsh)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description 464270342 2023-01-31 04:14:54 UTC
in profile [llvm/musl] without binutils, the build progress will stop because "as" is not found.
use "ln -s llvm-as as" won't help.



Reproducible: Always

Steps to Reproduce:
1.use default/linux/amd64/17.0/musl/clang as profile
2.emerge nss
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-01-31 04:18:27 UTC
Please aattch the full build.log and emerge --info.
Comment 2 464270342 2023-01-31 05:09:58 UTC
Created attachment 849540 [details]
emerge-info
Comment 3 464270342 2023-01-31 05:10:15 UTC
Created attachment 849541 [details]
nss build log
Comment 4 464270342 2023-01-31 05:10:54 UTC
(In reply to Sam James from comment #1)
> Please aattch the full build.log and emerge --info.

sorry, already attached it now
Comment 5 Josh Klar (klardotsh) 2023-02-04 01:19:50 UTC
Created attachment 849816 [details]
Confirming repro of this as well: Executable "as" doesn't exist
Comment 6 Josh Klar (klardotsh) 2023-02-04 01:23:57 UTC
Well, sorry: binutils seems to have gotten picked up as a dependency (and now as is installled as expected), either of NSS or of something else, but the ordering was wrong: nss didn't know it had a build dep on binutils. Oneshotting nss after confirming all of this suddenly worked.
Comment 7 464270342 2023-02-04 02:10:57 UTC
(In reply to Josh Klar (klardotsh) from comment #6)
> Well, sorry: binutils seems to have gotten picked up as a dependency (and
> now as is installled as expected), either of NSS or of something else, but
> the ordering was wrong: nss didn't know it had a build dep on binutils.
> Oneshotting nss after confirming all of this suddenly worked.

Well, indeed install binutils will fix the build issue, but I wonder if we can use llvm toolchain insteal of stuck in GNU's. 

I'm not expert on this, but llvm provides llvm-as, and clang's profile wrote something like "AS='clang -c'" 

Any chance to use something else than 'as'?

I'm trying to build a system without gcc,glibc and binutils, and if I want to install kde, I have to install nss.
Comment 8 Joonas Niilola gentoo-dev 2023-02-07 13:31:39 UTC
Could you try with this patch: 
https://dev.gentoo.org/~juippis/patches/nss-3.87-use-clang-as.patch

as root:
 mkdir -p /etc/portage/patches/dev-libs/nss-3.87/
 cd /etc/portage/patches/dev-libs/nss-3.87/
 wget https://dev.gentoo.org/~juippis/patches/nss-3.87-use-clang-as.patch

try emerging.

The condition looks out-of-date there, although I'm not expert if it still holds true or not.
Comment 9 464270342 2023-02-07 14:25:23 UTC
Thanks, but someting wrong with the patch, and I don't know how to fix  it. can you take a look?


=======================

Hunk #1 succeeded at 10 with fuzz 2.                                                                                                                                                 [ ok ]
 * Applying nss-3.21-gentoo-fixup-warnings.patch ...                                                                                                                                 [ ok ]
 * Applying nss-3.23-hppa-byte_order.patch ...                                                                                                                                       [ ok ]
 * =========================================================================================================================================================================================
 * Applying user patches from /etc/portage/patches ...
 * Applying nss-3.87-use-clang-as.patch ...
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -Naur a/nss/lib/freebl/Makefile b/nss/lib/freebl/Makefile
|--- a/nss/lib/freebl/Makefile  2023-02-07 15:28:14.424665648 +0200
|+++ b/nss/lib/freebl/Makefile  2023-02-07 15:28:43.083155026 +0200
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored                                                                                                                                                              [ !! ]
 * ERROR: dev-libs/nss-3.87::gentoo failed (prepare phase):
 *   patch -p1  failed with /etc/portage/patches/dev-libs/nss-3.87/nss-3.87-use-clang-as.patch
 * 
 * Call stack:
 *               ebuild.sh, line  136:  Called src_prepare
 *             environment, line 2321:  Called default
 *      phase-functions.sh, line  872:  Called default_src_prepare
 *      phase-functions.sh, line  948:  Called __eapi8_src_prepare
 *             environment, line  334:  Called eapply_user
 *             environment, line  898:  Called eapply '/etc/portage/patches/dev-libs/nss-3.87/nss-3.87-use-clang-as.patch'
 *             environment, line  858:  Called _eapply_patch '/etc/portage/patches/dev-libs/nss-3.87/nss-3.87-use-clang-as.patch'
 *             environment, line  796:  Called __helpers_die 'patch -p1  failed with /etc/portage/patches/dev-libs/nss-3.87/nss-3.87-use-clang-as.patch'
 *   isolated-functions.sh, line  112:  Called die
 * The specific snippet of code:
 *              die "$@"
 * 
 * If you need support, post the output of `emerge --info '=dev-libs/nss-3.87::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-libs/nss-3.87::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-libs/nss-3.87/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-libs/nss-3.87/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-libs/nss-3.87/work/nss-3.87/nss'
 * S: '/var/tmp/portage/dev-libs/nss-3.87/work/nss-3.87/nss
Comment 10 464270342 2023-02-07 14:31:14 UTC
(In reply to Joonas Niilola from comment #8)
> Could you try with this patch: 
> https://dev.gentoo.org/~juippis/patches/nss-3.87-use-clang-as.patch
> 
> as root:
>  mkdir -p /etc/portage/patches/dev-libs/nss-3.87/
>  cd /etc/portage/patches/dev-libs/nss-3.87/
>  wget https://dev.gentoo.org/~juippis/patches/nss-3.87-use-clang-as.patch
> 
> try emerging.
> 
> The condition looks out-of-date there, although I'm not expert if it still
> holds true or not.

after changing "a/nss/" to"a/"  and also the same to "b/nss/", the patch works
Comment 11 Larry the Git Cow gentoo-dev 2023-02-10 08:57:34 UTC
The bug has been closed via the following commit(s):

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

commit b1252dba7fd5da0686396d7138f601740116b8b0
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2023-02-10 08:55:06 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2023-02-10 08:57:19 +0000

    dev-libs/nss: add 3.88.1
    
    Closes: https://bugs.gentoo.org/892686
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 dev-libs/nss/Manifest                              |   1 +
 .../files/nss-3.87-use-clang-as-bgo892686.patch    |  85 +++++
 dev-libs/nss/nss-3.88.1.ebuild                     | 394 +++++++++++++++++++++
 3 files changed, 480 insertions(+)