* [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
` (2 more replies)
0 siblings, 3 replies; 4+ 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] 4+ 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
2020-03-15 19:17 ` q66
2020-03-15 21:04 ` [ISSUE] [CLOSED] " q66
2 siblings, 0 replies; 4+ 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] 4+ 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 ` binutils: ar does not load lto plugin automatically voidlinux-github
@ 2020-03-15 19:17 ` q66
2020-03-15 21:04 ` [ISSUE] [CLOSED] " q66
2 siblings, 0 replies; 4+ messages in thread
From: q66 @ 2020-03-15 19:17 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 200 bytes --]
New comment by q66 on void-packages repository
https://github.com/void-linux/void-packages/issues/18725#issuecomment-599252288
Comment:
@xtraeme so, why did we update gcc without fixing this first?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [ISSUE] [CLOSED] 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 ` binutils: ar does not load lto plugin automatically voidlinux-github
2020-03-15 19:17 ` q66
@ 2020-03-15 21:04 ` q66
2 siblings, 0 replies; 4+ messages in thread
From: q66 @ 2020-03-15 21:04 UTC (permalink / raw)
To: ml
[-- 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.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-03-15 21:04 UTC | newest]
Thread overview: 4+ 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
2020-03-15 19:17 ` q66
2020-03-15 21:04 ` [ISSUE] [CLOSED] " q66
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).