This may be a problem for the build system I am porting to, but I will include the differences in the two systems and how I came across the problem.
My old build system is a SLES 10 machine. Gcc / cpp / g ++ version is 4.1.0
My new system is on SLES 11 SP4, and the gcc / cpp / g ++ version is 4.3.4.
I am creating a shared library; creation and coordination of work in the new system. However, under load time in the new system, I get the following:
error ./mysharedlib.so: undefined symbol: stat
Since the stat () function is included in /usr/include/sys/stat.h, I looked at glibc on both systems. Old:
# rpm -q -f /usr/include/sys/stat.h
glibc-devel-2.4-31.2
and new:
# rpm -q -f /usr/include/sys/stat.h
glibc-devel-2.11.3-17.95.2
I also looked at objdump output related to stat () on the old system:
0000000000000000 D *UND* 0000000000000000 __xstat
00000000000e3f8a l F .text 0000000000000024 stat
0000000000000000 *UND* 0000000000000000 __xstat
And the new system:
0000000000000000 D *UND* 0000000000000000 stat
0000000000000000 D *UND* 0000000000000000 lstat
0000000000000000 *UND* 0000000000000000 stat
0000000000000000 *UND* 0000000000000000 lstat
, stat() .text . Stat - undefined mysharedlib .
feature_test_macros , , .h stat.h makefile, _XOPEN_SOURCE:
cc -D_XOPEN_SOURCE=500
.
"-lc" ld- libc. , , , stat() ( ), .
StackOverflow:
-O-gcc "stat" ?
, -O make g++ , stat(). , , . , , ; , . ? , ?