Realtime test failure
Hi,
"realtime" build failed in my system with git "ltp-f388d33.tar.gz":
------------<RHEL4.8 - x86>
make[2]: Entering directory `/home/LTP/ltp-dev-20101112/testcases/realtime' make -C lib -f "/home/LTP/ltp-dev-20101112/testcases/realtime/lib/Makefile" all
make[3]: Entering directory `/home/LTP/ltp-dev-20101112/testcases/realtime/lib'
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE -I/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include -I../../../include -I../../../include -c -o librttest.o librttest.c In file included from librttest.c:43:/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librttest.h: In function `atomic_add':/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librttest.h:119 : warning: implicit declaration of function `__sync_add_and_fetch' gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE -I/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include -I../../../include -I../../../include -c -o libstats.o libstats.c In file included from libstats.c:47:/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librttest.h: In function `atomic_add':/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librttest.h:119 : warning: implicit declaration of function `__sync_add_and_fetch'
if [ -z "librttest.o libstats.o" ] ; then \ echo "Cowardly refusing to create empty archive"; \ exit 1; \
fi
ar -rc "librealtime.a" librttest.o libstats.o
ranlib "librealtime.a"
make[3]: Leaving directory `/home/LTP/ltp-dev-20101112/testcases/realtime/lib'
make[3]: Entering directory `/home/LTP/ltp-dev-20101112/testcases/realtime/func'
make[4]: Entering directory `/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler' gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE -I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../include -I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realtime/lib -L../../../../libasync_handler.c -lrealtime -lpthread -lrt -lm -o async_handler
In file included from async_handler.c:42:/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h: In function `atomic_add':/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:119:
warning: implicit declaration of function __sync_add_and_fetch' /home/LTP/ltp-dev-20101112/testcases/realtime/lib/librealtime.a(librttest.o) (.text+0x1a7): In function create_thread':/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librttest.h:119 : undefined reference to `__sync_add_and_fetch'
collect2: ld returned 1 exit status
make[4]: *** [async_handler] Error 1
make[4]: Leaving directory `/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler' make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/LTP/ltp-dev-20101112/testcases/realtime/func'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/LTP/ltp-dev-20101112/testcases/realtime' make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/LTP/ltp-dev-20101112/testcases'
make: *** [testcases-all] Error 2
------------
"realtime" build failed in:
------------
RHEL4.8 -- x86, x86_64, ia64
RHEL5.4 -- x86
------------
"realtime" build succeeded in:
------------
RHEL5.4 -- x86_64, ia64
------------
It is caused by "__sync_add_and_fetch".
In following URL, "__sync_add_and_fetch" is "built-in functions for atomic memory access". And It is provided in "gcc":
http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Atomic-Builtins.html
There is "__sync_add_and_fetch" in gcc4.1.2 (It is the gcc of RHEL5.1 - RHEL5.4).
And there is not "__sync_add_and_fetch" in gcc3.4.6 (It is the gcc of RHEL4.8)
In addition, "__sync_add_and_fetch" is for 64 bit environment.
http://stackoverflow.com/questions/130740/link-error-when-compiling-gcc-atom
ic-operation-in-32-bit-mode
http://gcc.gnu.org/wiki/Atomic
Perhaps, the judgment that "realtime" must be built or not depends on gcc's version (> 4.0) and 64 bits environment, I think.
Regards--
-Tomonori Mitani
------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture Simplifying enterprise desktop deployment and management using Dell EqualLogic storage and VMware View: A highly scalable, end-to-end client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 123 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Monday, November 15, 2010 12:03 PM
To: Mitani
Subject: Re: [LTP] Realtime test failureQuoted 5 lines · Mitani
Hi,
"realtime" build failed in my system with git "ltp-f388d33.tar.gz":
------------<RHEL4.8 - x86>
make[2]: Entering directory`/home/LTP/ltp-dev-20101112/testcases/realtime'
Quoted 1 line
make -C lib -f
"
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/Makefile"Quoted 8 lines
all
make[3]: Entering directory `/home/LTP/ltp-dev-20101112/testcases/realtime/lib' gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE(quoted diff) +0
-2-I/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include -I../../../include -I../../../include -c -o librttest.o librttest.cIn file included from librttest.c:43:
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librttest.h: InQuoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librttest.h:119Quoted 6 lines
: warning: implicit declaration of function `__sync_add_and_fetch' gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE
(quoted diff) +0
-2-I/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include -I../../../include -I../../../include -c -o libstats.o libstats.cIn file included from libstats.c:47:
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librttest.h: InQuoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librttest.h:119Quoted 14 lines
: warning: implicit declaration of function `__sync_add_and_fetch'
if [ -z "librttest.o libstats.o" ] ; then \ echo "Cowardly refusing to create empty archive"; \ exit 1; \fi
ar -rc "librealtime.a" librttest.o libstats.o
ranlib "librealtime.a"
make[3]: Leaving directory/home/LTP/ltp-dev-20101112/testcases/realtime/lib' make[3]: Entering directory/home/LTP/ltp-dev-20101112/testcases/realtime/func' make[4]: Entering directory `/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler' gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCEReview
Quoted 3 lines
(quoted diff) +0
-3-I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../include -I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realtime/lib-L../../../../lib
Quoted 3 lines
async_handler.c-lrealtime -lpthread -lrt -lm -oasync_handler
In file included from async_handler.c:42:/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:In
Quoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:119:Quoted 2 lines
warning: implicit declaration of function `__sync_add_and_fetch'
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/librealtime.a(libr ttest.o)
Quoted 2 lines
(.text+0x1a7): In function `create_thread':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librttest.h:119Quoted 10 lines
: undefined reference to `__sync_add_and_fetch'
collect2: ld returned 1 exit status
make[4]: *** [async_handler] Error 1
make[4]: Leaving directory `/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler' make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/LTP/ltp-dev-20101112/testcases/realtime/func' make[2]: *** [all] Error 2
make[2]: Leaving directory`/home/LTP/ltp-dev-20101112/testcases/realtime'
Quoted 16 lines
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/LTP/ltp-dev-20101112/testcases'
make: *** [testcases-all] Error 2
------------"realtime" build failed in:
------------
RHEL4.8 -- x86,x86_64, ia64
RHEL5.4 -- x86
------------"realtime" build succeeded in:
------------
RHEL5.4 --x86_64, ia64
------------Quoted 7 lines
It is caused by "
__sync_add_and_fetch".In following URL, "
__sync_add_and_fetch" is "built-in functions for atomic memory access". And It is provided in "gcc":
http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Atomic-Builtins.htmlThere is "
__sync_add_and_fetch" in gcc4.1.2 (It is the gcc of RHEL5.1-
Quoted 7 lines
RHEL5.4).
And there is not "__sync_add_and_fetch" in gcc3.4.6 (It is the gcc of RHEL4.8)In addition, "
__sync_add_and_fetch" is for 64 bit environment.http://stackoverflow.com/questions/130740/link-error-when-compiling-
gcc-atomQuoted 4 lines
ic-operation-in-32-bit-mode
Quoted 7 lines
Quoted 2 lines
Perhaps, the judgment that "realtime" must be built or not depends on gcc's version (> 4.0) and 64 bits environment, I think.
Could you please attach your testcases/realtime/config.log and
testcases/realtime/include/realtime_config.h? Thanks,
-Garrett
I understood.
Thank you and sorry for my insufficient information.
I attach following files:
- config.log (RHEL4.8-x86)
- realtime_config.h (RHEL4.8-x86)
- config.log (RHEL5.5-x86)
- realtime_config.h (RHEL5.5-x86)
Thank you--
-Tomonori Mitani
------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture Simplifying enterprise desktop deployment and management using Dell EqualLogic storage and VMware View: A highly scalable, end-to-end client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
2010/11/14 Mitani <[email protected]>:
Quoted 132 lines
Quoted 123 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Monday, November 15, 2010 12:03 PM
To: Mitani
Subject: Re: [LTP] Realtime test failureQuoted 5 lines · Mitani
Hi,
"realtime" build failed in my system with git "ltp-f388d33.tar.gz":
------------<RHEL4.8 - x86>
make[2]: Entering directory`/home/LTP/ltp-dev-20101112/testcases/realtime'
Quoted 1 line
make -C lib -f
"
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/Makefile"Quoted 8 lines
all
make[3]: Entering directory `/home/LTP/ltp-dev-20101112/testcases/realtime/lib' gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE(quoted diff) +0
-2-I/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include -I../../../include -I../../../include -c -o librttest.o librttest.cIn file included from librttest.c:43:
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librttest.h: InQuoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librttest.h:119Quoted 6 lines
: warning: implicit declaration of function `__sync_add_and_fetch' gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE
(quoted diff) +0
-2-I/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include -I../../../include -I../../../include -c -o libstats.o libstats.cIn file included from libstats.c:47:
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librttest.h: InQuoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librttest.h:119Quoted 14 lines
: warning: implicit declaration of function `__sync_add_and_fetch' if [ -z "librttest.o libstats.o" ] ; then \
echo "Cowardly refusing to create empty archive"; \
exit 1; \
fi
ar -rc "librealtime.a" librttest.o libstats.o
ranlib "librealtime.a"
make[3]: Leaving directory/home/LTP/ltp-dev-20101112/testcases/realtime/lib' make[3]: Entering directory/home/LTP/ltp-dev-20101112/testcases/realtime/func' make[4]: Entering directory `/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler' gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCEReview
Quoted 3 lines
(quoted diff) +0
-3-I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../include -I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realtime/lib-L../../../../lib
Quoted 3 lines
async_handler.c-lrealtime -lpthread -lrt -lm -oasync_handlerIn file included from async_handler.c:42:/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:In
Quoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:119:Quoted 2 lines
warning: implicit declaration of function `__sync_add_and_fetch'
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/librealtime.a(libr ttest.o)
Quoted 2 lines
(.text+0x1a7): In function `create_thread':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librttest.h:119Quoted 10 lines
: undefined reference to `__sync_add_and_fetch'
collect2: ld returned 1 exit status
make[4]: *** [async_handler] Error 1
make[4]: Leaving directory `/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler' make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/LTP/ltp-dev-20101112/testcases/realtime/func' make[2]: *** [all] Error 2
make[2]: Leaving directory`/home/LTP/ltp-dev-20101112/testcases/realtime'
Quoted 16 lines
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/LTP/ltp-dev-20101112/testcases'
make: *** [testcases-all] Error 2
------------"realtime" build failed in:
------------
RHEL4.8 -- x86,x86_64, ia64
RHEL5.4 -- x86
------------"realtime" build succeeded in:
------------
RHEL5.4 --x86_64, ia64
------------Quoted 7 lines
It is caused by "
__sync_add_and_fetch".In following URL, "
__sync_add_and_fetch" is "built-in functions for atomic memory access". And It is provided in "gcc":
http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Atomic-Builtins.htmlThere is "
__sync_add_and_fetch" in gcc4.1.2 (It is the gcc of RHEL5.1-
Quoted 7 lines
RHEL5.4).
And there is not "__sync_add_and_fetch" in gcc3.4.6 (It is the gcc of RHEL4.8)In addition, "
__sync_add_and_fetch" is for 64 bit environment.http://stackoverflow.com/questions/130740/link-error-when-compiling-
gcc-atomQuoted 4 lines
ic-operation-in-32-bit-mode
Quoted 7 lines
Quoted 2 lines
Perhaps, the judgment that "realtime" must be built or not depends on gcc's version (> 4.0) and 64 bits environment, I think.
Could you please attach your testcases/realtime/config.log and
testcases/realtime/include/realtime_config.h? Thanks,
-Garrett
Quoted 8 lines
I understood.
Thank you and sorry for my insufficient information.I attach following files:
- config.log (RHEL4.8-x86)
-realtime_config.h(RHEL4.8-x86)
- config.log (RHEL5.5-x86)
-realtime_config.h(RHEL5.5-x86)
Could you please try compiling the following C sources in both scenarios?
Thanks,
-Garrett
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <stdlib.h>
int main(void) {
char *c;
return __sync_add_and_fetch(c, 1);
}------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture Simplifying enterprise desktop deployment and management using Dell EqualLogic storage and VMware View: A highly scalable, end-to-end client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 171 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Monday, November 15, 2010 2:20 PM
To: Mitani
Cc: [email protected]; 當座 健市
Subject: Re: [LTP] Realtime test failure2010/11/14 Mitani <[email protected]>:
Quoted 13 lines
Quoted 13 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Monday, November 15, 2010 12:03 PM
To: Mitani
Subject: Re: [LTP] Realtime test failureQuoted 5 lines · Mitani
Hi,
"realtime" build failed in my system with git "ltp-f388d33.tar.gz":
------------<RHEL4.8 - x86>
make[2]: Entering directory`/home/LTP/ltp-dev-20101112/testcases/realtime'
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
make -C lib -f
"
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/Makefile"Review
Quoted 6 lines
all
make[3]: Entering directory `/home/LTP/ltp-dev-20101112/testcases/realtime/lib' gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE(quoted diff) +0
-2-I/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include -I../../../include -I../../../include -c -o librttest.o
librttest.cQuoted 3 lines
Quoted 3 lines
Quoted 2 lines
In file included from librttest.c:43:
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 4 lines
Quoted 4 lines
st.h: InQuoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 8 lines
Quoted 8 lines
st.h:119
Quoted 6 lines
: warning: implicit declaration of function `__sync_add_and_fetch' gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE
(quoted diff) +0
-2-I/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include -I../../../include -I../../../include -c -o libstats.o libstats.cIn file included from libstats.c:47:
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 4 lines
Quoted 4 lines
st.h: InQuoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 14 lines
Quoted 14 lines
st.h:119
Quoted 13 lines
: warning: implicit declaration of function `__sync_add_and_fetch'
if [ -z "librttest.o libstats.o" ] ; then \ echo "Cowardly refusing to create empty archive"; \ exit 1; \fi
ar -rc "librealtime.a" librttest.o libstats.o ranlib "librealtime.a"
make[3]: Leaving directory/home/LTP/ltp-dev-20101112/testcases/realtime/lib' make[3]: Entering directory/home/LTP/ltp-dev-20101112/testcases/realtime/func' make[4]: Entering directory`/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler'
Quoted 8 lines
Quoted 8 lines
Review
Quoted 4 lines
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE
(quoted diff) +0
-3-I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../include -I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realtime/lib-L../../../../lib
Quoted 3 lines
async_handler.c-lrealtime -lpthread -lrt -lm -oasync_handler
In file included from async_handler.c:42:
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:Quoted 4 lines
Quoted 4 lines
In
Quoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:11Quoted 4 lines
Quoted 4 lines
9:
Quoted 2 lines
warning: implicit declaration of function `__sync_add_and_fetch'
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/librealtime.a(libr
Quoted 4 lines
Quoted 4 lines
ttest.o)
Quoted 2 lines
(.text+0x1a7): In function `create_thread':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 6 lines
Quoted 6 lines
st.h:119
Quoted 5 lines
: undefined reference to `__sync_add_and_fetch'
collect2: ld returned 1 exit status
make[4]: *** [async_handler] Error 1
make[4]: Leaving directory`/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler'
Quoted 22 lines
Quoted 22 lines
Quoted 5 lines
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/LTP/ltp-dev-20101112/testcases/realtime/func' make[2]: *** [all] Error 2
make[2]: Leaving directory`/home/LTP/ltp-dev-20101112/testcases/realtime'
Quoted 16 lines
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/LTP/ltp-dev-20101112/testcases'
make: *** [testcases-all] Error 2
------------"realtime" build failed in:
------------
RHEL4.8 -- x86,x86_64, ia64
RHEL5.4 -- x86
------------"realtime" build succeeded in:
------------
RHEL5.4 --x86_64, ia64
------------Quoted 11 lines
Quoted 5 lines
Quoted 4 lines
It is caused by "
__sync_add_and_fetch".In following URL, "
__sync_add_and_fetch" is "built-in functions for atomic memory access". And It is provided in "gcc":http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Atomic-Builtins.html
Quoted 5 lines
Quoted 2 lines
There is "
__sync_add_and_fetch" in gcc4.1.2 (It is the gcc of RHEL5.1-
Quoted 2 lines
RHEL5.4).
And there is not "__sync_add_and_fetch" in gcc3.4.6 (It is the gccof
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
RHEL4.8)
In addition, "
__sync_add_and_fetch" is for 64 bit environment.http://stackoverflow.com/questions/130740/link-error-when-compiling-
Quoted 6 lines
Quoted 6 lines
gcc-atom
Quoted 5 lines
ic-operation-in-32-bit-mode
http://gcc.gnu.org/wiki/Atomic
Perhaps, the judgment that "realtime" must be built or not depends
on
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
gcc's version (> 4.0) and 64 bits environment, I think.
Could you please attach your testcases/realtime/config.log and
testcases/realtime/include/realtime_config.h? Thanks,
-GarrettQuoted 8 lines
I understood.
Thank you and sorry for my insufficient information.I attach following files:
- config.log (RHEL4.8-x86)
-realtime_config.h(RHEL4.8-x86)
- config.log (RHEL5.5-x86)
-realtime_config.h(RHEL5.5-x86)Could you please try compiling the following C sources in both
scenarios?
Thanks,
-Garrett
Quoted 8 lines
#ifndef
_GNU_SOURCE
#define_GNU_SOURCE
#endif
#include <stdlib.h>int main(void) { char *c; return __sync_add_and_fetch(c, 1); }
I was going to compile the sent source in RHEL4.8/5.5-x86, but failed.
------------<RHEL4.8-x86>
[root@RHEL48-LTP-x86 async_handler]# cat realtime-test.c #ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <stdlib.h>
int main(void) {
char *c;
return __sync_add_and_fetch(c, 1); }[root@RHEL48-LTP-x86 async_handler]# gcc realtime-test.c -o realtime-test
/tmp/cciHVx8b.o(.text+0x25): In function `main':
: undefined reference to `__sync_add_and_fetch'
collect2: ld returned 1 exit status
[root@RHEL48-LTP-x86 async_handler]#
[root@RHEL48-LTP-x86 async_handler]# gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE -I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../include
-I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realtime/lib -L../../../..
/lib realtime-test.c -lrealtime -lpthread -lrt -lm -o realtime-testrealtime-test.c: In function `main':
realtime-test.c:7: warning: implicit declaration of function `__sync_add_and_fetch'
realtime-test.c:6: warning: 'c' might be used uninitialized in this function
/tmp/ccIDckLk.o(.text+0x10): In function `main':/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler/realtime-test.c:7: undefined reference to `__sync_add_and_fetch'
collect2: ld returned 1 exit status
[root@RHEL48-LTP-x86 async_handler]#
------------
------------<RHEL5.5-x86>
[root@RHEL55-LTP-x86 async_handler]# cat realtime-test.c #ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <stdlib.h>
int main(void) {
char *c;
return __sync_add_and_fetch(c, 1); }[root@RHEL55-LTP-x86 async_handler]# gcc realtime-test.c -o realtime-test/tmp/ccK8hmPs.o: In function `main':
realtime-test.c:(.text+0x20): undefined reference to `__sync_add_and_fetch_1'
collect2: ld returned 1 exit status
[root@RHEL55-LTP-x86 async_handler]# gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE -I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../include
-I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realtime/lib -L../../../..
/lib realtime-test.c -lrealtime -lpthread -lrt -lm -o realtime-testrealtime-test.c: In function 'main':
realtime-test.c:7: warning: 'c' is used uninitialized in this function/tmp/ccKUnocB.o: In function `main':/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler/realtime-test.c:7: undefined reference to `__sync_add_and_fetch_1'
collect2: ld returned 1 exit status
[root@RHEL55-LTP-x86 async_handler]#
------------
Regards--
-Tomonori Mitani
------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture Simplifying enterprise desktop deployment and management using Dell EqualLogic storage and VMware View: A highly scalable, end-to-end client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 221 lines · Mitani
Quoted 171 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Monday, November 15, 2010 2:20 PM
To: Mitani
Cc: [email protected]; 當座 健市
Subject: Re: [LTP] Realtime test failure2010/11/14 Mitani <[email protected]>:
Quoted 13 lines
Quoted 13 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Monday, November 15, 2010 12:03 PM
To: Mitani
Subject: Re: [LTP] Realtime test failureQuoted 5 lines · Mitani
Hi,
"realtime" build failed in my system with git "ltp-f388d33.tar.gz":
------------<RHEL4.8 - x86>
make[2]: Entering directory`/home/LTP/ltp-dev-20101112/testcases/realtime'
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
make -C lib -f
"
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/Makefile"Review
Quoted 6 lines
all
make[3]: Entering directory `/home/LTP/ltp-dev-20101112/testcases/realtime/lib' gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE(quoted diff) +0
-2-I/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include -I../../../include -I../../../include -c -o librttest.o
librttest.cQuoted 3 lines
Quoted 3 lines
Quoted 2 lines
In file included from librttest.c:43:
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 4 lines
Quoted 4 lines
st.h: InQuoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 8 lines
Quoted 8 lines
st.h:119
Quoted 6 lines
: warning: implicit declaration of function `__sync_add_and_fetch' gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE
(quoted diff) +0
-2-I/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include -I../../../include -I../../../include -c -o libstats.o libstats.cIn file included from libstats.c:47:
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 4 lines
Quoted 4 lines
st.h: InQuoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 14 lines
Quoted 14 lines
st.h:119
Quoted 13 lines
: warning: implicit declaration of function `__sync_add_and_fetch' if [ -z "librttest.o libstats.o" ] ; then \
echo "Cowardly refusing to create empty archive"; \
exit 1; \
fi
ar -rc "librealtime.a" librttest.o libstats.o
ranlib "librealtime.a"
make[3]: Leaving directory/home/LTP/ltp-dev-20101112/testcases/realtime/lib' make[3]: Entering directory/home/LTP/ltp-dev-20101112/testcases/realtime/func' make[4]: Entering directory`/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler'
Quoted 8 lines
Quoted 8 lines
Review
Quoted 4 lines
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE
(quoted diff) +0
-3-I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../include -I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realtime/lib-L../../../../lib
Quoted 3 lines
async_handler.c-lrealtime -lpthread -lrt -lm -oasync_handlerIn file included from async_handler.c:42:
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:Quoted 4 lines
Quoted 4 lines
In
Quoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:11Quoted 4 lines
Quoted 4 lines
9:
Quoted 2 lines
warning: implicit declaration of function `__sync_add_and_fetch'
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/librealtime.a(libr
Quoted 4 lines
Quoted 4 lines
ttest.o)
Quoted 2 lines
(.text+0x1a7): In function `create_thread':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 6 lines
Quoted 6 lines
st.h:119
Quoted 5 lines
: undefined reference to `__sync_add_and_fetch'
collect2: ld returned 1 exit status
make[4]: *** [async_handler] Error 1
make[4]: Leaving directory`/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler'
Quoted 22 lines
Quoted 22 lines
Quoted 5 lines
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/LTP/ltp-dev-20101112/testcases/realtime/func' make[2]: *** [all] Error 2
make[2]: Leaving directory`/home/LTP/ltp-dev-20101112/testcases/realtime'
Quoted 16 lines
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/LTP/ltp-dev-20101112/testcases'
make: *** [testcases-all] Error 2
------------"realtime" build failed in:
------------
RHEL4.8 -- x86,x86_64, ia64
RHEL5.4 -- x86
------------"realtime" build succeeded in:
------------
RHEL5.4 --x86_64, ia64
------------Quoted 11 lines
Quoted 5 lines
Quoted 4 lines
It is caused by "
__sync_add_and_fetch".In following URL, "
__sync_add_and_fetch" is "built-in functions for atomic memory access". And It is provided in "gcc":http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Atomic-Builtins.html
Quoted 5 lines
Quoted 2 lines
There is "
__sync_add_and_fetch" in gcc4.1.2 (It is the gcc of RHEL5.1-
Quoted 2 lines
RHEL5.4).
And there is not "__sync_add_and_fetch" in gcc3.4.6 (It is the gccof
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
RHEL4.8)
In addition, "
__sync_add_and_fetch" is for 64 bit environment.http://stackoverflow.com/questions/130740/link-error-when-compiling-
Quoted 6 lines
Quoted 6 lines
gcc-atom
Quoted 5 lines
ic-operation-in-32-bit-mode
http://gcc.gnu.org/wiki/Atomic
Perhaps, the judgment that "realtime" must be built or not depends
on
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
gcc's version (> 4.0) and 64 bits environment, I think.
Could you please attach your testcases/realtime/config.log and
testcases/realtime/include/realtime_config.h? Thanks,
-GarrettQuoted 8 lines
I understood.
Thank you and sorry for my insufficient information.I attach following files:
- config.log (RHEL4.8-x86)
-realtime_config.h(RHEL4.8-x86)
- config.log (RHEL5.5-x86)
-realtime_config.h(RHEL5.5-x86)Could you please try compiling the following C sources in both scenarios?
Thanks,
-GarrettQuoted 8 lines
#ifndef
_GNU_SOURCE
#define_GNU_SOURCE
#endif
#include <stdlib.h>
int main(void) {
char *c;
return__sync_add_and_fetch(c, 1);
}I was going to compile the sent source in RHEL4.8/5.5-x86, but failed.
------------<RHEL4.8-x86>
[root@RHEL48-LTP-x86 async_handler]# catrealtime-test.c#ifndef_GNU_SOURCE
#define_GNU_SOURCE
#endif
#include <stdlib.h>
int main(void) {
char *c;
return__sync_add_and_fetch(c, 1); }[root@RHEL48-LTP-x86 async_handler]# gcc
realtime-test.c-o realtime-test
/tmp/cciHVx8b.o(.text+0x25): In function `main':
: undefined reference to `__sync_add_and_fetch'
collect2: ld returned 1 exit status
[root@RHEL48-LTP-x86 async_handler]#
[root@RHEL48-LTP-x86 async_handler]# gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE-I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../include -I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realtime/lib -L../../../..
/lib realtime-test.c -lrealtime -lpthread -lrt -lm -o realtime-testrealtime-test.c: In function `main':
realtime-test.c:7: warning: implicit declaration of function `__sync_add_and_fetch'
realtime-test.c:6: warning: 'c' might be used uninitialized in this function
/tmp/ccIDckLk.o(.text+0x10): In function `main':/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler/realtime-test.c:7: undefined reference to `__sync_add_and_fetch'
collect2: ld returned 1 exit status
[root@RHEL48-LTP-x86 async_handler]#
------------------------<RHEL5.5-x86>
[root@RHEL55-LTP-x86 async_handler]# catrealtime-test.c#ifndef_GNU_SOURCE
#define_GNU_SOURCE
#endif
#include <stdlib.h>
int main(void) {
char *c;
return__sync_add_and_fetch(c, 1); }
Quoted 14 lines
[root@RHEL55-LTP-x86 async_handler]# gcc
realtime-test.c-o realtime-test/tmp/ccK8hmPs.o: In function `main':
realtime-test.c:(.text+0x20): undefined reference to `__sync_add_and_fetch_1'
collect2: ld returned 1 exit status
[root@RHEL55-LTP-x86 async_handler]# gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE-I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../include -I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realtime/lib -L../../../..
/lib realtime-test.c -lrealtime -lpthread -lrt -lm -o realtime-testrealtime-test.c: In function 'main':
realtime-test.c:7: warning: 'c' is used uninitialized in this function/tmp/ccKUnocB.o: In function `main':/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler/realtime-test.c:7: undefined reference to `__sync_add_and_fetch_1'
collect2: ld returned 1 exit status
[root@RHEL55-LTP-x86 async_handler]#
Not sure why but it incorrectly passed on your machine:
configure:5186: checking Checking for __sync_add_and_fetch gcc builtin function configure:5216: gcc -c -g -O2 conftest.c >&5
configure:5222: $? = 0
23 AC_MSG_CHECKING([Checking for __sync_add_and_fetch gcc builtin function]) 24 AC_TRY_COMPILE([
25 #ifndef _GNU_SOURCE
26 #define _GNU_SOURCE
27 #endif
28 #include <stdlib.h>],[int main(void) {
29 char *c;
30 return __sync_add_and_fetch(c, 1);
31 }],[has___sync_add_and_fetch=yes])
32 if test "x$has___sync_add_and_fetch" = xyes; then
33 AC_DEFINE(HAVE___SYNC_ADD_AND_FETCH,1,[Define to 1 if you
have the __ sync_add_and_fetch gcc builtin function])
34 AC_MSG_RESULT(yes)
35 else
36 AC_MSG_RESULT(no)
37 fi
Whereas it didn't on mine:
248 configure:4777: checking Checking for __sync_add_and_fetch gcc
builtin funct ion
249 configure:4797: gcc -c -g -O2 conftest.c >&5
250 configure:4797: $? = 0
There was a potential problem with the macro though (I keep on
forgetting that AC_TRY_COMPILE and AC_COMPILE_IFELSE work predefine main() with the block of code provided), so please let me know if things work for you.
Thanks,
-Garrett
------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture Simplifying enterprise desktop deployment and management using Dell EqualLogic storage and VMware View: A highly scalable, end-to-end client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 307 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Tuesday, November 16, 2010 12:58 AM
To: Mitani
Cc: [email protected]
Subject: Re: [LTP] Realtime test failureQuoted 32 lines · Mitani
Quoted 32 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Monday, November 15, 2010 2:20 PM
To: Mitani
Cc: [email protected]; 當座 健市
Subject: Re: [LTP] Realtime test failure2010/11/14 Mitani <[email protected]>:
Quoted 13 lines
Quoted 13 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Monday, November 15, 2010 12:03 PM
To: Mitani
Subject: Re: [LTP] Realtime test failureQuoted 5 lines · Mitani
Hi,
"realtime" build failed in my system with git "ltp-f388d33.tar.gz":
------------<RHEL4.8 - x86>
make[2]: Entering directory`/home/LTP/ltp-dev-20101112/testcases/realtime'
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
make -C lib -f
"
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/Makefile"Review
Quoted 6 lines
all
make[3]: Entering directory `/home/LTP/ltp-dev-20101112/testcases/realtime/lib' gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE(quoted diff) +0
-2-I/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include -I../../../include -I../../../include -c -o librttest.o
librttest.cQuoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
In file included from librttest.c:43:
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
st.h: InQuoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
st.h:119
Review
Quoted 4 lines
: warning: implicit declaration of function `__sync_add_and_fetch' gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE
(quoted diff) +0
-2-I/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include -I../../../include -I../../../include -c -o libstats.o
libstats.cQuoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
In file included from libstats.c:47:
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
st.h: InQuoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 23 lines
Quoted 23 lines
Quoted 14 lines
Quoted 14 lines
st.h:119
Quoted 13 lines
: warning: implicit declaration of function `__sync_add_and_fetch'
if [ -z "librttest.o libstats.o" ] ; then \ echo "Cowardly refusing to create empty archive"; \ exit 1; \fi
ar -rc "librealtime.a" librttest.o libstats.o ranlib "librealtime.a"
make[3]: Leaving directory/home/LTP/ltp-dev-20101112/testcases/realtime/lib' make[3]: Entering directory/home/LTP/ltp-dev-20101112/testcases/realtime/func' make[4]: Entering directory`/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler'
Quoted 8 lines
Quoted 8 lines
Review
Quoted 4 lines
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE
(quoted diff) +0
-3-I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../include -I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realtime/lib-L../../../../lib
Quoted 3 lines
async_handler.c-lrealtime -lpthread -lrt -lm -oasync_handler
In file included from async_handler.c:42:Quoted 6 lines
Quoted 6 lines
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:Quoted 4 lines
Quoted 4 lines
In
Quoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:11Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
9:
Quoted 2 lines
warning: implicit declaration of function `__sync_add_and_fetch'
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/librealtime.a(libr
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
ttest.o)
Quoted 2 lines
(.text+0x1a7): In function `create_thread':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
st.h:119
Quoted 5 lines
: undefined reference to `__sync_add_and_fetch'
collect2: ld returned 1 exit status
make[4]: *** [async_handler] Error 1
make[4]: Leaving directory`/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler'
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/LTP/ltp-dev-20101112/testcases/realtime/func' make[2]: *** [all] Error 2
make[2]: Leaving directory`/home/LTP/ltp-dev-20101112/testcases/realtime'
Quoted 2 lines
make[1]: *** [all] Error 2
make[1]: Leaving directory`/home/LTP/ltp-dev-20101112/testcases'
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
make: *** [testcases-all] Error 2
------------"realtime" build failed in:
------------
RHEL4.8 -- x86,x86_64, ia64
RHEL5.4 -- x86
------------Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
"realtime" build succeeded in:
------------
RHEL5.4 --x86_64, ia64
------------It is caused by "
__sync_add_and_fetch".In following URL, "
__sync_add_and_fetch" is "built-in functionsfor
Quoted 6 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
atomic memory access". And It is provided in "gcc":
http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Atomic-Builtins.html
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
There is "
__sync_add_and_fetch" in gcc4.1.2 (It is the gcc ofRHEL5.1
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
-
Quoted 2 lines
RHEL5.4).
And there is not "__sync_add_and_fetch" in gcc3.4.6 (It is thegcc
Quoted 8 lines
Quoted 8 lines
of
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
RHEL4.8)
In addition, "
__sync_add_and_fetch" is for 64 bit environment.http://stackoverflow.com/questions/130740/link-error-when-compiling-
Quoted 47 lines
Quoted 29 lines
Quoted 6 lines
Quoted 6 lines
gcc-atom
Quoted 5 lines
ic-operation-in-32-bit-mode
http://gcc.gnu.org/wiki/Atomic
Perhaps, the judgment that "realtime" must be built or not depends
on
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
gcc's version (> 4.0) and 64 bits environment, I think.
Could you please attach your testcases/realtime/config.log and
testcases/realtime/include/realtime_config.h? Thanks,
-GarrettQuoted 8 lines
I understood.
Thank you and sorry for my insufficient information.I attach following files:
- config.log (RHEL4.8-x86)
-realtime_config.h(RHEL4.8-x86)
- config.log (RHEL5.5-x86)
-realtime_config.h(RHEL5.5-x86)Could you please try compiling the following C sources in both
scenarios?
Thanks,
-GarrettQuoted 8 lines
#ifndef
_GNU_SOURCE
#define_GNU_SOURCE
#endif
#include <stdlib.h>int main(void) { char *c; return __sync_add_and_fetch(c, 1); }I was going to compile the sent source in RHEL4.8/5.5-x86, but failed.
------------<RHEL4.8-x86>
[root@RHEL48-LTP-x86 async_handler]# catrealtime-test.c#ifndef_GNU_SOURCE
#define_GNU_SOURCE
#endif
#include <stdlib.h>Quoted 5 lines
int main(void) { char *c; return __sync_add_and_fetch(c, 1); }[root@RHEL48-LTP-x86 async_handler]# gcc
realtime-test.c-orealtime-test
Quoted 5 lines
/tmp/cciHVx8b.o(.text+0x25): In function `main':
: undefined reference to `__sync_add_and_fetch'
collect2: ld returned 1 exit status [root@RHEL48-LTP-x86 async_handler]# [root@RHEL48-LTP-x86 async_handler]# gcc -g -O2 -g -O2-fno-strict-aliasing -pipe -Wall -D
Quoted 1 line
_GNU_SOURCE-I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../includeQuoted 1 line
-I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/re
altime/lib -L../../../..
Quoted 3 lines
/lib
realtime-test.c-lrealtime -lpthread -lrt -lm -o realtime-testrealtime-test.c: In function `main':
realtime-test.c:7: warning: implicit declaration of function`__sync_add_and_fetch'
Quoted 1 line
realtime-test.c:6: warning: 'c' might be used uninitialized in this
function
Quoted 2 lines
/tmp/ccIDckLk.o(.text+0x10): In function `main':
/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler/realtime-test.c:7: undefined reference to `__sync_add_and_fetch'Quoted 10 lines
collect2: ld returned 1 exit status
[root@RHEL48-LTP-x86 async_handler]#
------------------------<RHEL5.5-x86>
[root@RHEL55-LTP-x86 async_handler]# catrealtime-test.c#ifndef_GNU_SOURCE
#define_GNU_SOURCE
#endif
#include <stdlib.h>Quoted 5 lines
int main(void) { char *c; return __sync_add_and_fetch(c, 1); }[root@RHEL55-LTP-x86 async_handler]# gcc
realtime-test.c-orealtime-test
Quoted 2 lines
/tmp/ccK8hmPs.o: In function `main':
realtime-test.c:(.text+0x20): undefined reference to`__sync_add_and_fetch_1'
Quoted 2 lines
collect2: ld returned 1 exit status [root@RHEL55-LTP-x86 async_handler]# gcc -g -O2 -g -O2
-fno-strict-aliasing -pipe -Wall -D
Quoted 1 line
_GNU_SOURCE-I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../includeQuoted 1 line
-I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/re
altime/lib -L../../../..
Quoted 5 lines
/lib
realtime-test.c-lrealtime -lpthread -lrt -lm -o realtime-testrealtime-test.c: In function 'main':
realtime-test.c:7: warning: 'c' is used uninitialized in this function/tmp/ccKUnocB.o: In function `main':
/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler/realtime-test.c:7: undefined reference to `__sync_add_and_fetch_1'Quoted 2 lines
collect2: ld returned 1 exit status
[root@RHEL55-LTP-x86 async_handler]#Not sure why but it incorrectly passed on your machine:
configure:5186: checking Checking for
__sync_add_and_fetchgcc builtin function
configure:5216: gcc -c -g -O2conftest.c>&5 configure:5222: $? = 023
AC_MSG_CHECKING([Checking for __sync_add_and_fetch gcc builtin function])
24 AC_TRY_COMPILE([
25 #ifndef_GNU_SOURCE
26 #define_GNU_SOURCE
27 #endif
28 #include <stdlib.h>],[int main(void) {
29 char *c;
30 return__sync_add_and_fetch(c, 1);
31 }],[has___sync_add_and_fetch=yes])
32 if test "x$has___sync_add_and_fetch" = xyes; then
33 AC_DEFINE(HAVE___SYNC_ADD_AND_FETCH,1,[Define to 1 if you
have the __sync_add_and_fetchgcc builtin function])
34AC_MSG_RESULT(yes)
35 else
36AC_MSG_RESULT(no)
37 fiWhereas it didn't on mine:
248 configure:4777: checking Checking for
__sync_add_and_fetchgcc
builtin funct ion
249 configure:4797: gcc -c -g -O2conftest.c>&5
250 configure:4797: $? = 0
Quoted 6 lines
There was a potential problem with the macro though (I keep on
forgetting thatAC_TRY_COMPILEandAC_COMPILE_IFELSEwork predefinemain()with the block of code provided), so please let me know if things work for you.
Thanks,
-Garrett
I attached same options by obeying "config.log".
And I confirmed that "conftest.c" could be successfully compiled by manual operation:
------------
[root@RHEL48-LTP-x86 async_handler]# pwd /home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler [root@RHEL48-LTP-x86 async_handler]# ll
total 36
-rw-rw-r-- 1 root root 1045 Nov 12 02:19 Makefile -rw-rw-r-- 1 root root 5341 Nov 12 02:19 async_handler.c -rw-rw-r-- 1 root root 4485 Nov 12 02:19 async_handler_jk.c -rw-rw-r-- 1 root root 6013 Nov 12 02:19 async_handler_tsc.c -rw-r--r-- 1 root root 147 Nov 15 15:14 conftest.c -rwxrwxr-x 1 root root 333 Nov 12 02:19 run_auto.sh
[root@RHEL48-LTP-x86 async_handler]# cat conftest.c #ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <stdlib.h>
int main(void) {
char *c;
return __sync_add_and_fetch(c, 1); }[root@RHEL48-LTP-x86 async_handler]# gcc -c -g -O2 conftest.c [root@RHEL48-LTP-x86 async_handler]# echo $?
0
[root@RHEL48-LTP-x86 async_handler]# ll
total 40
-rw-rw-r-- 1 root root 1045 Nov 12 02:19 Makefile -rw-rw-r-- 1 root root 5341 Nov 12 02:19 async_handler.c -rw-rw-r-- 1 root root 4485 Nov 12 02:19 async_handler_jk.c -rw-rw-r-- 1 root root 6013 Nov 12 02:19 async_handler_tsc.c -rw-r--r-- 1 root root 147 Nov 15 15:14 conftest.c -rw-r--r-- 1 root root 2596 Nov 16 16:24 conftest.o -rwxrwxr-x 1 root root 333 Nov 12 02:19 run_auto.sh
[root@RHEL48-LTP-x86 async_handler]#
------------
I tried build async_handler.c with "-c" option by manual operation
according to "conftest.c", and it succeeded:
------------
[root@RHEL48-LTP-x86 async_handler]# gcc -c -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE -I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../include -I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realtime/lib -L../../../../lib async_handler.c -lrealtime -lpthread -lrt -lm -o async_handler
In file included from async_handler.c:42:/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h: In function `atomic_add':/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:119: warning: implicit declaration of function `__sync_add_and_fetch'
gcc: -lrealtime: linker input file unused because linking not done
gcc: -lpthread: linker input file unused because linking not done
gcc: -lrt: linker input file unused because linking not done
gcc: -lm: linker input file unused because linking not done
[root@RHEL48-LTP-x86 async_handler]# echo $?
0
[root@RHEL48-LTP-x86 async_handler]# ll
total 56
-rw-rw-r-- 1 root root 1045 Nov 12 02:19 Makefile -rw-r--r-- 1 root root 12612 Nov 16 16:27 async_handler -rw-rw-r-- 1 root root 5341 Nov 12 02:19 async_handler.c -rw-rw-r-- 1 root root 4485 Nov 12 02:19 async_handler_jk.c -rw-rw-r-- 1 root root 6013 Nov 12 02:19 async_handler_tsc.c -rw-r--r-- 1 root root 147 Nov 15 15:14 conftest.c -rw-r--r-- 1 root root 2596 Nov 16 16:24 conftest.o -rwxrwxr-x 1 root root 333 Nov 12 02:19 run_auto.sh
[root@RHEL48-LTP-x86 async_handler]#
------------
But above build is not with linkage by "-c" option.
With linkage, it failed:
------------
[root@RHEL48-LTP-x86 async_handler]# gcc -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE -I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../include -I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realtime/lib -L../../../../lib async_handler.c -lrealtime -lpthread -lrt -lm -o async_handler
In file included from async_handler.c:42:/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h: In function `atomic_add':/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:119: warning: implicit declaration of function __sync_add_and_fetch' /home/LTP/ltp-dev-20101112/testcases/realtime/lib/librealtime.a(librttest.o)(.text+0x1a7): In function create_thread':/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librttest.h:119: undefined reference to `__sync_add_and_fetch'
collect2: ld returned 1 exit status
[root@RHEL48-LTP-x86 async_handler]#
------------
I think that the check of "__sync_add_and_fetch" by "conftest.c" must be done without "-c" option.
Regards--
-Tomonori Mitani
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 392 lines · Mitani
Quoted 307 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Tuesday, November 16, 2010 12:58 AM
To: Mitani
Cc: [email protected]
Subject: Re: [LTP] Realtime test failureQuoted 32 lines · Mitani
Quoted 32 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Monday, November 15, 2010 2:20 PM
To: Mitani
Cc: [email protected]; 當座 健市
Subject: Re: [LTP] Realtime test failure2010/11/14 Mitani <[email protected]>:
Quoted 13 lines
Quoted 13 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Monday, November 15, 2010 12:03 PM
To: Mitani
Subject: Re: [LTP] Realtime test failureQuoted 5 lines · Mitani
Hi,
"realtime" build failed in my system with git "ltp-f388d33.tar.gz":
------------<RHEL4.8 - x86>
make[2]: Entering directory`/home/LTP/ltp-dev-20101112/testcases/realtime'
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
make -C lib -f
"
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/Makefile"Review
Quoted 6 lines
all
make[3]: Entering directory `/home/LTP/ltp-dev-20101112/testcases/realtime/lib' gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE(quoted diff) +0
-2-I/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include -I../../../include -I../../../include -c -o librttest.o
librttest.cQuoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
In file included from librttest.c:43:
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
st.h: InQuoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
st.h:119
Review
Quoted 4 lines
: warning: implicit declaration of function `__sync_add_and_fetch' gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE
(quoted diff) +0
-2-I/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include -I../../../include -I../../../include -c -o libstats.o
libstats.cQuoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
In file included from libstats.c:47:
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
st.h: InQuoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 23 lines
Quoted 23 lines
Quoted 14 lines
Quoted 14 lines
st.h:119
Quoted 13 lines
: warning: implicit declaration of function `__sync_add_and_fetch' if [ -z "librttest.o libstats.o" ] ; then \
echo "Cowardly refusing to create empty archive"; \
exit 1; \
fi
ar -rc "librealtime.a" librttest.o libstats.o
ranlib "librealtime.a"
make[3]: Leaving directory/home/LTP/ltp-dev-20101112/testcases/realtime/lib' make[3]: Entering directory/home/LTP/ltp-dev-20101112/testcases/realtime/func' make[4]: Entering directory`/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler'
Quoted 8 lines
Quoted 8 lines
Review
Quoted 4 lines
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE
(quoted diff) +0
-3-I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../include -I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realtime/lib-L../../../../lib
Quoted 3 lines
async_handler.c-lrealtime -lpthread -lrt -lm -oasync_handlerIn file included from async_handler.c:42:Quoted 6 lines
Quoted 6 lines
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:Quoted 4 lines
Quoted 4 lines
In
Quoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:11Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
9:
Quoted 2 lines
warning: implicit declaration of function `__sync_add_and_fetch'
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/librealtime.a(libr
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
ttest.o)
Quoted 2 lines
(.text+0x1a7): In function `create_thread':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
st.h:119
Quoted 5 lines
: undefined reference to `__sync_add_and_fetch'
collect2: ld returned 1 exit status
make[4]: *** [async_handler] Error 1
make[4]: Leaving directory`/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler'
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/LTP/ltp-dev-20101112/testcases/realtime/func' make[2]: *** [all] Error 2
make[2]: Leaving directory`/home/LTP/ltp-dev-20101112/testcases/realtime'
Quoted 2 lines
make[1]: *** [all] Error 2
make[1]: Leaving directory`/home/LTP/ltp-dev-20101112/testcases'
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
make: *** [testcases-all] Error 2
------------"realtime" build failed in:
------------
RHEL4.8 -- x86,x86_64, ia64
RHEL5.4 -- x86
------------Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
"realtime" build succeeded in:
------------
RHEL5.4 --x86_64, ia64
------------It is caused by "
__sync_add_and_fetch".In following URL, "
__sync_add_and_fetch" is "built-in functionsfor
Quoted 6 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
atomic memory access". And It is provided in "gcc":
http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Atomic-Builtins.html
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
There is "
__sync_add_and_fetch" in gcc4.1.2 (It is the gcc ofRHEL5.1
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
-
Quoted 2 lines
RHEL5.4).
And there is not "__sync_add_and_fetch" in gcc3.4.6 (It is thegcc
Quoted 8 lines
Quoted 8 lines
of
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
RHEL4.8)
In addition, "
__sync_add_and_fetch" is for 64 bit environment.http://stackoverflow.com/questions/130740/link-error-when-compiling-
Quoted 51 lines
Quoted 29 lines
Quoted 6 lines
Quoted 6 lines
gcc-atom
Quoted 5 lines
ic-operation-in-32-bit-mode
http://gcc.gnu.org/wiki/Atomic
Perhaps, the judgment that "realtime" must be built or not depends
on
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
gcc's version (> 4.0) and 64 bits environment, I think.
Could you please attach your testcases/realtime/config.log and
testcases/realtime/include/realtime_config.h? Thanks,
-GarrettQuoted 8 lines
I understood.
Thank you and sorry for my insufficient information.I attach following files:
- config.log (RHEL4.8-x86)
-realtime_config.h(RHEL4.8-x86)
- config.log (RHEL5.5-x86)
-realtime_config.h(RHEL5.5-x86)Could you please try compiling the following C sources in both scenarios?
Thanks,
-GarrettQuoted 8 lines
#ifndef
_GNU_SOURCE
#define_GNU_SOURCE
#endif
#include <stdlib.h>
int main(void) {
char *c;
return__sync_add_and_fetch(c, 1);
}I was going to compile the sent source in RHEL4.8/5.5-x86, but failed.
------------<RHEL4.8-x86>
[root@RHEL48-LTP-x86 async_handler]# catrealtime-test.c#ifndef_GNU_SOURCE
#define_GNU_SOURCE
#endif
#include <stdlib.h>
int main(void) {
char *c;
return__sync_add_and_fetch(c, 1); }Quoted 1 line
[root@RHEL48-LTP-x86 async_handler]# gcc
realtime-test.c-orealtime-test
Quoted 5 lines
/tmp/cciHVx8b.o(.text+0x25): In function `main':
: undefined reference to `__sync_add_and_fetch'
collect2: ld returned 1 exit status [root@RHEL48-LTP-x86 async_handler]# [root@RHEL48-LTP-x86 async_handler]# gcc -g -O2 -g -O2-fno-strict-aliasing -pipe -Wall -D
Quoted 1 line
_GNU_SOURCE-I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../includeQuoted 1 line
-I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/re
altime/lib -L../../../..
Quoted 3 lines
/lib realtime-test.c -lrealtime -lpthread -lrt -lm -o realtime-test
realtime-test.c: In function `main':
realtime-test.c:7: warning: implicit declaration of function`__sync_add_and_fetch'
Quoted 1 line
realtime-test.c:6: warning: 'c' might be used uninitialized in this
function
Quoted 2 lines
/tmp/ccIDckLk.o(.text+0x10): In function `main':
/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler/realtime-test.c:7: undefined reference to `__sync_add_and_fetch'Quoted 14 lines
collect2: ld returned 1 exit status
[root@RHEL48-LTP-x86 async_handler]#
------------------------<RHEL5.5-x86>
[root@RHEL55-LTP-x86 async_handler]# catrealtime-test.c#ifndef_GNU_SOURCE
#define_GNU_SOURCE
#endif
#include <stdlib.h>
int main(void) {
char *c;
return__sync_add_and_fetch(c, 1); }Quoted 1 line
[root@RHEL55-LTP-x86 async_handler]# gcc
realtime-test.c-orealtime-test
Quoted 2 lines
/tmp/ccK8hmPs.o: In function `main':
realtime-test.c:(.text+0x20): undefined reference to`__sync_add_and_fetch_1'
Quoted 2 lines
collect2: ld returned 1 exit status [root@RHEL55-LTP-x86 async_handler]# gcc -g -O2 -g -O2
-fno-strict-aliasing -pipe -Wall -D
Quoted 1 line
_GNU_SOURCE-I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../includeQuoted 1 line
-I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/re
altime/lib -L../../../..
Quoted 5 lines
/lib realtime-test.c -lrealtime -lpthread -lrt -lm -o realtime-test
realtime-test.c: In function 'main':
realtime-test.c:7: warning: 'c' is used uninitialized in this function/tmp/ccKUnocB.o: In function `main':
/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler/realtime-test.c:7: undefined reference to `__sync_add_and_fetch_1'Quoted 2 lines
collect2: ld returned 1 exit status
[root@RHEL55-LTP-x86 async_handler]#Not sure why but it incorrectly passed on your machine:
configure:5186: checking Checking for
__sync_add_and_fetchgcc builtin function
configure:5216: gcc -c -g -O2 conftest.c >&5 configure:5222: $? = 023
AC_MSG_CHECKING([Checking for __sync_add_and_fetch gcc builtin function])
24 AC_TRY_COMPILE([
25 #ifndef_GNU_SOURCE
26 #define_GNU_SOURCE
27 #endif
28 #include <stdlib.h>],[int main(void) {
29 char *c;
30 return__sync_add_and_fetch(c, 1);
31 }],[has___sync_add_and_fetch=yes])
32 if test "x$has___sync_add_and_fetch" = xyes; then
33 AC_DEFINE(HAVE___SYNC_ADD_AND_FETCH,1,[Define to 1 if you have the __sync_add_and_fetchgcc builtin function]) 34AC_MSG_RESULT(yes)
35 else
36AC_MSG_RESULT(no)
37 fiWhereas it didn't on mine:
248 configure:4777: checking Checking for
__sync_add_and_fetchgcc builtin funct ion
249 configure:4797: gcc -c -g -O2 conftest.c >&5
250 configure:4797: $? = 0Quoted 6 lines
There was a potential problem with the macro though (I keep on forgetting that
AC_TRY_COMPILEandAC_COMPILE_IFELSEwork predefinemain()with the block of code provided), so please let me know if things work for you.
Thanks,
-GarrettI attached same options by obeying "config.log".
And I confirmed that "conftest.c" could be successfully compiled by manual operation:
------------
[root@RHEL48-LTP-x86 async_handler]# pwd/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler[root@RHEL48-LTP-x86 async_handler]# ll
total 36(quoted diff) +0
-6-rw-rw-r-- 1 root root 1045 Nov 12 02:19 Makefile -rw-rw-r-- 1 root root 5341 Nov 12 02:19 async_handler.c -rw-rw-r-- 1 root root 4485 Nov 12 02:19 async_handler_jk.c -rw-rw-r-- 1 root root 6013 Nov 12 02:19 async_handler_tsc.c -rw-r--r-- 1 root root 147 Nov 15 15:14 conftest.c -rwxrwxr-x 1 root root 333 Nov 12 02:19 run_auto.sh[root@RHEL48-LTP-x86 async_handler]# cat
conftest.c#ifndef_GNU_SOURCE
#define_GNU_SOURCE
#endif
#include <stdlib.h>
int main(void) {
char *c;
return__sync_add_and_fetch(c, 1); }[root@RHEL48-LTP-x86 async_handler]# gcc -c -g -O2
conftest.c[root@RHEL48-LTP-x86 async_handler]# echo $?
0
[root@RHEL48-LTP-x86 async_handler]# ll
total 40(quoted diff) +0
-7-rw-rw-r-- 1 root root 1045 Nov 12 02:19 Makefile -rw-rw-r-- 1 root root 5341 Nov 12 02:19 async_handler.c -rw-rw-r-- 1 root root 4485 Nov 12 02:19 async_handler_jk.c -rw-rw-r-- 1 root root 6013 Nov 12 02:19 async_handler_tsc.c -rw-r--r-- 1 root root 147 Nov 15 15:14 conftest.c -rw-r--r-- 1 root root 2596 Nov 16 16:24 conftest.o -rwxrwxr-x 1 root root 333 Nov 12 02:19 run_auto.sh[root@RHEL48-LTP-x86 async_handler]#
------------I tried build
async_handler.cwith "-c" option by manual operation
according to "conftest.c", and it succeeded:
------------
[root@RHEL48-LTP-x86 async_handler]# gcc -c -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE -I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../include -I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realtime/lib -L../../../../lib async_handler.c -lrealtime -lpthread -lrt -lm -oasync_handlerIn file included from async_handler.c:42:/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h: In function `atomic_add':/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:119: warning: implicit declaration of function `__sync_add_and_fetch'
gcc: -lrealtime: linker input file unused because linking not done
gcc: -lpthread: linker input file unused because linking not done
gcc: -lrt: linker input file unused because linking not done
gcc: -lm: linker input file unused because linking not done
[root@RHEL48-LTP-x86 async_handler]# echo $?
0
[root@RHEL48-LTP-x86 async_handler]# ll
total 56(quoted diff) +0
-8-rw-rw-r-- 1 root root 1045 Nov 12 02:19 Makefile -rw-r--r-- 1 root root 12612 Nov 16 16:27 async_handler -rw-rw-r-- 1 root root 5341 Nov 12 02:19 async_handler.c -rw-rw-r-- 1 root root 4485 Nov 12 02:19 async_handler_jk.c -rw-rw-r-- 1 root root 6013 Nov 12 02:19 async_handler_tsc.c -rw-r--r-- 1 root root 147 Nov 15 15:14 conftest.c -rw-r--r-- 1 root root 2596 Nov 16 16:24 conftest.o -rwxrwxr-x 1 root root 333 Nov 12 02:19 run_auto.sh[root@RHEL48-LTP-x86 async_handler]#
------------But above build is not with linkage by "-c" option.
With linkage, it failed:
------------
[root@RHEL48-LTP-x86 async_handler]# gcc -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE -I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../include -I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realtime/lib -L../../../../lib async_handler.c -lrealtime -lpthread -lrt -lm -oasync_handlerIn file included from async_handler.c:42:/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h: In function `atomic_add':/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:119: warning: implicit declaration of function `__sync_add_and_fetch'
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/librealtime.a(librttest.o)(.text+0x1a7): In function `create_thread':/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librttest.h:119: undefined reference to `__sync_add_and_fetch'
collect2: ld returned 1 exit status
[root@RHEL48-LTP-x86 async_handler]#
------------
Quoted 2 lines
I think that the check of "
__sync_add_and_fetch" by "conftest.c" must be done without "-c" option.
Please try out HEAD again. It should be fixed now (I substitutedAC_LINK_IFELSE for AC_TRY_COMPILE).
Thanks,
-Garrett
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 454 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Wednesday, November 17, 2010 2:04 AM
To: Mitani
Cc: [email protected]
Subject: Re: [LTP] Realtime test failureQuoted 25 lines · Mitani
Quoted 25 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Tuesday, November 16, 2010 12:58 AM
To: Mitani
Cc: [email protected]
Subject: Re: [LTP] Realtime test failureQuoted 17 lines · Mitani
Quoted 17 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Monday, November 15, 2010 2:20 PM
To: Mitani
Cc: [email protected]; 當座 健市
Subject: Re: [LTP] Realtime test failure2010/11/14 Mitani <[email protected]>:
Quoted 7 lines
Quoted 7 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Monday, November 15, 2010 12:03 PM
To: Mitani
Subject: Re: [LTP] Realtime test failureOn Sun, Nov 14, 2010 at 6:54 PM, Mitani <[email protected]>
Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Hi,
"realtime" build failed in my system with git
"ltp-f388d33.tar.gz":
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 2 lines
------------<RHEL4.8 - x86>
make[2]: Entering directory`/home/LTP/ltp-dev-20101112/testcases/realtime'
Quoted 1 line
make -C lib -f
"
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/Makefile"Quoted 5 lines
all
make[3]: Entering directory `/home/LTP/ltp-dev-20101112/testcases/realtime/lib' gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE-I/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
-I../../../include -I../../../include -c -o librttest.o
librttest.cQuoted 3 lines
Quoted 3 lines
Quoted 2 lines
In file included from librttest.c:43:
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
st.h: InQuoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
st.h:119
Quoted 1 line
: warning: implicit declaration of function
`__sync_add_and_fetch'
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE
-I/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include
Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
-I../../../include -I../../../include -c -o libstats.o
libstats.cQuoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
In file included from libstats.c:47:
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
st.h: InQuoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
st.h:119
Quoted 1 line
: warning: implicit declaration of function
`__sync_add_and_fetch'
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
if [ -z "librttest.o libstats.o" ] ; then \ echo "Cowardly refusing to create empty archive"; \ exit 1; \fi
ar -rc "librealtime.a" librttest.o libstats.oQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
ranlib "librealtime.a"
make[3]: Leaving directory/home/LTP/ltp-dev-20101112/testcases/realtime/lib' make[3]: Entering directory/home/LTP/ltp-dev-20101112/testcases/realtime/func' make[4]: Entering directory`/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler'
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Review
Quoted 4 lines
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE
(quoted diff) +0
-3-I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../include -I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realtime/lib-L../../../../lib
Quoted 1 line
async_handler.c-lrealtime -lpthread -lrt -lm -o
async_handlerQuoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
In file included from async_handler.c:42:
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
In
Quoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:11Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
9:
Quoted 1 line
warning: implicit declaration of function
`__sync_add_and_fetch'
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/librealtime.a(libr
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
ttest.o)
Quoted 2 lines
(.text+0x1a7): In function `create_thread':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
st.h:119
Quoted 5 lines
: undefined reference to `__sync_add_and_fetch'
collect2: ld returned 1 exit status
make[4]: *** [async_handler] Error 1
make[4]: Leaving directory`/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler'
Quoted 25 lines
Quoted 25 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/LTP/ltp-dev-20101112/testcases/realtime/func' make[2]: *** [all] Error 2
make[2]: Leaving directory`/home/LTP/ltp-dev-20101112/testcases/realtime'
Quoted 2 lines
make[1]: *** [all] Error 2
make[1]: Leaving directory`/home/LTP/ltp-dev-20101112/testcases'
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
make: *** [testcases-all] Error 2
------------"realtime" build failed in:
------------
RHEL4.8 -- x86,x86_64, ia64
RHEL5.4 -- x86
------------"realtime" build succeeded in:
------------
RHEL5.4 --x86_64, ia64
------------It is caused by "
__sync_add_and_fetch".Quoted 9 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
In following URL, "
__sync_add_and_fetch" is "built-in functionsfor
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
atomic memory access". And It is provided in "gcc":
http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Atomic-Builtins.html
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
There is "
__sync_add_and_fetch" in gcc4.1.2 (It is the gccof
Quoted 4 lines
Quoted 4 lines
RHEL5.1
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
-
Quoted 2 lines
RHEL5.4).
And there is not "__sync_add_and_fetch" in gcc3.4.6 (It isthe
Quoted 10 lines
Quoted 10 lines
gcc
Quoted 8 lines
Quoted 8 lines
of
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
RHEL4.8)
In addition, "
__sync_add_and_fetch" is for 64 bit environment.http://stackoverflow.com/questions/130740/link-error-when-compiling-
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
gcc-atom
Quoted 5 lines
ic-operation-in-32-bit-mode
http://gcc.gnu.org/wiki/Atomic
Perhaps, the judgment that "realtime" must be built or not
depends
Quoted 47 lines
Quoted 47 lines
Quoted 41 lines
Quoted 23 lines
on
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
gcc's version (> 4.0) and 64 bits environment, I think.
Could you please attach your testcases/realtime/config.log and
testcases/realtime/include/realtime_config.h? Thanks,
-GarrettQuoted 8 lines
I understood.
Thank you and sorry for my insufficient information.I attach following files:
- config.log (RHEL4.8-x86)
-realtime_config.h(RHEL4.8-x86)
- config.log (RHEL5.5-x86)
-realtime_config.h(RHEL5.5-x86)Could you please try compiling the following C sources in both
scenarios?
Thanks,
-GarrettQuoted 8 lines
#ifndef
_GNU_SOURCE
#define_GNU_SOURCE
#endif
#include <stdlib.h>int main(void) { char *c; return __sync_add_and_fetch(c, 1); }I was going to compile the sent source in RHEL4.8/5.5-x86, but failed.
------------<RHEL4.8-x86>
[root@RHEL48-LTP-x86 async_handler]# catrealtime-test.c#ifndef_GNU_SOURCE
#define_GNU_SOURCE
#endif
#include <stdlib.h>Quoted 5 lines
int main(void) { char *c; return __sync_add_and_fetch(c, 1); }[root@RHEL48-LTP-x86 async_handler]# gcc
realtime-test.c-orealtime-test
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
/tmp/cciHVx8b.o(.text+0x25): In function `main':
: undefined reference to `__sync_add_and_fetch'
collect2: ld returned 1 exit status [root@RHEL48-LTP-x86 async_handler]# [root@RHEL48-LTP-x86 async_handler]# gcc -g -O2 -g -O2-fno-strict-aliasing -pipe -Wall -D
Quoted 1 line
_GNU_SOURCE-I/home/LTP/ltp-dev-20101112/testcases/realtime/includeQuoted 5 lines
Quoted 2 lines
-I../../../../include
-I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/re
Quoted 2 lines
altime/lib -L../../../..
Quoted 1 line
/lib
realtime-test.c-lrealtime -lpthread -lrt -lm -orealtime-test
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
realtime-test.c: In function `main':
realtime-test.c:7: warning: implicit declaration of function`__sync_add_and_fetch'
Quoted 1 line
realtime-test.c:6: warning: 'c' might be used uninitialized in this
function
Quoted 2 lines
/tmp/ccIDckLk.o(.text+0x10): In function `main':
/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler/reaQuoted 17 lines
Quoted 17 lines
ltime-test.c:7: undefined reference to `__sync_add_and_fetch'
Quoted 10 lines
collect2: ld returned 1 exit status
[root@RHEL48-LTP-x86 async_handler]#
------------------------<RHEL5.5-x86>
[root@RHEL55-LTP-x86 async_handler]# catrealtime-test.c#ifndef_GNU_SOURCE
#define_GNU_SOURCE
#endif
#include <stdlib.h>Quoted 5 lines
int main(void) { char *c; return __sync_add_and_fetch(c, 1); }[root@RHEL55-LTP-x86 async_handler]# gcc
realtime-test.c-orealtime-test
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
/tmp/ccK8hmPs.o: In function `main':
realtime-test.c:(.text+0x20): undefined reference to`__sync_add_and_fetch_1'
Quoted 2 lines
collect2: ld returned 1 exit status [root@RHEL55-LTP-x86 async_handler]# gcc -g -O2 -g -O2
-fno-strict-aliasing -pipe -Wall -D
Quoted 1 line
_GNU_SOURCE-I/home/LTP/ltp-dev-20101112/testcases/realtime/includeQuoted 5 lines
Quoted 2 lines
-I../../../../include
-I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/re
Quoted 2 lines
altime/lib -L../../../..
Quoted 1 line
/lib
realtime-test.c-lrealtime -lpthread -lrt -lm -orealtime-test
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
realtime-test.c: In function 'main':
realtime-test.c:7: warning: 'c' is used uninitialized in thisfunction
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
/tmp/ccKUnocB.o: In function `main':
/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler/reaQuoted 86 lines
Quoted 36 lines
ltime-test.c:7: undefined reference to `__sync_add_and_fetch_1'
Quoted 2 lines
collect2: ld returned 1 exit status
[root@RHEL55-LTP-x86 async_handler]#Not sure why but it incorrectly passed on your machine:
configure:5186: checking Checking for
__sync_add_and_fetchgcc builtin function
configure:5216: gcc -c -g -O2conftest.c>&5 configure:5222: $? = 023
AC_MSG_CHECKING([Checking for __sync_add_and_fetch gcc builtin function])
24 AC_TRY_COMPILE([
25 #ifndef_GNU_SOURCE
26 #define_GNU_SOURCE
27 #endif
28 #include <stdlib.h>],[int main(void) {
29 char *c;
30 return__sync_add_and_fetch(c, 1);
31 }],[has___sync_add_and_fetch=yes])
32 if test "x$has___sync_add_and_fetch" = xyes; then
33 AC_DEFINE(HAVE___SYNC_ADD_AND_FETCH,1,[Define to 1 if you
have the __sync_add_and_fetchgcc builtin function])
34AC_MSG_RESULT(yes)
35 else
36AC_MSG_RESULT(no)
37 fiWhereas it didn't on mine:
248 configure:4777: checking Checking for
__sync_add_and_fetchgcc
builtin funct ion
249 configure:4797: gcc -c -g -O2conftest.c>&5
250 configure:4797: $? = 0Quoted 6 lines
There was a potential problem with the macro though (I keep on
forgetting thatAC_TRY_COMPILEandAC_COMPILE_IFELSEwork predefinemain()with the block of code provided), so please let me know if things work for you.
Thanks,
-GarrettI attached same options by obeying "config.log".
And I confirmed that "conftest.c" could be successfully compiled by manual operation:
------------
[root@RHEL48-LTP-x86 async_handler]# pwd/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler[root@RHEL48-LTP-x86 async_handler]# ll
total 36(quoted diff) +0
-6-rw-rw-r-- 1 root root 1045 Nov 12 02:19 Makefile -rw-rw-r-- 1 root root 5341 Nov 12 02:19 async_handler.c -rw-rw-r-- 1 root root 4485 Nov 12 02:19 async_handler_jk.c -rw-rw-r-- 1 root root 6013 Nov 12 02:19 async_handler_tsc.c -rw-r--r-- 1 root root 147 Nov 15 15:14 conftest.c -rwxrwxr-x 1 root root 333 Nov 12 02:19 run_auto.sh[root@RHEL48-LTP-x86 async_handler]# cat
conftest.c#ifndef_GNU_SOURCE
#define_GNU_SOURCE
#endif
#include <stdlib.h>int main(void) { char *c; return __sync_add_and_fetch(c, 1); }[root@RHEL48-LTP-x86 async_handler]# gcc -c -g -O2
conftest.c[root@RHEL48-LTP-x86 async_handler]# echo $?
0
[root@RHEL48-LTP-x86 async_handler]# ll
total 40(quoted diff) +0
-7-rw-rw-r-- 1 root root 1045 Nov 12 02:19 Makefile -rw-rw-r-- 1 root root 5341 Nov 12 02:19 async_handler.c -rw-rw-r-- 1 root root 4485 Nov 12 02:19 async_handler_jk.c -rw-rw-r-- 1 root root 6013 Nov 12 02:19 async_handler_tsc.c -rw-r--r-- 1 root root 147 Nov 15 15:14 conftest.c -rw-r--r-- 1 root root 2596 Nov 16 16:24 conftest.o -rwxrwxr-x 1 root root 333 Nov 12 02:19 run_auto.sh[root@RHEL48-LTP-x86 async_handler]#
------------I tried build
async_handler.cwith "-c" option by manual operation according to "conftest.c", and it succeeded:
------------
[root@RHEL48-LTP-x86 async_handler]# gcc -c -g -O2 -fno-strict-aliasing(quoted diff) +0
-2-pipe -Wall -D_GNU_SOURCE -I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../include
-I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realt
ime/lib -L../../../../libasync_handler.c-lrealtime -lpthread -lrt
-lm -oasync_handlerQuoted 2 lines
In file included from async_handler.c:42:
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:In function `atomic_add':
Quoted 1 line
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:119: warning: implicit declaration of function `__sync_add_and_fetch'Quoted 23 lines
gcc: -lrealtime: linker input file unused because linking not done
gcc: -lpthread: linker input file unused because linking not done
gcc: -lrt: linker input file unused because linking not done
gcc: -lm: linker input file unused because linking not done [root@RHEL48-LTP-x86 async_handler]# echo $?
0
[root@RHEL48-LTP-x86 async_handler]# ll
total 56(quoted diff) +0
-8-rw-rw-r-- 1 root root 1045 Nov 12 02:19 Makefile -rw-r--r-- 1 root root 12612 Nov 16 16:27 async_handler -rw-rw-r-- 1 root root 5341 Nov 12 02:19 async_handler.c -rw-rw-r-- 1 root root 4485 Nov 12 02:19 async_handler_jk.c -rw-rw-r-- 1 root root 6013 Nov 12 02:19 async_handler_tsc.c -rw-r--r-- 1 root root 147 Nov 15 15:14 conftest.c -rw-r--r-- 1 root root 2596 Nov 16 16:24 conftest.o -rwxrwxr-x 1 root root 333 Nov 12 02:19 run_auto.sh[root@RHEL48-LTP-x86 async_handler]#
------------But above build is not with linkage by "-c" option.
With linkage, it failed:
------------
[root@RHEL48-LTP-x86 async_handler]# gcc -g -O2 -fno-strict-aliasing(quoted diff) +0
-2-pipe -Wall -D_GNU_SOURCE -I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../include
-I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realt
ime/lib -L../../../../libasync_handler.c-lrealtime -lpthread -lrt
-lm -oasync_handlerQuoted 2 lines
In file included from async_handler.c:42:
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:In function `atomic_add':
Quoted 1 line
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:119: warning: implicit declaration of function `__sync_add_and_fetch'Quoted 1 line
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/librealtime.a(libr ttest.o)(.text+0x1a7): In function `create_thread':
Quoted 1 line
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librttest.h:119: undefined reference to `__sync_add_and_fetch'Quoted 4 lines
collect2: ld returned 1 exit status
[root@RHEL48-LTP-x86 async_handler]#
------------
Quoted 7 lines
Quoted 2 lines
I think that the check of "
__sync_add_and_fetch" by "conftest.c" must be done without "-c" option.Please try out HEAD again. It should be fixed now (I substituted
AC_LINK_IFELSEforAC_TRY_COMPILE).
Thanks,
-Garrett
Thank you for your response.
I tried to build "realtime" tests with recent git "ltp-c23c351.tar.gz".
Build succeeded in RHEL5.5-x86 system.
But build failed in RHEL4.8-x86/x86_64/ia64 systems:
------------<RHEL4.8-x86>
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE -I/home/LTP/ltp-dev-2010
1116/testcases/realtime/include -I../../../../include -I../../../../include -L/home/LTP/
ltp-dev-20101116/testcases/realtime/lib -L../../../../lib testpi-4.c -lrealtime -lpthre
ad -lrt -lm -o testpi-4
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE -I/home/LTP/ltp-dev-2010
1116/testcases/realtime/include -I../../../../include -I../../../../include -L/home/LTP/
ltp-dev-20101116/testcases/realtime/lib -L../../../../lib testpi-5.c -lrealtime -lpthre
ad -lrt -lm -o testpi-5testpi-5.c: In function `do_test':
testpi-5.c:69: warning: unused variable `mutexattr'
testpi-5.c:70: warning: unused variable `retc'
testpi-5.c:70: warning: unused variable `protocol'
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE -I/home/LTP/ltp-dev-2010
1116/testcases/realtime/include -I../../../../include -I../../../../include -L/home/LTP/
ltp-dev-20101116/testcases/realtime/lib -L../../../../lib testpi-6.c -lrealtime -lpthre
ad -lrt -lm -o testpi-6testpi-6.c: In function `do_test':
testpi-6.c:75: warning: implicit declaration of function pthread_mutexattr_setrobust_np' testpi-6.c:75: error: PTHREAD_MUTEX_ROBUST_NP' undeclared (first use in this function) testpi-6.c:75: error: (Each undeclared identifier is reported only once testpi-6.c:75: error: for each function it appears in.)
testpi-6.c:79: warning: implicit declaration of function `pthread_mutexattr_getrobust_np' make[4]: *** [testpi-6] Error 1
make[4]: Leaving directory `/home/LTP/ltp-dev-20101116/testcases/realtime/func/pi-tests' make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/LTP/ltp-dev-20101116/testcases/realtime/func' make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/LTP/ltp-dev-20101116/testcases/realtime' make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/LTP/ltp-dev-20101116/testcases'
make: *** [testcases-all] Error 2
------------
The error of the "async_handler.c" by "__sync_add_and_fetch" until yesterday was solved.
However, a new failure about mutex occurs in another function.
I am investigating about it.
Perhaps.. perhaps, mutex is supported after kernel version 2.6.16, I think.
This is just a quick note to let you know.
Thank you--
-Tomonori Mitani
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 508 lines · Mitani
Quoted 454 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Wednesday, November 17, 2010 2:04 AM
To: Mitani
Cc: [email protected]
Subject: Re: [LTP] Realtime test failureQuoted 25 lines · Mitani
Quoted 25 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Tuesday, November 16, 2010 12:58 AM
To: Mitani
Cc: [email protected]
Subject: Re: [LTP] Realtime test failureQuoted 17 lines · Mitani
Quoted 17 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Monday, November 15, 2010 2:20 PM
To: Mitani
Cc: [email protected]; 當座 健市
Subject: Re: [LTP] Realtime test failure2010/11/14 Mitani <[email protected]>:
Quoted 7 lines
Quoted 7 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Monday, November 15, 2010 12:03 PM
To: Mitani
Subject: Re: [LTP] Realtime test failureOn Sun, Nov 14, 2010 at 6:54 PM, Mitani <[email protected]>
Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Hi,
"realtime" build failed in my system with git
"ltp-f388d33.tar.gz":
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 2 lines
------------<RHEL4.8 - x86>
make[2]: Entering directory`/home/LTP/ltp-dev-20101112/testcases/realtime'
Quoted 1 line
make -C lib -f
"
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/Makefile"Quoted 5 lines
all
make[3]: Entering directory `/home/LTP/ltp-dev-20101112/testcases/realtime/lib' gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE-I/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
-I../../../include -I../../../include -c -o librttest.o
librttest.cQuoted 3 lines
Quoted 3 lines
Quoted 2 lines
In file included from librttest.c:43:
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
st.h: InQuoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
st.h:119
Quoted 1 line
: warning: implicit declaration of function
`__sync_add_and_fetch'
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE
-I/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include
Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
-I../../../include -I../../../include -c -o libstats.o
libstats.cQuoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
In file included from libstats.c:47:
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
st.h: InQuoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
st.h:119
Quoted 1 line
: warning: implicit declaration of function
`__sync_add_and_fetch'
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
if [ -z "librttest.o libstats.o" ] ; then \
echo "Cowardly refusing to create empty archive"; \
exit 1; \
fi
ar -rc "librealtime.a" librttest.o libstats.oQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
ranlib "librealtime.a"
make[3]: Leaving directory/home/LTP/ltp-dev-20101112/testcases/realtime/lib' make[3]: Entering directory/home/LTP/ltp-dev-20101112/testcases/realtime/func' make[4]: Entering directory`/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler'
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Review
Quoted 4 lines
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE
(quoted diff) +0
-3-I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../include -I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realtime/lib-L../../../../lib
Quoted 1 line
async_handler.c-lrealtime -lpthread -lrt -lm -o
async_handlerQuoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
In file included from async_handler.c:42:
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
In
Quoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:11Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
9:
Quoted 1 line
warning: implicit declaration of function
`__sync_add_and_fetch'
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/librealtime.a(libr
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
ttest.o)
Quoted 2 lines
(.text+0x1a7): In function `create_thread':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
st.h:119
Quoted 5 lines
: undefined reference to `__sync_add_and_fetch'
collect2: ld returned 1 exit status
make[4]: *** [async_handler] Error 1
make[4]: Leaving directory`/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler'
Quoted 25 lines
Quoted 25 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/LTP/ltp-dev-20101112/testcases/realtime/func' make[2]: *** [all] Error 2
make[2]: Leaving directory`/home/LTP/ltp-dev-20101112/testcases/realtime'
Quoted 2 lines
make[1]: *** [all] Error 2
make[1]: Leaving directory`/home/LTP/ltp-dev-20101112/testcases'
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
make: *** [testcases-all] Error 2
------------"realtime" build failed in:
------------
RHEL4.8 -- x86,x86_64, ia64
RHEL5.4 -- x86
------------"realtime" build succeeded in:
------------
RHEL5.4 --x86_64, ia64
------------It is caused by "
__sync_add_and_fetch".Quoted 9 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
In following URL, "
__sync_add_and_fetch" is "built-in functionsfor
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
atomic memory access". And It is provided in "gcc":
http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Atomic-Builtins.html
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
There is "
__sync_add_and_fetch" in gcc4.1.2 (It is the gccof
Quoted 4 lines
Quoted 4 lines
RHEL5.1
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
-
Quoted 2 lines
RHEL5.4).
And there is not "__sync_add_and_fetch" in gcc3.4.6 (It isthe
Quoted 10 lines
Quoted 10 lines
gcc
Quoted 8 lines
Quoted 8 lines
of
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
RHEL4.8)
In addition, "
__sync_add_and_fetch" is for 64 bit environment.http://stackoverflow.com/questions/130740/link-error-when-compiling-
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
gcc-atom
Quoted 5 lines
ic-operation-in-32-bit-mode
http://gcc.gnu.org/wiki/Atomic
Perhaps, the judgment that "realtime" must be built or not
depends
Quoted 47 lines
Quoted 47 lines
Quoted 45 lines
Quoted 23 lines
on
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
gcc's version (> 4.0) and 64 bits environment, I think.
Could you please attach your testcases/realtime/config.log and
testcases/realtime/include/realtime_config.h? Thanks,
-GarrettQuoted 8 lines
I understood.
Thank you and sorry for my insufficient information.I attach following files:
- config.log (RHEL4.8-x86)
-realtime_config.h(RHEL4.8-x86)
- config.log (RHEL5.5-x86)
-realtime_config.h(RHEL5.5-x86)Could you please try compiling the following C sources in both scenarios?
Thanks,
-GarrettQuoted 8 lines
#ifndef
_GNU_SOURCE
#define_GNU_SOURCE
#endif
#include <stdlib.h>
int main(void) {
char *c;
return__sync_add_and_fetch(c, 1);
}I was going to compile the sent source in RHEL4.8/5.5-x86, but failed.
------------<RHEL4.8-x86>
[root@RHEL48-LTP-x86 async_handler]# catrealtime-test.c#ifndef_GNU_SOURCE
#define_GNU_SOURCE
#endif
#include <stdlib.h>
int main(void) {
char *c;
return__sync_add_and_fetch(c, 1); }Quoted 1 line
[root@RHEL48-LTP-x86 async_handler]# gcc
realtime-test.c-orealtime-test
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
/tmp/cciHVx8b.o(.text+0x25): In function `main':
: undefined reference to `__sync_add_and_fetch'
collect2: ld returned 1 exit status [root@RHEL48-LTP-x86 async_handler]# [root@RHEL48-LTP-x86 async_handler]# gcc -g -O2 -g -O2-fno-strict-aliasing -pipe -Wall -D
Quoted 1 line
_GNU_SOURCE-I/home/LTP/ltp-dev-20101112/testcases/realtime/includeQuoted 5 lines
Quoted 2 lines
-I../../../../include
-I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/re
Quoted 2 lines
altime/lib -L../../../..
Quoted 1 line
/lib realtime-test.c -lrealtime -lpthread -lrt -lm -o
realtime-test
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
realtime-test.c: In function `main':
realtime-test.c:7: warning: implicit declaration of function`__sync_add_and_fetch'
Quoted 1 line
realtime-test.c:6: warning: 'c' might be used uninitialized in this
function
Quoted 2 lines
/tmp/ccIDckLk.o(.text+0x10): In function `main':
/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler/reaQuoted 17 lines
Quoted 17 lines
ltime-test.c:7: undefined reference to `__sync_add_and_fetch'
Quoted 14 lines
collect2: ld returned 1 exit status
[root@RHEL48-LTP-x86 async_handler]#
------------------------<RHEL5.5-x86>
[root@RHEL55-LTP-x86 async_handler]# catrealtime-test.c#ifndef_GNU_SOURCE
#define_GNU_SOURCE
#endif
#include <stdlib.h>
int main(void) {
char *c;
return__sync_add_and_fetch(c, 1); }Quoted 1 line
[root@RHEL55-LTP-x86 async_handler]# gcc
realtime-test.c-orealtime-test
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
/tmp/ccK8hmPs.o: In function `main':
realtime-test.c:(.text+0x20): undefined reference to`__sync_add_and_fetch_1'
Quoted 2 lines
collect2: ld returned 1 exit status [root@RHEL55-LTP-x86 async_handler]# gcc -g -O2 -g -O2
-fno-strict-aliasing -pipe -Wall -D
Quoted 1 line
_GNU_SOURCE-I/home/LTP/ltp-dev-20101112/testcases/realtime/includeQuoted 5 lines
Quoted 2 lines
-I../../../../include
-I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/re
Quoted 2 lines
altime/lib -L../../../..
Quoted 1 line
/lib realtime-test.c -lrealtime -lpthread -lrt -lm -o
realtime-test
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
realtime-test.c: In function 'main':
realtime-test.c:7: warning: 'c' is used uninitialized in thisfunction
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
/tmp/ccKUnocB.o: In function `main':
/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler/reaQuoted 86 lines
Quoted 36 lines
ltime-test.c:7: undefined reference to `__sync_add_and_fetch_1'
Quoted 2 lines
collect2: ld returned 1 exit status
[root@RHEL55-LTP-x86 async_handler]#Not sure why but it incorrectly passed on your machine:
configure:5186: checking Checking for
__sync_add_and_fetchgcc builtin function
configure:5216: gcc -c -g -O2 conftest.c >&5 configure:5222: $? = 023
AC_MSG_CHECKING([Checking for __sync_add_and_fetch gcc builtin function])
24 AC_TRY_COMPILE([
25 #ifndef_GNU_SOURCE
26 #define_GNU_SOURCE
27 #endif
28 #include <stdlib.h>],[int main(void) {
29 char *c;
30 return__sync_add_and_fetch(c, 1);
31 }],[has___sync_add_and_fetch=yes])
32 if test "x$has___sync_add_and_fetch" = xyes; then
33 AC_DEFINE(HAVE___SYNC_ADD_AND_FETCH,1,[Define to 1 if you have the __sync_add_and_fetchgcc builtin function]) 34AC_MSG_RESULT(yes)
35 else
36AC_MSG_RESULT(no)
37 fiWhereas it didn't on mine:
248 configure:4777: checking Checking for
__sync_add_and_fetchgcc builtin funct ion
249 configure:4797: gcc -c -g -O2 conftest.c >&5
250 configure:4797: $? = 0Quoted 6 lines
There was a potential problem with the macro though (I keep on forgetting that
AC_TRY_COMPILEandAC_COMPILE_IFELSEwork predefinemain()with the block of code provided), so please let me know if things work for you.
Thanks,
-GarrettI attached same options by obeying "config.log".
And I confirmed that "conftest.c" could be successfully compiled by manual operation:
------------
[root@RHEL48-LTP-x86 async_handler]# pwd/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler[root@RHEL48-LTP-x86 async_handler]# ll
total 36(quoted diff) +0
-6-rw-rw-r-- 1 root root 1045 Nov 12 02:19 Makefile -rw-rw-r-- 1 root root 5341 Nov 12 02:19 async_handler.c -rw-rw-r-- 1 root root 4485 Nov 12 02:19 async_handler_jk.c -rw-rw-r-- 1 root root 6013 Nov 12 02:19 async_handler_tsc.c -rw-r--r-- 1 root root 147 Nov 15 15:14 conftest.c -rwxrwxr-x 1 root root 333 Nov 12 02:19 run_auto.sh[root@RHEL48-LTP-x86 async_handler]# cat
conftest.c#ifndef_GNU_SOURCE
#define_GNU_SOURCE
#endif
#include <stdlib.h>
int main(void) {
char *c;
return__sync_add_and_fetch(c, 1); }[root@RHEL48-LTP-x86 async_handler]# gcc -c -g -O2
conftest.c[root@RHEL48-LTP-x86 async_handler]# echo $?
0
[root@RHEL48-LTP-x86 async_handler]# ll
total 40(quoted diff) +0
-7-rw-rw-r-- 1 root root 1045 Nov 12 02:19 Makefile -rw-rw-r-- 1 root root 5341 Nov 12 02:19 async_handler.c -rw-rw-r-- 1 root root 4485 Nov 12 02:19 async_handler_jk.c -rw-rw-r-- 1 root root 6013 Nov 12 02:19 async_handler_tsc.c -rw-r--r-- 1 root root 147 Nov 15 15:14 conftest.c -rw-r--r-- 1 root root 2596 Nov 16 16:24 conftest.o -rwxrwxr-x 1 root root 333 Nov 12 02:19 run_auto.sh[root@RHEL48-LTP-x86 async_handler]#
------------I tried build
async_handler.cwith "-c" option by manual operation according to "conftest.c", and it succeeded:
------------
[root@RHEL48-LTP-x86 async_handler]# gcc -c -g -O2 -fno-strict-aliasing(quoted diff) +0
-2-pipe -Wall -D_GNU_SOURCE -I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../include
-I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realt ime/lib -L../../../../lib async_handler.c -lrealtime -lpthread -lrt -lm -oasync_handlerQuoted 2 lines
In file included from async_handler.c:42:
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:In function `atomic_add':
Quoted 1 line
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:119: warning: implicit declaration of function `__sync_add_and_fetch'Quoted 23 lines
gcc: -lrealtime: linker input file unused because linking not done
gcc: -lpthread: linker input file unused because linking not done
gcc: -lrt: linker input file unused because linking not done
gcc: -lm: linker input file unused because linking not done [root@RHEL48-LTP-x86 async_handler]# echo $?
0
[root@RHEL48-LTP-x86 async_handler]# ll
total 56(quoted diff) +0
-8-rw-rw-r-- 1 root root 1045 Nov 12 02:19 Makefile -rw-r--r-- 1 root root 12612 Nov 16 16:27 async_handler -rw-rw-r-- 1 root root 5341 Nov 12 02:19 async_handler.c -rw-rw-r-- 1 root root 4485 Nov 12 02:19 async_handler_jk.c -rw-rw-r-- 1 root root 6013 Nov 12 02:19 async_handler_tsc.c -rw-r--r-- 1 root root 147 Nov 15 15:14 conftest.c -rw-r--r-- 1 root root 2596 Nov 16 16:24 conftest.o -rwxrwxr-x 1 root root 333 Nov 12 02:19 run_auto.sh[root@RHEL48-LTP-x86 async_handler]#
------------But above build is not with linkage by "-c" option.
With linkage, it failed:
------------
[root@RHEL48-LTP-x86 async_handler]# gcc -g -O2 -fno-strict-aliasing(quoted diff) +0
-2-pipe -Wall -D_GNU_SOURCE -I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../include
-I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realt ime/lib -L../../../../lib async_handler.c -lrealtime -lpthread -lrt -lm -oasync_handlerQuoted 2 lines
In file included from async_handler.c:42:
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:In function `atomic_add':
Quoted 1 line
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:119: warning: implicit declaration of function `__sync_add_and_fetch'Quoted 1 line
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/librealtime.a(libr ttest.o)(.text+0x1a7): In function `create_thread':
Quoted 1 line
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librttest.h:119: undefined reference to `__sync_add_and_fetch'Quoted 4 lines
collect2: ld returned 1 exit status
[root@RHEL48-LTP-x86 async_handler]#
------------Quoted 7 lines
Quoted 2 lines
I think that the check of "
__sync_add_and_fetch" by "conftest.c" must be done without "-c" option.Please try out HEAD again. It should be fixed now (I substituted
AC_LINK_IFELSEforAC_TRY_COMPILE).
Thanks,
-GarrettThank you for your response.
I tried to build "realtime" tests with recent git "ltp-c23c351.tar.gz".
Build succeeded in RHEL5.5-x86 system.
But build failed in RHEL4.8-x86/x86_64/ia64 systems:
------------<RHEL4.8-x86>
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE -I/home/LTP/ltp-dev-2010 1116/testcases/realtime/include -I../../../../include -I../../../../include -L/home/LTP/ ltp-dev-20101116/testcases/realtime/lib -L../../../../lib testpi-4.c -lrealtime -lpthre ad -lrt -lm -o testpi-4
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE -I/home/LTP/ltp-dev-2010 1116/testcases/realtime/include -I../../../../include -I../../../../include -L/home/LTP/ ltp-dev-20101116/testcases/realtime/lib -L../../../../lib testpi-5.c -lrealtime -lpthre ad -lrt -lm -o testpi-5testpi-5.c: In function `do_test':
testpi-5.c:69: warning: unused variable `mutexattr'
testpi-5.c:70: warning: unused variable `retc'
testpi-5.c:70: warning: unused variable `protocol'
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -D_GNU_SOURCE -I/home/LTP/ltp-dev-2010 1116/testcases/realtime/include -I../../../../include -I../../../../include -L/home/LTP/ ltp-dev-20101116/testcases/realtime/lib -L../../../../lib testpi-6.c -lrealtime -lpthre ad -lrt -lm -o testpi-6testpi-6.c: In function `do_test':
testpi-6.c:75: warning: implicit declaration of functionpthread_mutexattr_setrobust_np' testpi-6.c:75: error:PTHREAD_MUTEX_ROBUST_NP' undeclared (first use in this function) testpi-6.c:75: error: (Each undeclared identifier is reported only once testpi-6.c:75: error: for each function it appears in.)
testpi-6.c:79: warning: implicit declaration of function `pthread_mutexattr_getrobust_np' make[4]: *** [testpi-6] Error 1
make[4]: Leaving directory `/home/LTP/ltp-dev-20101116/testcases/realtime/func/pi-tests' make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/LTP/ltp-dev-20101116/testcases/realtime/func' make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/LTP/ltp-dev-20101116/testcases/realtime' make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/LTP/ltp-dev-20101116/testcases'
make: *** [testcases-all] Error 2
------------The error of the "
async_handler.c" by "__sync_add_and_fetch" until yesterday was solved.
However, a new failure about mutex occurs in another function.
Quoted 5 lines
I am investigating about it.
Perhaps.. perhaps, mutex is supported after kernel version 2.6.16, I think.This is just a quick note to let you know.
Lol. Please try again.
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 576 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Wednesday, November 17, 2010 12:17 PM
To: Mitani
Cc: [email protected]
Subject: Re: [LTP] Realtime test failureQuoted 36 lines · Mitani
Quoted 36 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Wednesday, November 17, 2010 2:04 AM
To: Mitani
Cc: [email protected]
Subject: Re: [LTP] Realtime test failureQuoted 25 lines · Mitani
Quoted 25 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Tuesday, November 16, 2010 12:58 AM
To: Mitani
Cc: [email protected]
Subject: Re: [LTP] Realtime test failureQuoted 17 lines · Mitani
Quoted 17 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Monday, November 15, 2010 2:20 PM
To: Mitani
Cc: [email protected]; 當座 健市
Subject: Re: [LTP] Realtime test failure2010/11/14 Mitani <[email protected]>:
Quoted 7 lines
Quoted 7 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Monday, November 15, 2010 12:03 PM
To: Mitani
Subject: Re: [LTP] Realtime test failureOn Sun, Nov 14, 2010 at 6:54 PM, Mitani <[email protected]>
Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Hi,
Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"realtime" build failed in my system with git
"ltp-f388d33.tar.gz":
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
------------<RHEL4.8 - x86>
make[2]: Entering directory`/home/LTP/ltp-dev-20101112/testcases/realtime'
Quoted 1 line
make -C lib -f
"
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/Makefile"Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
all
make[3]: Entering directory `/home/LTP/ltp-dev-20101112/testcases/realtime/lib' gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall-D_GNU_SOURCE
Quoted 10 lines
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
-I/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
-I../../../include -I../../../include -c -o librttest.o
librttest.cQuoted 3 lines
Quoted 3 lines
Quoted 2 lines
In file included from librttest.c:43:
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
st.h: InQuoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 4 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
st.h:119
Quoted 1 line
: warning: implicit declaration of function
`__sync_add_and_fetch'
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall
-D_GNU_SOURCE
Quoted 10 lines
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
-I/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include
Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
-I../../../include -I../../../include -c -o libstats.o
libstats.cQuoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
In file included from libstats.c:47:
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
st.h: InQuoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 5 lines
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
st.h:119
Quoted 1 line
: warning: implicit declaration of function
`__sync_add_and_fetch'
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
if [ -z "librttest.o libstats.o" ] ; then \ echo "Cowardly refusing to create empty archive";\
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
exit 1; \fi
ar -rc "librealtime.a" librttest.o libstats.o ranlib "librealtime.a"
make[3]: Leaving directory/home/LTP/ltp-dev-20101112/testcases/realtime/lib' make[3]: Entering directory/home/LTP/ltp-dev-20101112/testcases/realtime/func' make[4]: Entering directoryQuoted 2 lines
Quoted 2 lines
`/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler'
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall
-D_GNU_SOURCE
Quoted 9 lines
Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Review
Quoted 3 lines
(quoted diff) +0
-3-I/home/LTP/ltp-dev-20101112/testcases/realtime/include -I../../../../include -I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realtime/lib-L../../../../lib
Quoted 1 line
async_handler.c-lrealtime -lpthread -lrt -lm -o
async_handlerQuoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
In file included from async_handler.c:42:
Quoted 8 lines
Quoted 8 lines
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
In
Quoted 2 lines
function `atomic_add':
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:11Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
9:
Quoted 1 line
warning: implicit declaration of function
`__sync_add_and_fetch'
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/librealtime.a(libr
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
ttest.o)
Quoted 2 lines
(.text+0x1a7): In function `create_thread':
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 26 lines
Quoted 26 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
st.h:119
Quoted 5 lines
: undefined reference to `__sync_add_and_fetch'
collect2: ld returned 1 exit status
make[4]: *** [async_handler] Error 1
make[4]: Leaving directory`/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler'
Quoted 18 lines
Quoted 18 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/LTP/ltp-dev-20101112/testcases/realtime/func' make[2]: *** [all] Error 2
make[2]: Leaving directory`/home/LTP/ltp-dev-20101112/testcases/realtime'
Quoted 2 lines
make[1]: *** [all] Error 2
make[1]: Leaving directory`/home/LTP/ltp-dev-20101112/testcases'
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
make: *** [testcases-all] Error 2
------------"realtime" build failed in:
------------
RHEL4.8 -- x86,x86_64, ia64
RHEL5.4 -- x86
------------Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
"realtime" build succeeded in:
------------
RHEL5.4 --x86_64, ia64
------------It is caused by "
__sync_add_and_fetch".In following URL, "
__sync_add_and_fetch" is "built-infunctions
Quoted 14 lines
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
for
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
atomic memory access". And It is provided in "gcc":
http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Atomic-Builtins.html
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
There is "
__sync_add_and_fetch" in gcc4.1.2 (It is the gccof
Quoted 4 lines
Quoted 4 lines
RHEL5.1
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
-
Quoted 2 lines
RHEL5.4).
And there is not "__sync_add_and_fetch" in gcc3.4.6 (Itis
Quoted 5 lines
Quoted 5 lines
the
Quoted 4 lines
Quoted 4 lines
gcc
Quoted 3 lines
Quoted 3 lines
of
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
RHEL4.8)
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
In addition, "
__sync_add_and_fetch" is for 64 bit environment.http://stackoverflow.com/questions/130740/link-error-when-compiling-
Quoted 11 lines
Quoted 11 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
gcc-atom
Quoted 5 lines
ic-operation-in-32-bit-mode
http://gcc.gnu.org/wiki/Atomic
Perhaps, the judgment that "realtime" must be built or not
depends
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
on
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
gcc's version (> 4.0) and 64 bits environment, I think.
Could you please attach your testcases/realtime/config.log
and
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
testcases/realtime/include/realtime_config.h?
Thanks,
-GarrettI understood.
Thank you and sorry for my insufficient information.Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
I attach following files:
- config.log (RHEL4.8-x86)
-realtime_config.h(RHEL4.8-x86)
- config.log (RHEL5.5-x86)
-realtime_config.h(RHEL5.5-x86)Could you please try compiling the following C sources in
both
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 12 lines
scenarios?
Thanks,
-Garrett#ifndef
_GNU_SOURCE
#define_GNU_SOURCE
#endif
#include <stdlib.h>int main(void) { char *c; return __sync_add_and_fetch(c, 1); }Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
I was going to compile the sent source in RHEL4.8/5.5-x86, but
failed.
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 7 lines
------------<RHEL4.8-x86>
[root@RHEL48-LTP-x86 async_handler]# catrealtime-test.c#ifndef_GNU_SOURCE
#define_GNU_SOURCE
#endif
#include <stdlib.h>Quoted 5 lines
int main(void) { char *c; return __sync_add_and_fetch(c, 1); }[root@RHEL48-LTP-x86 async_handler]# gcc
realtime-test.c-orealtime-test
Quoted 5 lines
/tmp/cciHVx8b.o(.text+0x25): In function `main':
: undefined reference to `__sync_add_and_fetch'
collect2: ld returned 1 exit status [root@RHEL48-LTP-x86 async_handler]# [root@RHEL48-LTP-x86 async_handler]# gcc -g -O2 -g -O2Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
-fno-strict-aliasing -pipe -Wall -D
Quoted 1 line
_GNU_SOURCE-I/home/LTP/ltp-dev-20101112/testcases/realtime/includeQuoted 11 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
-I../../../../include
-I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/re
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
altime/lib -L../../../..
Quoted 1 line
/lib
realtime-test.c-lrealtime -lpthread -lrt -lm -orealtime-test
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
realtime-test.c: In function `main':
realtime-test.c:7: warning: implicit declaration of function`__sync_add_and_fetch'
Quoted 1 line
realtime-test.c:6: warning: 'c' might be used uninitialized in
this
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
function
Quoted 2 lines
/tmp/ccIDckLk.o(.text+0x10): In function `main':
/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler/reaQuoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
ltime-test.c:7: undefined reference to `__sync_add_and_fetch'
Quoted 10 lines
collect2: ld returned 1 exit status
[root@RHEL48-LTP-x86 async_handler]#
------------------------<RHEL5.5-x86>
[root@RHEL55-LTP-x86 async_handler]# catrealtime-test.c#ifndef_GNU_SOURCE
#define_GNU_SOURCE
#endif
#include <stdlib.h>Quoted 5 lines
int main(void) { char *c; return __sync_add_and_fetch(c, 1); }[root@RHEL55-LTP-x86 async_handler]# gcc
realtime-test.c-orealtime-test
Quoted 2 lines
/tmp/ccK8hmPs.o: In function `main':
realtime-test.c:(.text+0x20): undefined reference toQuoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
`__sync_add_and_fetch_1'
Quoted 2 lines
collect2: ld returned 1 exit status [root@RHEL55-LTP-x86 async_handler]# gcc -g -O2 -g -O2
-fno-strict-aliasing -pipe -Wall -D
Quoted 1 line
_GNU_SOURCE-I/home/LTP/ltp-dev-20101112/testcases/realtime/includeQuoted 14 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
-I../../../../include
-I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/re
Quoted 10 lines
Quoted 2 lines
Quoted 2 lines
altime/lib -L../../../..
Quoted 1 line
/lib
realtime-test.c-lrealtime -lpthread -lrt -lm -orealtime-test
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
realtime-test.c: In function 'main':
realtime-test.c:7: warning: 'c' is used uninitialized in thisfunction
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
/tmp/ccKUnocB.o: In function `main':
/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler/reaQuoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
ltime-test.c:7: undefined reference to `__sync_add_and_fetch_1'
Quoted 2 lines
collect2: ld returned 1 exit status
[root@RHEL55-LTP-x86 async_handler]#Not sure why but it incorrectly passed on your machine:
configure:5186: checking Checking for
__sync_add_and_fetchgccbuiltin
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
function
configure:5216: gcc -c -g -O2conftest.c>&5
configure:5222: $? = 0Quoted 12 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
23
AC_MSG_CHECKING([Checking for __sync_add_and_fetch gcc builtin function])
24 AC_TRY_COMPILE([
25 #ifndef_GNU_SOURCEQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
26 #define
_GNU_SOURCE
27 #endif
28 #include <stdlib.h>],[int main(void) {
29 char *c;
30 return__sync_add_and_fetch(c, 1);
31 }],[has___sync_add_and_fetch=yes])
32 if test "x$has___sync_add_and_fetch" = xyes; then
33 AC_DEFINE(HAVE___SYNC_ADD_AND_FETCH,1,[Define to 1 ifyou
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
have the __
sync_add_and_fetchgcc builtin function])
34AC_MSG_RESULT(yes)
35 else
36AC_MSG_RESULT(no)
37 fiQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Whereas it didn't on mine:
248 configure:4777: checking Checking for
__sync_add_and_fetchgcc
builtin funct ion
249 configure:4797: gcc -c -g -O2conftest.c>&5
250 configure:4797: $? = 0There was a potential problem with the macro though (I keep
on
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 5 lines
forgetting that
AC_TRY_COMPILEandAC_COMPILE_IFELSEwork predefinemain()with the block of code provided), so please let me know if things work for you.
Thanks,
-GarrettI attached same options by obeying "config.log".
And I confirmed that "conftest.c" could be successfully compiledby
Quoted 36 lines
Quoted 36 lines
Quoted 36 lines
manual operation:
------------
[root@RHEL48-LTP-x86 async_handler]# pwd/home/LTP/ltp-dev-20101112/testcases/realtime/func/async_handler[root@RHEL48-LTP-x86 async_handler]# ll
total 36(quoted diff) +0
-6-rw-rw-r-- 1 root root 1045 Nov 12 02:19 Makefile -rw-rw-r-- 1 root root 5341 Nov 12 02:19 async_handler.c -rw-rw-r-- 1 root root 4485 Nov 12 02:19 async_handler_jk.c -rw-rw-r-- 1 root root 6013 Nov 12 02:19 async_handler_tsc.c -rw-r--r-- 1 root root 147 Nov 15 15:14 conftest.c -rwxrwxr-x 1 root root 333 Nov 12 02:19 run_auto.sh[root@RHEL48-LTP-x86 async_handler]# cat
conftest.c#ifndef_GNU_SOURCE
#define_GNU_SOURCE
#endif
#include <stdlib.h>int main(void) { char *c; return __sync_add_and_fetch(c, 1); }[root@RHEL48-LTP-x86 async_handler]# gcc -c -g -O2
conftest.c[root@RHEL48-LTP-x86 async_handler]# echo $?
0
[root@RHEL48-LTP-x86 async_handler]# ll
total 40(quoted diff) +0
-7-rw-rw-r-- 1 root root 1045 Nov 12 02:19 Makefile -rw-rw-r-- 1 root root 5341 Nov 12 02:19 async_handler.c -rw-rw-r-- 1 root root 4485 Nov 12 02:19 async_handler_jk.c -rw-rw-r-- 1 root root 6013 Nov 12 02:19 async_handler_tsc.c -rw-r--r-- 1 root root 147 Nov 15 15:14 conftest.c -rw-r--r-- 1 root root 2596 Nov 16 16:24 conftest.o -rwxrwxr-x 1 root root 333 Nov 12 02:19 run_auto.sh[root@RHEL48-LTP-x86 async_handler]#
------------Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
I tried build
async_handler.cwith "-c" option by manual operation according to "conftest.c", and it succeeded:
------------
[root@RHEL48-LTP-x86 async_handler]# gcc -c -g -O2-fno-strict-aliasing
Quoted 2 lines
Quoted 2 lines
-pipe -Wall
-D_GNU_SOURCE -I/home/LTP/ltp-dev-20101112/testcases/realtime/inclu
Quoted 2 lines
Quoted 2 lines
de -I../../../../include
-I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realt
Quoted 1 line
Quoted 1 line
ime/lib -L../../../../lib
async_handler.c-lrealtime -lpthread-lrt
Quoted 3 lines
Quoted 3 lines
-lm -o
async_handlerQuoted 2 lines
In file included from async_handler.c:42:
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:Quoted 3 lines
Quoted 3 lines
In function `atomic_add':
Quoted 1 line
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:11Quoted 20 lines
Quoted 20 lines
9: warning: implicit declaration of function `__sync_add_and_fetch'
Quoted 19 lines
gcc: -lrealtime: linker input file unused because linking not done
gcc: -lpthread: linker input file unused because linking not done
gcc: -lrt: linker input file unused because linking not done
gcc: -lm: linker input file unused because linking not done [root@RHEL48-LTP-x86 async_handler]# echo $?
0
[root@RHEL48-LTP-x86 async_handler]# ll
total 56(quoted diff) +0
-8-rw-rw-r-- 1 root root 1045 Nov 12 02:19 Makefile -rw-r--r-- 1 root root 12612 Nov 16 16:27 async_handler -rw-rw-r-- 1 root root 5341 Nov 12 02:19 async_handler.c -rw-rw-r-- 1 root root 4485 Nov 12 02:19 async_handler_jk.c -rw-rw-r-- 1 root root 6013 Nov 12 02:19 async_handler_tsc.c -rw-r--r-- 1 root root 147 Nov 15 15:14 conftest.c -rw-r--r-- 1 root root 2596 Nov 16 16:24 conftest.o -rwxrwxr-x 1 root root 333 Nov 12 02:19 run_auto.sh[root@RHEL48-LTP-x86 async_handler]#
------------Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
But above build is not with linkage by "-c" option.
With linkage, it failed:
------------
[root@RHEL48-LTP-x86 async_handler]# gcc -g -O2 -fno-strict-aliasing-pipe -Wall
-D_GNU_SOURCE -I/home/LTP/ltp-dev-20101112/testcases/realtime/inclu
Quoted 2 lines
Quoted 2 lines
de -I../../../../include
-I../../../../include -L/home/LTP/ltp-dev-20101112/testcases/realt
Quoted 1 line
Quoted 1 line
ime/lib -L../../../../lib
async_handler.c-lrealtime -lpthread-lrt
Quoted 3 lines
Quoted 3 lines
-lm -o
async_handlerQuoted 2 lines
In file included from async_handler.c:42:
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:Quoted 3 lines
Quoted 3 lines
In function `atomic_add':
Quoted 1 line
/home/LTP/ltp-dev-20101112/testcases/realtime/include/librttest.h:11Quoted 3 lines
Quoted 3 lines
9: warning: implicit declaration of function `__sync_add_and_fetch'
Quoted 1 line
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/librealtime.a(libr
Quoted 3 lines
Quoted 3 lines
ttest.o)(.text+0x1a7): In function `create_thread':
Quoted 1 line
/home/LTP/ltp-dev-20101112/testcases/realtime/lib/../include/librtteQuoted 6 lines
Quoted 6 lines
st.h:119: undefined reference to `__sync_add_and_fetch'
Quoted 5 lines
collect2: ld returned 1 exit status
[root@RHEL48-LTP-x86 async_handler]#
------------I think that the check of "
__sync_add_and_fetch" by "conftest.c"must
Quoted 10 lines
Quoted 6 lines
Quoted 1 line
be done without "-c" option.
Please try out HEAD again. It should be fixed now (I substituted
AC_LINK_IFELSEforAC_TRY_COMPILE).
Thanks,
-GarrettThank you for your response.
Quoted 7 lines
I tried to build "realtime" tests with recent git "ltp-c23c351.tar.gz".
Build succeeded in RHEL5.5-x86 system.
But build failed in RHEL4.8-x86/x86_64/ia64 systems:
------------<RHEL4.8-x86>
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall-D_GNU_SOURCE -I/home/LTP/ltp-dev-2010
Quoted 1 line
1116/testcases/realtime/include -I../../../../include
-I../../../../include -L/home/LTP/
Quoted 1 line
ltp-dev-20101116/testcases/realtime/lib
-L../../../../lib
testpi-4.c-lrealtime -lpthreQuoted 2 lines
ad -lrt -lm -o testpi-4
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall-D_GNU_SOURCE -I/home/LTP/ltp-dev-2010
Quoted 1 line
1116/testcases/realtime/include -I../../../../include
-I../../../../include -L/home/LTP/
Quoted 1 line
ltp-dev-20101116/testcases/realtime/lib
-L../../../../lib
testpi-5.c-lrealtime -lpthreQuoted 6 lines
ad -lrt -lm -o testpi-5
testpi-5.c: In function `do_test':
testpi-5.c:69: warning: unused variablemutexattr' testpi-5.c:70: warning: unused variableretc' testpi-5.c:70: warning: unused variable `protocol' gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall-D_GNU_SOURCE -I/home/LTP/ltp-dev-2010
Quoted 1 line
1116/testcases/realtime/include -I../../../../include
-I../../../../include -L/home/LTP/
Quoted 1 line
ltp-dev-20101116/testcases/realtime/lib
-L../../../../lib
testpi-6.c-lrealtime -lpthreQuoted 3 lines
ad -lrt -lm -o testpi-6
testpi-6.c: In function `do_test':
testpi-6.c:75: warning: implicit declaration of function`pthread_mutexattr_setrobust_np'
Quoted 1 line
testpi-6.c:75: error: `PTHREAD_MUTEX_ROBUST_NP' undeclared (first use
in this function)
Quoted 3 lines
testpi-6.c:75: error: (Each undeclared identifier is reported only once testpi-6.c:75: error: for each function it appears in.) testpi-6.c:79: warning: implicit declaration of function
`pthread_mutexattr_getrobust_np'
Quoted 2 lines
make[4]: *** [testpi-6] Error 1
make[4]: Leaving directory`/home/LTP/ltp-dev-20101116/testcases/realtime/func/pi-tests'
Quoted 2 lines
make[3]: *** [all] Error 2
make[3]: Leaving directory`/home/LTP/ltp-dev-20101116/testcases/realtime/func'
Quoted 2 lines
make[2]: *** [all] Error 2
make[2]: Leaving directory`/home/LTP/ltp-dev-20101116/testcases/realtime'
Quoted 6 lines
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/LTP/ltp-dev-20101116/testcases'
make: *** [testcases-all] Error 2
------------The error of the "
async_handler.c" by "__sync_add_and_fetch" untilyesterday
Quoted 3 lines
was solved.
However, a new failure about mutex occurs in another function.
Quoted 8 lines
Quoted 2 lines
I am investigating about it.
Perhaps.. perhaps, mutex is supported after kernel version 2.6.16, Ithink.
Quoted 3 lines
This is just a quick note to let you know.
Lol. Please try again.
Thank you for your response.
I tried to build with "ltp-66d67b5.tar.gz", but it failed in configure. Therefore, I tried with older git "ltp-92dfd5b.tar.gz", and it succeeded in RHEL5.5-x86 and RHEL4.8-x86 systems.
From "ltp-92dfd5b.tar.gz" to "ltp-66d67b5.tar.gz", new probrem occured.
New revisions are released in sequence. Therefore I intend to build with the latest version again.
Thank you--
-Tomonori Mitani
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 10 lines
Thank you for your response.
I tried to build with "ltp-66d67b5.tar.gz", but it failed in configure. Therefore, I tried with older git "ltp-92dfd5b.tar.gz", and it succeeded in RHEL5.5-x86 and RHEL4.8-x86 systems.
From "ltp-92dfd5b.tar.gz" to "ltp-66d67b5.tar.gz", new probrem occured.
New revisions are released in sequence. Therefore I intend to build with the latest version again.
Huh...? What do you mean failed in configure? Logs please (PS the latest snapshot is different from that)!
Thanks,
-Garrett
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 15 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Thursday, November 18, 2010 9:30 AM
To: Mitani
Cc: [email protected]
Subject: Re: [LTP] Realtime test failureQuoted 8 lines
Thank you for your response.
I tried to build with "ltp-66d67b5.tar.gz", but it failed in configure. Therefore, I tried with older git "ltp-92dfd5b.tar.gz", and it succeeded in RHEL5.5-x86 and RHEL4.8-x86 systems.
From "ltp-92dfd5b.tar.gz" to "ltp-66d67b5.tar.gz", new probrem occured.
Quoted 7 lines
Quoted 2 lines
New revisions are released in sequence. Therefore I intend to build with the latest version again.
Huh...? What do you mean failed in configure? Logs please (PS the latest snapshot is different from that)!
Thanks,
-Garrett
I send configure's logs.
I tried with "ltp-92dfd5b.tar.gz", "ltp-66d67b5.tar.gz" and "ltp-86209d2.tar.gz".
Only "ltp-92dfd5b.tar.gz" succeeded.
Quoted 1 line
the latest snapshot is different from that
Yes. latest snapshot is "ltp-86209d2.tar.gz". But it failed, too. I send two logs just in case.
- ltp-86209d2_configure.txt --- result of "ltp-86209d2.tar.gz"
- ltp-66d67b5_configure.txt --- result of "ltp-66d67b5.tar.gz"
Thank you--
-Tomonori Mitani
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 18 lines
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Thursday, November 18, 2010 9:30 AM
To: Mitani
Cc: [email protected]
Subject: Re: [LTP] Realtime test failureQuoted 3 lines
Thank you for your response.
I tried to build with "ltp-66d67b5.tar.gz", but it failed in
configure.
Quoted 1 line
Therefore, I tried with older git "ltp-92dfd5b.tar.gz", and it
succeeded
Quoted 3 lines
in RHEL5.5-x86 and RHEL4.8-x86 systems.
From "ltp-92dfd5b.tar.gz" to "ltp-66d67b5.tar.gz", new probrem
occured.
Quoted 1 line
Quoted 7 lines
Quoted 2 lines
New revisions are released in sequence. Therefore I intend to build with the latest version again.
Huh...? What do you mean failed in configure? Logs please (PS the latest snapshot is different from that)!
Thanks,
-Garrett
"configure" failed with git "ltp-86209d2.tar.gz":
------------
./configure: line 8228: syntax error near unexpected token elif' ./configure: line 8228: elif test "x$has_quotav2" = "xyes"; then'
------------
(Detail log information is in my yesterday's email)
Environmants are RHEL5.5/4.8 -- x86/x86_64/ia64.
"${LTPROOT}/configure" file of "ltp-86209d2.tar.gz" is following:
------------< RHEL4.8 - x86>
[...]
8204 done
8205
8206 cat >conftest.$ac_ext <<_ACEOF
8207 /* confdefs.h. */
8208 _ACEOF
8209 cat confdefs.h >>conftest.$ac_ext
8210 cat >>conftest.$ac_ext <<_ACEOF
8211 /* end confdefs.h. */
8212
8213 #define _LINUX_QUOTA_VERSION 2
8214 #include <sys/types.h>
8215 #include <sys/quota.h>
8216 #include <unistd.h>
8217 int main(void) { 8218 struct dqblk dq;
8219 return quotactl(QCMD(Q_GETINFO, USRQUOTA), (const char *)
"/dev/null",
8220 geteuid(), (caddr_t) &dq);
8221 }
8222 if test "x$has_quotav1" = "xyes"; then
8223
8224 cat >>confdefs.h <<\_ACEOF
8225 #define HAVE_QUOTAV1 1
8226 _ACEOF
8227
8228 elif test "x$has_quotav2" = "xyes"; then
8229
8230 cat >>confdefs.h <<\_ACEOF
8231 #define HAVE_QUOTAV2 1
8232 _ACEOF
8233
8234 fi
8235
8236 _ACEOF
8237 rm -f conftest.$ac_objext conftest$ac_exeext
8238 if { (ac_try="$ac_link"[...]
------------
The line 8210 (" 8210 cat >>conftest.$ac_ext <<_ACEOF") is the "here document".
First "_ACEOF" which appears after this line is the line 8224. But the line 8224 is "here document", too.
I think that it is syntax error.
In the line 8236, there is "_ACEOF".
This "_ACEOF" may be just after line 8221, I think.
I tried to execute "configure" after above revision, and it succeeded. After this, "make" and "make install" succeeded, too.
Regards--
-Tomonori Mitani
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list