Version: 1.3.4 (using KDE KDE 3.4.3) Installed from: RedHat RPMs Compiler: gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5) redhat 9, redhat enterprise 3 OS: Linux Perhaps a kernel-2.4.x thing? if g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../../amarok/src/amarokcore -I../../amarok/src/amarokcore -I../../amarok/src/analyzers -I../../amarok/src/engine -I../../amarok/src/plugin -I../../amarok/src/statusbar -I/usr/include/kde/arts -I/usr/include/taglib -I../../amarok/src/sqlite -I/usr/include/kde -I/usr/lib/qt-3.3/include -I/usr/X11R6/include -DQT_THREAD_SUPPORT -D_REENTRANT -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -DNDEBUG -DNO_DEBUG -O2 -O2 -march=i386 -mcpu=i686 -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -MT app.o -MD -MP -MF ".deps/app.Tpo" -c -o app.o ap p.cpp; \ then mv -f ".deps/app.Tpo" ".deps/app.Po"; else rm -f ".deps/app.Tpo"; exit 1; fi app.cpp: In member function `void App::fixHyperThreading()': app.cpp:408: `cpu_set_t' undeclared (first use this function) app.cpp:408: (Each undeclared identifier is reported only once for each function it appears in.) app.cpp:408: parse error before `;' token app.cpp:409: `mask' undeclared (first use this function) app.cpp:409: `CPU_ZERO' undeclared (first use this function) app.cpp:410: `CPU_SET' undeclared (first use this function)
$rpm -q glibc glibc-2.3.2-27.9.7.2.legacy
ON rhel3, build fails similarly: (but at leaste CPU_ZERO/CPU_SET is defined) glibc-2.3.2-95.33 make[1]: Entering directory `/home/rdieter/BUILD/amarok-1.3.4/amarok/src' if g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../../amarok/src/amarokcore -I../../amarok/src/amarokcore -I../../amarok/src/analyzers -I../../amarok/src/engine -I../../amarok/src/plugin -I../../amarok/src/statusbar -I/usr/include/kde/arts -I/usr/include/taglib -I../../amarok/src/sqlite -I/usr/include/kde -I/usr/lib/qt-3.3/include -I/usr/X11R6/include -DQT_THREAD_SUPPORT -D_REENTRANT -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -DNDEBUG -DNO_DEBUG -O2 -O2 -pipe -march=i386 -mcpu=i686 -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -MT app.o -MD -MP -MF ".deps/app.Tpo" -c -o app.o app.cpp; \ then mv -f ".deps/app.Tpo" ".deps/app.Po"; else rm -f ".deps/app.Tpo"; exit 1; fi app.cpp: In member function `void App::fixHyperThreading()': app.cpp:412: invalid conversion from `unsigned int' to `const cpu_set_t*' /usr/include/sched.h:77: too many arguments to function `int sched_setaffinity(int, const cpu_set_t*)' app.cpp:412: at this point in file
ON rhel3, sched_setaffinity accepts 2 arguments, from /usr/include/sched.h: /* Set the CPU affinity for a task */ extern int sched_setaffinity (__pid_t __pid, __const cpu_set_t *__mask) __THROW;
Looks like a broken test for set_affinity. test.c contains (stolen from configure): #include <sched.h> int main () { cpu_set_t mask; CPU_ZERO( &mask ); CPU_SET( 0, &mask ); sched_setaffinity( 0, sizeof(mask), &mask ); return 0; } The test seemingly passes using gcc: gcc -c -std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -DNDEBUG -O2 -O2 -pipe -march=i386 -mcpu=i686 -Wformat-security -D_BSD_SOURCE test.c test.c: In function `main': test.c:6: warning: implicit declaration of function `CPU_ZERO' test.c:7: warning: implicit declaration of function `CPU_SET' test.c:8: warning: implicit declaration of function `sched_setaffinity' Not sure about the implicit declaration but not when using g++, $ g++ -c -std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wformat-security -D_BSD_SOURCE test.c test.c: In function `int main()': test.c:8: invalid conversion from `unsigned int' to `const cpu_set_t*' /usr/include/sched.h:77: too many arguments to function `int sched_setaffinity(int, const cpu_set_t*)' test.c:8: at this point in file
Turns out the affinity test fails to with gcc, but only if _GNU_SOURCE is defined. OK, so my workaround will simply be to add -D_GNU_SOURCE to CFLAGS and CXXFLAGS.
Created attachment 13149 [details] fix configure's sched_setaffinity check add #define _GNU_SOURCE to sched_setaffinity check.
These are two unrelated issues. The second issue (on rhel3) is solved in amaroK 1.3.5, which was released today. First issue we don't have a solution for at this point. Must be a rare glibc version.
sched_setaffinity confirmed fixed in 1.3.5
back to original CPU_ZERO/CPU_SET undefined issue, still present in 1.3.5
Created attachment 13150 [details] CPU_SET/CPU_ZERO fix add checks for CPU_SET/CPU_ZERO: defined(CPU_ZERO) && defined(CPU_SET) before calling them.
SVN commit 474112 by markey: Fix build issue on some Linux kernel 2.4 distros. (BR 115068) Patch by Rex Dieter <rdieter@math.unl.edu> BUG: 115068 M +5 -0 ChangeLog M +3 -3 src/app.cpp --- trunk/extragear/multimedia/amarok/ChangeLog #474111:474112 @@ -21,6 +21,11 @@ of each song until amaroK is restarted. +VERSION 1.3.6: + BUGFIXES: + * Fix build issue on some Linux kernel 2.4 distros. (BR 115068) + + VERSION 1.3.5: BUGFIXES: * Fixed a build issue. --- trunk/extragear/multimedia/amarok/src/app.cpp #474111:474112 @@ -385,7 +385,7 @@ DEBUG_BLOCK - #ifdef __linux__ + #ifdef __linux__ debug() << "SCHEDAFFINITY_SUPPORT enabled. Testing to see if HT fix should be enabled..." << endl; QString line; uint cpuCount = 0; @@ -404,12 +404,12 @@ debug() << "CPU with active HyperThreading detected. Enabling WORKAROUND.\n"; // If the library is new enough try and call sched_setaffinity. - #if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,3) + #if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,3) && defined(CPU_ZERO) && defined(CPU_SET) cpu_set_t mask; CPU_ZERO( &mask ); // Initializes all the bits in the mask to zero CPU_SET( 0, &mask ); // Sets only the bit corresponding to cpu #ifdef SCHEDAFFINITY_SUPPORT - if ( sched_setaffinity( 0, sizeof(mask), &mask ) == -1 ) + if ( sched_setaffinity( 0, sizeof(mask), &mask ) == -1 ) #else //SCHEDAFFINITY_SUPPORT if ( sched_setaffinity( 0, &mask ) == -1 ) #endif //SCHEDAFFINITY_SUPPORT
SVN commit 474114 by markey: Backport fix. CCBUG: 115068 M +5 -0 ChangeLog M +3 -3 src/app.cpp --- branches/stable/extragear/multimedia/amarok/ChangeLog #474113:474114 @@ -3,6 +3,11 @@ (C) 2002-2005 the amaroK authors. +VERSION 1.3.6: + BUGFIXES: + * Fix build issue on some Linux kernel 2.4 distros. (BR 115068) + + VERSION 1.3.5: BUGFIXES: * Fixed a build issue. --- branches/stable/extragear/multimedia/amarok/src/app.cpp #474113:474114 @@ -385,7 +385,7 @@ DEBUG_BLOCK - #ifdef __linux__ + #ifdef __linux__ debug() << "SCHEDAFFINITY_SUPPORT enabled. Testing to see if HT fix should be enabled..." << endl; QString line; uint cpuCount = 0; @@ -404,12 +404,12 @@ debug() << "CPU with active HyperThreading detected. Enabling WORKAROUND.\n"; // If the library is new enough try and call sched_setaffinity. - #if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,3) + #if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,3) && defined(CPU_ZERO) && defined(CPU_SET) cpu_set_t mask; CPU_ZERO( &mask ); // Initializes all the bits in the mask to zero CPU_SET( 0, &mask ); // Sets only the bit corresponding to cpu #ifdef SCHEDAFFINITY_SUPPORT - if ( sched_setaffinity( 0, sizeof(mask), &mask ) == -1 ) + if ( sched_setaffinity( 0, sizeof(mask), &mask ) == -1 ) #else //SCHEDAFFINITY_SUPPORT if ( sched_setaffinity( 0, &mask ) == -1 ) #endif //SCHEDAFFINITY_SUPPORT
This error (cpu_set undeclared) returns on compilation of sources of 1.3.6. So it looks that it's not fixed again. $ rpm -q glibc glibc-2.3.2-14mdk $ uname -r 2.6.12-oci5.mdk
Michal, post the error, cause I doubt the same error can happen since the code in question is now enclosed by #if defined(CPU_ZERO) && defined(CPU_SET) #endif
No actually it isn't, we tweaked it to work on another system and changed how it was doing the check. Little did we know there are systems which have the function but don't have the CPU_ZERO macro. :S Now we test pretty much everything in SVN trunk.