The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
White Paper on Storage Considerations for Accelerating Databases iBot Solaris BigAdmin RSS 0 3 Weeks Ago 05:45 PM
Mac OS X v10.5: Active Directory - Name and password considerations when binding with iBot OS X Support RSS 0 07-20-2009 04:00 PM
Application Performance Considerations for Sun SPARC Enterprise M-Series Servers iBot Solaris BigAdmin RSS 0 01-08-2009 09:30 AM
How Can a Machine Reads a Compiler Since A Compiler is Written in Text! Not Binaries? f.ben.isaac High Level Programming 12 11-14-2008 11:25 AM
AIX 5.3 gcc compiler cipher#1 UNIX for Dummies Questions & Answers 0 07-30-2007 09:50 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 2 Weeks Ago
MrUser's Avatar
MrUser MrUser is offline
Registered User
  
 

Join Date: Oct 2009
Location: Earth
Posts: 23
Compiler considerations

Hi this is rather basic question but to answer and understand the problem nedded expert.

compilers are OS dependent but OS may use any processor
how the compilers are able to generate code for different processors

just consider the below scenario:



Code:
 
Compilers:              dev c/VC++                 gcc                  turbo 
 
OS:                        windows                    linux                  DOS 
 
Processors:                              intel/motorola/AMD/celeron

any processor i can use for any system.

if we consider gcc, it can generate code for intel or motorola or AMD on some other OS.
how its achieving this.

what are the issues ( related to portability ) considered during the design of the compiler?

will they specify the set of processors that the compiler can generate the code for?

if so, they need to add the code for any newly invented processor.
  #2 (permalink)  
Old 2 Weeks Ago
pludi's Avatar
pludi pludi is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2008
Location: .at
Posts: 1,839
Side node: gcc isn't restricted to Linux, but also available for Windows, using either MingW or Cygwin, as well as almost any other UNIX (HP-UX, *BSD, Solaris, ...).
  #3 (permalink)  
Old 2 Weeks Ago
shamrock shamrock is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2007
Location: USA
Posts: 750
Quote:
Originally Posted by MrUser View Post
Hi this is rather basic question but to answer and understand the problem nedded expert.

compilers are OS dependent but OS may use any processor
Compilers are also MPU specific.
Quote:
Originally Posted by MrUser View Post
how the compilers are able to generate code for different processors
They most likely have a database of the instruction set of each mpu.
Quote:
Originally Posted by MrUser View Post
just consider the below scenario:



Code:
 
Compilers:              dev c/VC++                 gcc                  turbo 
 
OS:                        windows                    linux                  DOS 
 
Processors:                              intel/motorola/AMD/celeron

any processor i can use for any system.

if we consider gcc, it can generate code for intel or motorola or AMD on some other OS.
how its achieving this.
By knowing the instruction set of each mpu...easier for a software to remember but not for a programmer.
Quote:
Originally Posted by MrUser View Post
what are the issues ( related to portability ) considered during the design of the compiler?

will they specify the set of processors that the compiler can generate the code for?
Yes they do.
Quote:
Originally Posted by MrUser View Post
if so, they need to add the code for any newly invented processor.
Yes that would be called a newer version of the compiler.
Bits Awarded / Charged to shamrock for this Post
Date User Comment Amount
2 Weeks Ago MrUser good explanation 1,000
  #4 (permalink)  
Old 2 Weeks Ago
MrUser's Avatar
MrUser MrUser is offline
Registered User
  
 

Join Date: Oct 2009
Location: Earth
Posts: 23
can i print by any means(command or program) the set of processors that my compiler can generate code for?


i am using LINUX 2.4.20-8 smp on i386 machine
  #5 (permalink)  
Old 2 Weeks Ago
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,929
If you're using i386, it's time to upgrade. The basic i686 architecture has taken over for at least a decade now, covering the vast majority of the 32-bit world of processors. A lot of distros don't support i386 any more because that architecture is missing some important fundamental instructions now depended on for things like IPC.

Your compiler can probably generate code for x86 processors and nothing else. Most compilers aren't configured to generate code for anything except their native platform.
  #6 (permalink)  
Old 2 Weeks Ago
shamrock shamrock is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2007
Location: USA
Posts: 750
Quote:
Originally Posted by MrUser View Post
can i print by any means(command or program) the set of processors that my compiler can generate code for?


i am using LINUX 2.4.20-8 smp on i386 machine
I dont know any command line options you can give to the compiler to figure out the supported mpus but the vendor from who you purchased it should be able to give you that information. So what compiler and version are you using.
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:44 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0