Bug 10646 - Build fails with busybox provided `ar`
Summary: Build fails with busybox provided `ar`
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Standard Compliance (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-11 16:30 UTC by jmcclure
Modified: 2018-01-11 16:30 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jmcclure 2018-01-11 16:30:53 UTC
Current snapshots fail to build when /bin/sh is busybox's ash and presumably would also fail on any system where `ar` is the busybox provided `ar` with the following error from `make CC=musl-gcc`

>   LD      archival/built-in.o
> ar: unrecognized option: s
> BusyBox v1.28.0.git (2017-12-19 11:32:01 EST) multi-call binary.
> 
> Usage: ar [-o] [-v] [-p] [-t] [-x] ARCHIVE FILES
> 
> Extract or list FILES from an ar archive
> 
>         -o      Preserve original dates
>         -p      Extract to stdout
>         -t      List
>         -x      Extract
>         -v      Verbose
> make[1]: *** [scripts/Makefile.build:264: archival/built-in.o] Error 1
> make: *** [Makefile:743: archival] Error 2

Line 295 of the top-level Makefile sets the build variable AR as follows:

> LD   = $(CROSS_COMPILE)ar

Changing this to the following was a functional workaround for me as /bin/ar is still provided by gnu-coreutils on my system:

> LD   = $(CROSS_COMPILE)/bin/ar

I've confirmed also that setting `CONFIG_CROSS_COMPILER_PREFIX="/bin/"` in .config works - though this seems like worse of a workaround.

However, if /bin/ar was a link to busybox, the build would fail regardless.

Potential solutions would be to remove the offending parameter from the build process if it is not necessary, or to implement that parameter in busybox's `ar`.