Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failures with LTO #1927

Open
namhyung opened this issue May 22, 2024 · 2 comments
Open

Build failures with LTO #1927

namhyung opened this issue May 22, 2024 · 2 comments

Comments

@namhyung
Copy link
Owner

Currently I see a build failure for LTO build. Maybe there's a problem with the arch object which is linked with the plain ld.

$ ./configure --cflags=-flto

$ make
...
  LINK     arch/x86_64/uftrace.o
  LINK     uftrace
lto-wrapper: warning: using serial compilation of 6 LTRANS jobs
lto-wrapper: note: see the ‘-flto’ option documentation for more information
...
  LINK     arch/x86_64/mcount-entry.op
  LINK     libmcount/libmcount.so
lto-wrapper: warning: using serial compilation of 3 LTRANS jobs
lto-wrapper: note: see the ‘-flto’ option documentation for more information
/usr/bin/ld: /tmp/ccJCPo6b.ltrans0.ltrans.o: in function `mcount_rstack_restore':
uftrace/libmcount/misc.c:128:(.text+0x18a): undefined reference to `plthook_return'
/usr/bin/ld: /tmp/ccJCPo6b.ltrans0.ltrans.o: in function `mcount_rstack_reset':
uftrace/libmcount/misc.c:207:(.text+0x7aa): undefined reference to `plthook_return'
/usr/bin/ld: /tmp/ccJCPo6b.ltrans0.ltrans.o: in function `mcount_startup':
uftrace/libmcount/mcount.c:2054:(.text+0xcb6f): undefined reference to `mcount_return'
/usr/bin/ld: /tmp/ccJCPo6b.ltrans2.ltrans.o: in function `mcount_setup_trampoline':
uftrace/arch/x86_64/mcount-dynamic.c:30:(.text+0x180c): undefined reference to `__xray_entry'
/usr/bin/ld: uftrace/arch/x86_64/mcount-dynamic.c:31:(.text+0x1817): undefined reference to `__xray_exit'
/usr/bin/ld: uftrace/arch/x86_64/mcount-dynamic.c:83:(.text+0x194f): undefined reference to `__dentry__'
collect2: error: ld returned 1 exit status

On a parallel build, I also saw a different error:

$ make -j 8
...
  LINK     libmcount/libmcount.so
uftrace/libmcount/plthook.c:90:1: error: function ‘uftrace___cyg_profile_func_exit’ redeclared as variable
   90 | ALIAS_DECL(__cyg_profile_func_exit);
      | ^
uftrace/libmcount/mcount.c:2181:1: note: previously declared here
 2181 | UFTRACE_ALIAS(__cyg_profile_func_exit);
      | ^
uftrace/libmcount/plthook.c:89:1: error: function ‘uftrace___cyg_profile_func_enter’ redeclared as variable
   89 | ALIAS_DECL(__cyg_profile_func_enter);
uftrace/libmcount/mcount.c:2175:1: note: previously declared here
 2175 | UFTRACE_ALIAS(__cyg_profile_func_enter);
      | ^
lto1: fatal error: errors during merging of translation units
compilation terminated.
lto-wrapper: fatal error: gcc returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
@FantasqueX
Copy link

Related issue #1343

@namhyung
Copy link
Owner Author

Thanks for the link!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants