https://sourceware.org/bugzilla/show_bug.cgi?id=24406
Bug ID: 24406
Summary: -Wl,--wrap= incompatible with -flto
Product: binutils
Version: 2.32
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: ld
Assignee: unassigned at sourceware dot org
Reporter: dilyan.palauzov at aegee dot org
Target Milestone: ---
This is t.c:
------------
#include <stdio.h>
#include <unistd.h>
ssize_t __wrap_read(int fd, void *buffer, size_t count) {
printf("%s\n", (char*)buffer);
return fd + count;
}
int main() {
int i = read(1, "abc", 5);
printf("%i\n", i);
}
------------
I have gcc 8.3.1 20190311, ld.bfd 2.32.51.20190319, ld.gold 1.16
2.32.51.20190319 and clang 8.0.0.
This works
clang -flto -fuse-ld=gold -Wl,--wrap=read t.c
gcc -fuse-ld=bfd -Wl,--wrap=read t.c
gcc -fuse-ld=gold -Wl,--wrap=read t.c
clang -fuse-ld=bfd -Wl,--wrap=read t.c
clang -fuse-ld=gold -Wl,--wrap=read t.c
This fails
clang -flto -fuse-ld=bfd -Wl,--wrap=read t.c
gcc -flto -fuse-ld=gold -Wl,--wrap=read t.c
gcc -flto -fuse-ld=bfd -Wl,--wrap=read t.c
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-binutils