Github messages for voidlinux
 help / color / mirror / Atom feed
From: q66 <q66@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [ISSUE] [CLOSED] binutils: ar does not load lto plugin automatically
Date: Sun, 15 Mar 2020 22:04:11 +0100	[thread overview]
Message-ID: <20200315210411.bpq_dLUGncg8qMLtfuCQt-dObmFj3ZvIQ1z84awEFmo@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-18725@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1247 bytes --]

Closed issue by pmer on void-packages repository

https://github.com/void-linux/void-packages/issues/18725

Description:
`ar` should pick up and find the lto plugin automatically—it should succeed without the user needing to invoke `gcc-ar`.

This works in Ubuntu 18.04, although I'm not sure exactly what they did to solve it yet.

### System
* xuname:  Void 5.4.17_1 x86_64-musl GenuineIntel/VM uptodate rFFF
* package:  binutils-2.33.1_1 gcc-9.2.0-3

### Expected behavior

No errors.

### Actual behavior

```
ar: a.o: plugin needed to handle lto object
/bin/ld: /usr/lib/gcc/x86_64-linux-musl/../../../../lib/Scrt1.o: in function `_start_c':
/builddir/musl-1.1.24/crt/crt1.c:18: undefined reference to `main'
collect2: error: ld returned 1 exit status
```

### Steps to reproduce the behavior

```
cat > a.c <<EOF
int main() {
    return 0;
}
EOF
cc a.c -c -o a.o -flto
ar qc a.a a.o
cc a.a
```

Note: if the the lto plugin is given to`ar`, i.e., with:

```
ar --plugin=/usr/lib/gcc/x86_64-linux-musl/9.2/liblto_plugin.so qc a.a a.o
```

or

```
gcc-ar qc a.a a.o  # This is a wrapper around ar provided by GCC that simply adds the --plugin line above for you.
```

then everything works fine.

      parent reply	other threads:[~2020-03-15 21:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-02  1:43 [ISSUE] /usr/bin/ar from binutils does not pick up lto plugin voidlinux-github
2020-02-13 19:35 ` binutils: ar does not load lto plugin automatically voidlinux-github
2020-03-15 19:17 ` q66
2020-03-15 21:04 ` q66 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200315210411.bpq_dLUGncg8qMLtfuCQt-dObmFj3ZvIQ1z84awEFmo@z \
    --to=q66@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).