-
Error message: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The cause of the error may have been found, here is an example I used to illustrate ➜ lto-test gcc -flto main.c -c -o main.o
➜ lto-test ar q main.a main.o
ar: creating main.a
➜ lto-test gcc b.c -c -o b.o
➜ lto-test gcc -flto main.a b.o -o main
➜ lto-test ./main
Foo2
➜ lto-test clang -flto a.a b.o -o main
clang-15: error: no such file or directory: 'a.a'
➜ lto-test clang -flto main.a b.o -o main
/usr/bin/ld: main.a(main.o): plugin needed to handle lto object
/usr/bin/ld: main.a(main.o): plugin needed to handle lto object
/usr/bin/ld: /lib/x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x1b): undefined reference to `main'
/usr/bin/ld: b.o: in function `foo1':
b.c:(.text+0x9): undefined reference to `foo2'
clang-15: error: linker command failed with exit code 1 (use -v to see invocation) |
Beta Was this translation helpful? Give feedback.
The cause of the error may have been found, here is an example I used to illustrate