Github messages for voidlinux
 help / color / Atom feed
* [ISSUE] /usr/bin/ar from binutils does not pick up lto plugin
@ 2020-02-02  1:43 voidlinux-github
  2020-02-13 19:35 ` binutils: ar does not load lto plugin automatically voidlinux-github
  0 siblings, 1 reply; 2+ messages in thread
From: voidlinux-github @ 2020-02-02  1:43 UTC (permalink / raw)
  To: ml

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

New issue by pmer on void-packages repository

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

Description:
### 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;
}
cc a.c -c -o a.o -flto
ar qc a.a a.o
```

Note: if the last line above is replaced 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.

This issue is about how `ar` should pick up and find the lto plugin automatically—it should succeed without the user needing to invoke gcc-ar.

For reference, Ubuntu has fixed this issue a few years ago.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: binutils: ar does not load lto plugin automatically
  2020-02-02  1:43 [ISSUE] /usr/bin/ar from binutils does not pick up lto plugin voidlinux-github
@ 2020-02-13 19:35 ` voidlinux-github
  0 siblings, 0 replies; 2+ messages in thread
From: voidlinux-github @ 2020-02-13 19:35 UTC (permalink / raw)
  To: ml

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

New comment by leahneukirchen on void-packages repository

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

Comment:
This can be fixed by

```
mkdir -p /usr/lib/bfd-pluginsx
ln -sfr /usr/libexec/gcc/x86_64-linux-musl/9.2.0/liblto_plugin.so /usr/lib/bfd-plugins
```

And likewise for LLVMgold.so.

These links should be added to gcc and clang packages.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

Github messages for voidlinux

Archives are clonable: git clone --mirror http://inbox.vuxu.org/voidlinux-github

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.github.voidlinux


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git