RE: #error "Both _ILP32 and _LP64 are defined"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for the reply. I will try that if you think what I'm about to 
say does not jive or you know what the answer to it is...

Some of the project code I'm porting from gcc2.95.2 to gcc323 
involves compiling my project code with ACE5.2(which was compiled under
2952 as well).  
Well, I was getting similar "long not supported by ISO" warnings
from ACE headers files when compiling my project code with ACE5.2 and
gcc323. 
So I installed ACE5.3.6 (and compiled it under gcc3.2.3) and then when I
compiled my project code with ACE 5.3.6 and gcc323 the long not
supported errors went away.
So I was guessing that ACE5.3.6 somehow set compiler directives that
cleared up the long not supported warnings and maybe that's all I have
to do myself.  
What do you think?  
If I must recompile gcc323 with -m64, If I use -mtune=ultrasparc option
instead (as noted in the install readme below) would that do the trick 
since my platforms are all ultrasparcs ?

http://gcc.gnu.org/install/specific.html#sparc-sun-solaris2*
Starting with Solaris 7, the operating system is capable of executing
64-bit SPARC V9 binaries. GCC 3.1 and later properly supports this; the
-m64 option enables 64-bit code generation. However, if all you want is
code tuned for the UltraSPARC CPU, you should try the -mtune=ultrasparc
option instead, which produces code that, unlike full 64-bit code, can
still run on non-UltraSPARC machines

Much thanks for the help :)
Phil 



-----Original Message-----
From: lrtaylor@xxxxxxxxxx [mailto:lrtaylor@xxxxxxxxxx] 
Sent: Wednesday, February 11, 2004 6:18 PM
To: Crescioli, Phil
Subject: RE: #error "Both _ILP32 and _LP64 are defined"

I believe that GCC builds 32-bit executables by default.  If this is an
option, you could try telling it to build a 64-bit binary instead using
the -m64 option.

Cheers,
Lyle


-----Original Message-----
From: Crescioli, Phil 
Sent: Wednesday, February 11, 2004 5:45 PM
To: gcc-help@xxxxxxxxxxx
Subject: #error "Both _ILP32 and _LP64 are defined"

I think I'm having some 64bit<-->32bit ABI compatibility problems and
not quite sure how to solve *correctly*.  I wish I could set a compiler
directive to solve it.  My attempts so far don't work. Any help is
appreciated. I'm on a sparc system running solaris 8 with gcc 3.2.3.

My code below finds its PID from the proc tables 
in /usr/proc/* and then finds it's file name using 
fstream and procfs structure variables then prints 
the executed filename to stdout.
============================================================
#include <iostream>
#include <fstream>
#include <procfs.h>
#include <unistd.h>
using namespace std ;
int main(void)
{
  char      *buffer ;
  ifstream   procFile ; 
  char       procFileName[25] ;
  psinfo_t   info ;
  int        pid_ ;
  int        length ;
  cout << "Entering Main()" << endl ;
  // Get this processes Process IDentification (PID)
  pid_ = getpid();
  sprintf(procFileName, "/proc/%d/psinfo", pid_);
  procFile.open(procFileName, ios::binary) ;
  if (procFile.is_open())
  {
    // get length of file:
    procFile.seekg(0, ios::end);
    length = procFile.tellg();
    procFile.seekg(0, ios::beg);
    // allocate memory:
    buffer = new char [length];
    // read data as a block:
    procFile.read(buffer,length);
    procFile.close();
    strcpy(buffer, info.pr_fname);
    cout << "buffer =" << buffer << endl ;
  }
  else{
    cout << "cant open process info file" << endl ;
  }
  cout << "Exiting Main()" << endl ;
  return (0);
}  /* main */
======================================================================
When I compile this code with the cmd below I get the following error
======================================================================
g++ -ansi -g -Wall -o ProcInfoTest ProcInfoTest.cpp
In file included from /usr/include/sys/procfs.h:41,
                 from /usr/include/procfs.h:26,
                 from glxProcInfoTest.cpp:3:
/usr/include/sys/procfs_isa.h:230: 'uint64_t' is used as a type, but is
not 
   defined as a type.
In file included from /usr/include/procfs.h:26, from
glxProcInfoTest.cpp:3:
/usr/include/sys/procfs.h:304: 'uint64_t' is used as a type, but is not
defined as a type.

======================================================================
I found that uint64_t is defined in /usr/include/sys/int_types.h.
So, when I compile this code with the additional -DLP64 directive I 
get the following error
======================================================================
g++ -ansi -g -Wall -D_LP64 -o ProcInfoTest ProcInfoTest.cpp
In file included from /usr/include/sys/feature_tests.h:15,
                 from /usr/include/iso/stdio_iso.h:35,
                 from
/home/philc/GCC/gcc323bin/lib/gcc-lib/sparc-sun-solaris2.8/3.2.3/include
/stdio.h:36,
                 from
/home/philc/GCC/gcc323bin/include/c++/3.2.3/cstdio:52,
                 from
/home/philc/GCC/gcc323bin/include/c++/3.2.3/sparc-sun-solaris2.8/bits/c+
+io.h:35, from
/home/philc/GCC/gcc323bin/include/c++/3.2.3/bits/fpos.h:44,
                 from
/home/philc/GCC/gcc323bin/include/c++/3.2.3/iosfwd:46,
                 from
/home/philc/GCC/gcc323bin/include/c++/3.2.3/ios:44,
                from
/home/philc/GCC/gcc323bin/include/c++/3.2.3/ostream:45,
              from
/home/philc/GCC/gcc323bin/include/c++/3.2.3/iostream:45,
               from glxProcInfoTest.cpp:1:
/usr/include/sys/isa_defs.h:376:2: #error "Both _ILP32 and _LP64 are
defined"
======================================================================
If anyone knows how I can only get _LP64 defined to make this compile,
or what the correct solution is to get this compiles, please let me
know.
======================================================================
Thanks,
Phil Crescioli
GENERAL DYNAMICS
Phil.Crescioli@xxxxxxxxxx


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux