Unix Technical Forum

Gcc On Solaris Sparc Versus Solaris Intel: Repost With Error InformationIncluded

This is a discussion on Gcc On Solaris Sparc Versus Solaris Intel: Repost With Error InformationIncluded within the Sun Solaris Administration forums, part of the Solaris Operating System category; --> Gentle People? I am currently running gcc 3.1 on both my Ultra 5 Solaris 8 Sparc machine and on ...


Go Back   Unix Technical Forum > Unix Operating Systems > Solaris Operating System > Sun Solaris Administration

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-16-2008, 10:43 AM
Thomas Dineen
 
Posts: n/a
Default Gcc On Solaris Sparc Versus Solaris Intel: Repost With Error InformationIncluded

Gentle People?

I am currently running gcc 3.1 on both my Ultra 5
Solaris 8 Sparc machine and on Solaris 8 Intel machine.
The C source code that compiles and executes perfectly on
the Ultra 5 will not compile on the Intel machine!

The compilation errors, shown below, seem to relate to
syntax errors, and not simply missing files. Remember this
same code compiles perfectly on the Sparc machine. There is no
inline assembly language or obvious machine dependent code
involved.

Why would there be such a difference in the between gcc on
Sparc versus Intel?

Someone mentioned that the header files are different:
I wonder why? I would of thought at that level of abstraction
they would be identical.


Thanks for the help.
Thomas Dineen

gcc cmd_parser.c -ggdb -w -c -o cmd_parser.o
In file included from cmd_parser.c:13:
structures.h:484: parse error before "exec_struct_sun"
structures.h:489: parse error before "Exec_union"
structures.h:498: parse error before ’}’ token

typedef union
{
unsigned char load[BUF_SIZE];
exec_struct_sun Exec_load; // Line 484
} Exec_union;

typedef struct
{
Exec_union un; // Line 489
int n_page_size;
int n_segment_size;
int n_text_offset;
int n_data_offset;
int n_text_rel_offset;
int n_data_rel_offset;
int n_symbol_offset;
int n_string_offset;
} Exec_Struct; // Line 498

// Cut from another .h file:

typedef struct {
unsigned char a_dynamic:1; /* has a __DYNAMIC */
unsigned char a_toolversion:7; /* version of toolset used
create this file */
unsigned char a_machtype; /* machine type */
unsigned short a_magic; /* magic number */
unsigned int a_text; /* size of text segment */
unsigned int a_data; /* size of initialized data */
unsigned int a_bss; /* size of uninitialized data */
unsigned int a_syms; /* size of symbol table */
unsigned int a_entry; /* entry point */
unsigned int a_trsize; /* size of text relocation */
unsigned int a_drsize; /* size of data relocation */
} exec_struct_sun;


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-16-2008, 10:43 AM
Ian Collins
 
Posts: n/a
Default Re: Gcc On Solaris Sparc Versus Solaris Intel: Repost With ErrorInformation Included

Thomas Dineen wrote:
> Gentle People?
>
> I am currently running gcc 3.1 on both my Ultra 5
> Solaris 8 Sparc machine and on Solaris 8 Intel machine.
> The C source code that compiles and executes perfectly on
> the Ultra 5 will not compile on the Intel machine!
>

Have you tried a more recent gcc or Sun Studio? The code you posted
looks clean, assuming UF_SIZE is defined and you include the header for
exec_struct_sun.

Otherwise, check to see if there are any incorrect conditional
compilation macros that exclude exec_struct_sun. Sometimes developers
wrongly assume Solaris==Sparc in conditional includes.

--
Ian Collins.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-16-2008, 10:44 AM
James Carlson
 
Posts: n/a
Default Re: Gcc On Solaris Sparc Versus Solaris Intel: Repost With Error Information Included

Thomas Dineen <tjjdineen@comcast.net> writes:
> I am currently running gcc 3.1 on both my Ultra 5
> Solaris 8 Sparc machine and on Solaris 8 Intel machine.
> The C source code that compiles and executes perfectly on
> the Ultra 5 will not compile on the Intel machine!


Wow, that's old stuff.

> Why would there be such a difference in the between gcc on
> Sparc versus Intel?


It's hard to tell. There shouldn't be. A good place to start would
be examining the output of 'gcc -E' -- find out what the preprocessor
is actually doing with this code. There is likely some difference
between the two machines beyond the parts you've mentioned.

--
James Carlson, KISS Network <james.d.carlson@sun.com>
Sun Microsystems / 1 Network Drive 71.232W Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-16-2008, 10:45 AM
zoot
 
Posts: n/a
Default Re: Gcc On Solaris Sparc Versus Solaris Intel: Repost With Error Information Included


James Carlson wrote:
> Thomas Dineen <tjjdineen@comcast.net> writes:
> > I am currently running gcc 3.1 on both my Ultra 5
> > Solaris 8 Sparc machine and on Solaris 8 Intel machine.
> > The C source code that compiles and executes perfectly on
> > the Ultra 5 will not compile on the Intel machine!

>
> Wow, that's old stuff.
>
> > Why would there be such a difference in the between gcc on
> > Sparc versus Intel?

>
> It's hard to tell. There shouldn't be. A good place to start would
> be examining the output of 'gcc -E' -- find out what the preprocessor
> is actually doing with this code. There is likely some difference
> between the two machines beyond the parts you've mentioned.
>
> --
> James Carlson, KISS Network <james.d.carlson@sun.com>
> Sun Microsystems / 1 Network Drive 71.232W Vox +1 781 442 2084
> MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677


Not exaclty the same, but,

a loong while ago I had same problems, using same gcc version on a
Solaris 8 (sparc) and a Linux RH 8 ( I know, as I said)
The sintax differences were all missing new line between declarations,
If I remmebrer correctly.

I eneded p writing under Linux and recompiling unde Solaris where it
didn't make a diffference.
Zoot

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:02 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com