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 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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; |
| |||
| 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. |
| |||
| 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 |
| ||||
| 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 |
| Thread Tools | |
| Display Modes | |
|
|