public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: #error "Both _ILP32 and _LP64 are defined"
@ 2004-02-12 19:22 lrtaylor
  0 siblings, 0 replies; 5+ messages in thread
From: lrtaylor @ 2004-02-12 19:22 UTC (permalink / raw)
  To: lrtaylor, Phil.Crescioli, gcc-help

Oh, and I didn't need to use the -m64 option...

Lyle

-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of lrtaylor
Sent: Thursday, February 12, 2004 12:08 PM
To: lrtaylor; Phil.Crescioli@gd-ais.com; gcc-help@gcc.gnu.org
Subject: RE: #error "Both _ILP32 and _LP64 are defined"

Ahah!  Do you really need to use the -ansi option?  I found that it
fails when I use it, and succeeds when I don't.

Lyle

-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of lrtaylor
Sent: Thursday, February 12, 2004 11:57 AM
To: Phil.Crescioli@gd-ais.com; gcc-help@gcc.gnu.org
Subject: RE: #error "Both _ILP32 and _LP64 are defined"

Sorry.  I meant to try compiling the program passing -m64 as an argument
to GCC, not building GCC that way...

I just tried building your program below on my Solaris 8 box with GCC
3.3.1, and it succeeded.  Question, was your compiler built on that box,
or did you install a prebuilt version?  Was it built for Solaris 8?  If
you're building your own compiler, is upgrading to 3.3.x an option?

I'm not sure if that's the problem, but, like I said, it worked for me.
Another thing to check - is your box up to date on patches?

Cheers,
Lyle

-----Original Message-----
From: Crescioli, Phil [mailto:Phil.Crescioli@gd-ais.com] 
Sent: Thursday, February 12, 2004 8:14 AM
To: gcc-help@gcc.gnu.org
Cc: lrtaylor
Subject: RE: #error "Both _ILP32 and _LP64 are defined"


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 ?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: #error "Both _ILP32 and _LP64 are defined"
@ 2004-02-12 19:08 lrtaylor
  0 siblings, 0 replies; 5+ messages in thread
From: lrtaylor @ 2004-02-12 19:08 UTC (permalink / raw)
  To: lrtaylor, Phil.Crescioli, gcc-help

Ahah!  Do you really need to use the -ansi option?  I found that it
fails when I use it, and succeeds when I don't.

Lyle

-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of lrtaylor
Sent: Thursday, February 12, 2004 11:57 AM
To: Phil.Crescioli@gd-ais.com; gcc-help@gcc.gnu.org
Subject: RE: #error "Both _ILP32 and _LP64 are defined"

Sorry.  I meant to try compiling the program passing -m64 as an argument
to GCC, not building GCC that way...

I just tried building your program below on my Solaris 8 box with GCC
3.3.1, and it succeeded.  Question, was your compiler built on that box,
or did you install a prebuilt version?  Was it built for Solaris 8?  If
you're building your own compiler, is upgrading to 3.3.x an option?

I'm not sure if that's the problem, but, like I said, it worked for me.
Another thing to check - is your box up to date on patches?

Cheers,
Lyle

-----Original Message-----
From: Crescioli, Phil [mailto:Phil.Crescioli@gd-ais.com] 
Sent: Thursday, February 12, 2004 8:14 AM
To: gcc-help@gcc.gnu.org
Cc: lrtaylor
Subject: RE: #error "Both _ILP32 and _LP64 are defined"


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 ?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: #error "Both _ILP32 and _LP64 are defined"
@ 2004-02-12 18:57 lrtaylor
  0 siblings, 0 replies; 5+ messages in thread
From: lrtaylor @ 2004-02-12 18:57 UTC (permalink / raw)
  To: Phil.Crescioli, gcc-help

Sorry.  I meant to try compiling the program passing -m64 as an argument
to GCC, not building GCC that way...

I just tried building your program below on my Solaris 8 box with GCC
3.3.1, and it succeeded.  Question, was your compiler built on that box,
or did you install a prebuilt version?  Was it built for Solaris 8?  If
you're building your own compiler, is upgrading to 3.3.x an option?

I'm not sure if that's the problem, but, like I said, it worked for me.
Another thing to check - is your box up to date on patches?

Cheers,
Lyle

-----Original Message-----
From: Crescioli, Phil [mailto:Phil.Crescioli@gd-ais.com] 
Sent: Thursday, February 12, 2004 8:14 AM
To: gcc-help@gcc.gnu.org
Cc: lrtaylor
Subject: RE: #error "Both _ILP32 and _LP64 are defined"


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 ?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: #error "Both _ILP32 and _LP64 are defined"
@ 2004-02-12 15:13 Crescioli, Phil
  0 siblings, 0 replies; 5+ messages in thread
From: Crescioli, Phil @ 2004-02-12 15:13 UTC (permalink / raw)
  To: gcc-help; +Cc: lrtaylor


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@micron.com [mailto:lrtaylor@micron.com] 
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@gcc.gnu.org
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@gd-ais.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* #error "Both _ILP32 and _LP64 are defined"
@ 2004-02-11 22:45 Crescioli, Phil
  0 siblings, 0 replies; 5+ messages in thread
From: Crescioli, Phil @ 2004-02-11 22:45 UTC (permalink / raw)
  To: gcc-help

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@gd-ais.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-02-12 19:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-12 19:22 #error "Both _ILP32 and _LP64 are defined" lrtaylor
  -- strict thread matches above, loose matches on Subject: below --
2004-02-12 19:08 lrtaylor
2004-02-12 18:57 lrtaylor
2004-02-12 15:13 Crescioli, Phil
2004-02-11 22:45 Crescioli, Phil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).