[Bug 265008] 'undefined symbol: environ' when a shared library is built which shouldn't happen according to environ(7)
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 03 Jul 2022 07:33:24 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265008
--- Comment #1 from Yuri Victorovich <yuri@freebsd.org> ---
The -Wl,--no-undefined flag triggers it.
Testcase:
$ cat x.c
extern char **environ;
char** fn() {
return environ;
}
$ cc --shared -o x.so -fPIC -Wl,--no-undefined x.c
ld: error: undefined symbol: environ
>>> referenced by x.c
>>> /tmp/x-0e96b0.o:(fn)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
--
You are receiving this mail because:
You are the assignee for the bug.