[Bug binutils/30281] error: multiple definition of `pwrite@GLIBC_2.2'; on i586-linux-gnu

Vladimir Mezentsev vladimir.mezentsev@oracle.com
Wed Mar 29 16:43:07 GMT 2023



On 3/29/23 05:24, mliska at suse dot cz wrote:
> https://sourceware.org/bugzilla/show_bug.cgi?id=30281
>
> Martin Liska <mliska at suse dot cz> changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                   CC|                            |hjl.tools at gmail dot com
>             Assignee|vladimir.mezentsev at oracle dot c |unassigned at sourceware dot org
>                     |om                          |
>               Status|ASSIGNED                    |NEW
>            Component|gprofng                     |binutils
>
> --- Comment #3 from Martin Liska <mliska at suse dot cz> ---
> Great, thank you Vladimir. I was able to isolate that and reduce it. It started
> with 20ea3acc727f3be6322dfbd881e506873535231d and it's regression since
> 20ea3acc727f3be6322dfbd881e506873535231d.
>
> $ cat iotrace.i
> extern __inline __attribute__((__gnu_inline__)) void open64(int, ...) {}
> int __attribute__((__symver__("open64@GLIBC_2.2"))) __collector_open64_2_2() {}
> void open64(int, ...) {}
>
> $ cat libgprofng.ver
> GLIBC_2.2 {
>    global:
>      open64;
> };
>
> $ gcc iotrace.i -shared -fPIC -O2 -Wl,--version-script,libgprofng.ver
> -flto-partition=max -flto=auto -B ~/Programming/binutils/objdir/ld -fuse-ld=bfd
> /usr/bin/ld.bfd: /tmp/ccLS2iVj.ltrans1.ltrans.o: in function `open64':
> <artificial>:(.text+0x0): multiple definition of `open64@GLIBC_2.2';
> /tmp/ccLS2iVj.ltrans0.ltrans.o:<artificial>:(.text+0x0): first defined here
> collect2: error: ld returned 1 exit status
>
> while -fuse-ld=mold or -fuse-ld=lld works fine. gold is also affected.
>
> @H.J. Can you please take a look?
>

  How do you configure a build to set  -fuse-ld=lld ?

On Ol9, a build is configured with the -flto option. How can I turn it 
off ?

Thank you,
-Vladimir




More information about the Binutils mailing list