1

I have a program that performs some network IO that compiles a 32 bit binary just fine

However, when I set the -m64 option at compile time I get the following rather cryptic error

In file included from /usr/include/sys/stream.h:22,
             from /usr/include/netinet/in.h:62,
             from /usr/include/sys/socket.h:221,
             from operation_networkio.cc:15:
/usr/include/sys/vnode.h:241: error: overflow in array dimension
/usr/include/sys/vnode.h:241: error: size of array `pad' is too large

the offending lines in my source code operation_networkio.cc that are triggering this error in my program seem to be

#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>

could someone enlighten me what I am doing wrong and how to cure this ? I'm using GCC on Solaris sparc

camelccc
  • 2,847
  • 8
  • 26
  • 52

2 Answers2

1

eventually found that I had -mfaster-structs option enabled on the compilation.

For some reason removing this option cures this build problem. that causes a 64 bit build to fail, though a 32 bit build works. If someone could explain it I'd certainly like to know why

camelccc
  • 2,847
  • 8
  • 26
  • 52
0

This is indeed weird.

http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/sys/vnode.h#286

It should not be possible that these data structures grow beyond 64 bytes. Or maybe you included some files that redefine these data structures. To be sure what the cause is, you should look at the preprocessed output from the C compiler.

g++ -E operation_networkio.cc -I... -D... -o preprocessed.cc

After running that command you should have a look at the file preprocessed.cc. Search for vn_vfslocks_entry and see if the code around that definition is what you expect.

Roland Illig
  • 40,703
  • 10
  • 88
  • 121