Bug #10712 CONFIG_NR_CPUS not defined for kernel header percpu.h
Submitted: 18 May 2005 14:28 Modified: 19 Jun 2005 9:09
Reporter: Dmitry Lunin Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:4.1.12 OS:Linux (Slackware Linux 10.1)
Assigned to: CPU Architecture:Any

[18 May 2005 14:28] Dmitry Lunin
Description:
Slackware Linux 10.1, gcc 3.3.4 (or gcc 3.3.5), kernel 2.6.10

gcc -c  -o strings-x86.o strings-x86.s
gcc -c  -o longlong2str-x86.o longlong2str-x86.s
gcc -c  -o my_strtoll10-x86.o my_strtoll10-x86.s
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include    -O3 -DDBUG_OFF    -MT bfill.o -MD -MP -MF ".deps/bfill.Tpo" -c -o bfill.o bfill.c; \
then mv -f ".deps/bfill.Tpo" ".deps/bfill.Po"; else rm -f ".deps/bfill.Tpo"; exit 1; fi
In file included from /usr/include/asm/percpu.h:4,
                 from /usr/include/asm/processor.h:22,
                 from /usr/include/asm/atomic.h:6,
                 from ../include/my_global.h:294,
                 from bfill.c:32:
/usr/include/asm-generic/percpu.h:8: error: `CONFIG_NR_CPUS' undeclared here (not in a function)
make[2]: *** [bfill.o] Error 1
make[2]: Leaving directory `/z/src/mysql-4.1.12/strings'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/z/src/mysql-4.1.12'
make: *** [all] Error 2

How to repeat:
./configure --prefix=/usr --with-mysqld-user=mysql --with-unix-socket-path=/var/run/mysql/mysql.sock --localstatedir=/var/lib/mysql --enable-assembler --with-raid --without-debug --enable-thread-safe-client --without-bench --with-extra-charsets=complex --program-prefix="" --program-suffix="" i686-slackware-linux

make
[18 May 2005 16:13] Sergei Golubchik
Are you sure it's 4.1.12 ?
This bug was fixed in 4.1.12 - see http://bugs.mysql.com/bug.php?id=7970

Could you attach ([Files] tab) config.log ?
[18 May 2005 19:40] Dmitry Lunin
Yes. I am assured. MySQL 4.1.12.
This link saw.
[18 May 2005 19:49] Dmitry Lunin
Config Log

Attachment: config.log.gz (application/x-gzip, text), 31.18 KiB.

[18 May 2005 19:50] Dmitry Lunin
The file is attached
[19 May 2005 9:09] Sergei Golubchik
Unfirtunately, we don't have a configuration similar to yours and cannot repeat this bug.

So, you need to help us to find the reason.

configure contains a check whether <asm/atomic.h> is usable - it tries to compile and run a small program using atomic operations. But in your case configure succeeds, but later compilation of MySQL fails. And we need to know why configure doesn't see the problem.

What you can try to do:

1. check how configure does the test (e.g. by putting "set -x" in configure script right above atomic test and "set +x" when the test is finished)
2. perform the same test manually (create the same test program, compile it with the same switches)
3. check the preprocessed source of this test program (gcc <all other switches> -E -dD)
4. check the preprocessed source of bfill.c (gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include    -O3 -DDBUG_OFF -E -dD bfill.c)

at this point you'll be able to see why CONFIG_NR_CPUS is a problem for the main build but not for the configure.
[19 Jun 2005 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".