Bug 91186 - gcc-9.1.0 fails to find a .symver symbol
Summary: gcc-9.1.0 fails to find a .symver symbol
Status: RESOLVED DUPLICATE of bug 48200
Alias: None
Product: gcc
Classification: Unclassified
Component: lto (show other bugs)
Version: 9.1.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-16 22:08 UTC by Sergei Trofimovich
Modified: 2019-07-17 07:27 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
gcc-lto-partition-bug.tar.gz (92.93 KB, application/gzip)
2019-07-16 22:09 UTC, Sergei Trofimovich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergei Trofimovich 2019-07-16 22:08:44 UTC
The bug is originally discovered as a fuse-2.9.9 build failure on CFLAGS="-O2 -flto" LDFLAGS="-O2 -flto -Wl,--no-undefined": https://bugs.gentoo.org/663518

I failed to extract minimal example off fuse. Attaching self-contained source tarball with a simple build script.

Script tries to build with lto in 3 modes:

  $ ./bug2.bash 
  Building -O1
  Building -flto -O1 --param lto-partitions=1
  Building -flto -O1 --param lto-partitions=2
  /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/libbug.so.IbcCw4.ltrans0.ltrans.o: in function `mt_chan_receive':
  <artificial>:(.text+0x9f0d): undefined reference to `__fuse_read_cmd@'
  collect2: error: ld returned 1 exit status

Note: only --param lto-partitions=2 triggers build failure.

It's an x86_64-pc-linux-gnu gcc-9.1.1 / binutils-2.32.
Comment 1 Sergei Trofimovich 2019-07-16 22:09:29 UTC
Created attachment 46605 [details]
gcc-lto-partition-bug.tar.gz
Comment 2 Andrew Pinski 2019-07-16 22:49:33 UTC
There are known issues with top-level inline-asm and LTO and you are running into one of those.


FUSE_SYMVER(".symver fuse_setup_compat2,__fuse_setup@");
FUSE_SYMVER(".symver fuse_setup_compat22,fuse_setup@FUSE_2.2");
FUSE_SYMVER(".symver fuse_teardown,__fuse_teardown@");
FUSE_SYMVER(".symver fuse_main_compat2,fuse_main@");
FUSE_SYMVER(".symver fuse_main_real_compat22,fuse_main_real@FUSE_2.2");
Comment 3 Martin Liška 2019-07-17 07:27:27 UTC
It's a known limitation.

*** This bug has been marked as a duplicate of bug 48200 ***