Bug #10439 NDB fails to compile using icc, problem with dirent/dirent64
Submitted: 7 May 2005 20:58 Modified: 1 Dec 2005 13:43
Reporter: Kent Boortz Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:4.1.12-pre OS:Linux (Linux/x86)
Assigned to: Martin Skold CPU Architecture:Any

[7 May 2005 20:58] Kent Boortz
Description:
if icpc -DHAVE_CONFIG_H -DNDEBUG   -I. -I. -I../../../../..  -I. -I../../../../../include -I../../../../../ndb/include -I../../../../../ndb/src/kernel/vm -I../../../../../ndb
/src/kernel/error -I../../../../../ndb/src/kernel -I../../../../../ndb/include/kernel -I../../../../../ndb/include/transporter -I../../../../../ndb/include/debugger -I../../.
./../../ndb/include/mgmapi -I../../../../../ndb/include/mgmcommon -I../../../../../ndb/include/ndbapi -I../../../../../ndb/include/util -I../../../../../ndb/include/portlib -
I../../../../../ndb/include/logger    -O3 -DDBUG_OFF -O3 -unroll2 -ip -mp -no-gcc -restrict     -MT AsyncFile.o -MD -MP -MF ".deps/AsyncFile.Tpo" -c -o AsyncFile.o AsyncFile.
cpp; \
then mv -f ".deps/AsyncFile.Tpo" ".deps/AsyncFile.Po"; else rm -f ".deps/AsyncFile.Tpo"; exit 1; fi
AsyncFile.cpp(803): error: a value of type "dirent64 *" cannot be assigned to an entity of type "dirent *"
    while ((dp = readdir(dirp)) != NULL){
               ^

compilation aborted for AsyncFile.cpp (code 2)

How to repeat:
Compile using icc
[7 May 2005 20:59] Kent Boortz
Do a "make" in the saved tree production:~mysqldev/bug-10439
[7 May 2005 22:06] Martin Skold
Same problem exists in innodb, but the icc compiler just warns in this case.
The ndb code is compiled with icpc.

if icc -DHAVE_CONFIG_H -I. -I. -I.. -I./../include -I./../../include -I../../include    -g  -DDBUG_ON -DSAFE_MUTEX -g -DDBUG_ON -DSAFE_MUTEX -O3 -unroll2 -ip -mp -no-gcc -restrict   -DUNIV_LINUX -DUNIV_INTEL_X86 -MT os0file.o -MD -MP -MF ".deps/os0file.Tpo" -c -o os0file.o os0file.c; \
then mv -f ".deps/os0file.Tpo" ".deps/os0file.Po"; else rm -f ".deps/os0file.Tpo"; exit 1; fi
os0file.c(738): warning #167: argument of type "struct dirent *" is incompatible with parameter of type "struct dirent64 *"
        ret = readdir_r(dir, (struct dirent*)dirent_buf, &ent);
                             ^
 
os0file.c(738): warning #167: argument of type "struct dirent **" is incompatible with parameter of type "struct dirent64 **"
        ret = readdir_r(dir, (struct dirent*)dirent_buf, &ent);
                                                         ^
[7 May 2005 22:49] Martin Skold
Fixing this one just finds another one.
The problem is probably that configure script does
not set compile switches correctly for icpc and it incorrectly
assumes 64 bit pointers.
if icpc -DHAVE_CONFIG_H -DNDB_DEBUG -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD   -I. -I. -I../../../..  -I. -I../../../../include -I../../../../ndb/include -I../../../../ndb/include/util -I../../../../ndb/include/portlib -I../../../../ndb/include/logger    -g -O -DDBUG_ON -DSAFE_MUTEX -O3 -unroll2 -ip -mp -no-gcc -restrict     -MT Process.o -MD -MP -MF ".deps/Process.Tpo" -c -o Process.o Process.cpp; \
then mv -f ".deps/Process.Tpo" ".deps/Process.Po"; else rm -f ".deps/Process.Tpo"; exit 1; fi
icpc: Command line warning: overriding '-O' with '-O3'
Process.cpp(228): error: argument of type "rlimit *" is incompatible with parameter of type "rlimit64 *"
      _RLIMIT_FIX(RLIMIT_CORE);
[14 Jun 2005 15:41] Martin Skold
Is this one still a problem or can I close it?

max+ndb succeeds with 5.0.7 build on
nocona-icc-glibc23(linux-x86_64)
production-icc-glibc23(linux-i686)
max+ndb on
quadita2-icc-glibc23(linux-ia64)
fails, but not cluster specific problem
[14 Jul 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".
[1 Dec 2005 13:43] Joerg Bruehe
I checked the build logs of the 4.1 series, this error occurred only in 4.1.12.
Starting with 4.1.13, the builds were successful again.
The bug can/should be closed.
[10 Jul 2007 12:55] Gordan Bobic
This is still an issue on RedHat 9. When building RPMs witth ICC (v9.1.x), this breaks the build when building --with yassl. Without yassl only a few warnings are thrown up about it.

It builds OK with yassl on CentOS5 / x86-64, though (also with ICC v9.1.x).

The work-around for RH9/IA32 seems to be to doctor the .spec file and change the ssl configuration line to:

--with-ssl=/usr/include
which in theory should fall back to openssl.
Then the build errors out with missing krb5.h, which is in turn fixed by setting CPPFLAGS='-I/usr/kerberos/include'

I don't know if the built binaries work correctly, but at least they seem to compile.