public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* abi
@ 2023-07-09 20:55 André Albergaria Coelho
  2023-07-09 21:04 ` abi Paul Koning
  0 siblings, 1 reply; 8+ messages in thread
From: André Albergaria Coelho @ 2023-07-09 20:55 UTC (permalink / raw)
  To: gcc

If we can select the ABi for our program (using gcc), why is there a 
need for ABI stability?!

why not put it on a define


#define abi v3

int main() {

}


Each user would just have to compile the code, to follow the abi...no 
need to worry changing it


thanks


andre


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

* Re: abi
  2023-07-09 20:55 abi André Albergaria Coelho
@ 2023-07-09 21:04 ` Paul Koning
  2023-07-09 22:43   ` abi André Albergaria Coelho
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Koning @ 2023-07-09 21:04 UTC (permalink / raw)
  To: André Albergaria Coelho; +Cc: gcc

Because implementing an ABI, or dealing with an incompatibnle change, is hard work.  Also, ABI stability means that old binaries work.  So ABI stability isn't so much a requirement for the compiler as it is a requirement for any sane operating system.  An OS that changes ABI without an extremely good reason is an OS that doesn't care about compatibility, which means it doesn't care about its customers.

The MIPS examples I pointed to are a good illustration of this.  The original ("O32") ABI is for MIPS with 32 bit registers and 32 bit addressing.  N32 and N64 were introduced by SGI to support 64 bit registers, and (for N64) 64 bit pointers.  That's a very compelling benefit.  64 bbit addressing is obvious, and the performance benefit from using 64 bit registers on machines that have them is very large.  So there, the quite large cost of doing this was totally justified.

	paul

> On Jul 9, 2023, at 4:55 PM, André Albergaria Coelho via Gcc <gcc@gcc.gnu.org> wrote:
> 
> If we can select the ABi for our program (using gcc), why is there a need for ABI stability?!
> 
> why not put it on a define
> 
> 
> #define abi v3
> 
> int main() {
> 
> }
> 
> 
> Each user would just have to compile the code, to follow the abi...no need to worry changing it
> 
> 
> thanks
> 
> 
> andre
> 


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

* Re: abi
  2023-07-09 21:04 ` abi Paul Koning
@ 2023-07-09 22:43   ` André Albergaria Coelho
  0 siblings, 0 replies; 8+ messages in thread
From: André Albergaria Coelho @ 2023-07-09 22:43 UTC (permalink / raw)
  To: Paul Koning; +Cc: gcc

Can we debate in this mailing list?  thanks


On 7/9/23 22:04, Paul Koning wrote:
> Because implementing an ABI, or dealing with an incompatibnle change, is hard work.


  you could just use one ABI..(that's what you have)..you can use other 
, only at a cost of specifying an ABI version

the abi is text though..so you only have to write a text file....


>   Also, ABI stability means that old binaries work

when you mean binaries, do you mean ELF files? executable files?


> .  So ABI stability isn't so much a requirement for the compiler as it is a requirement for any sane operating system.

what does  a calling convention, has to do with syscalls?! and syscalls, 
and calling conventions, have to do with size and layouts?

used wikipedia definition 
..https://en.wikipedia.org/wiki/Application_binary_interface


how can the OS, have a binary interface?!!


for example:

prtinf("abc"),

asm  (say mov $123,%eax)

  binary instruction is 010110101 (for example)...how can the operating 
system know what interface to use?!


say i have 101010110101  1010101010101 , how does the O.S  works on 
binary files?! say how is the syscall used (at binary level)..it had to 
be compiled / assembled


int main() {

     write(123,&test_ptr,,count);

}

say write syscall is  "101010101001" in binary  ,so how does the O.S 
interfaces this ? does the O.S. separate binary numbers?!?


unless you meant ELF as "binary program"





An OS that changes ABI without an extremely good reason is an OS that 
doesn't care about compatibility, which means it doesn't care about its 
customers.




> The MIPS examples I pointed to are a good illustration of this.  The original ("O32") ABI is for MIPS with 32 bit registers and 32 bit addressing.  N32 and N64 were introduced by SGI to support 64 bit registers, and (for N64) 64 bit pointers.  That's a very compelling benefit.  64 bbit addressing is obvious, and the performance benefit from using 64 bit registers on machines that have them is very large.  So there, the quite large cost of doing this was totally justified.

The benefit would be for the user...code like it wants (for example, 
return value in %ecx)..which is the ultimate reason to use compilers

and also, the benefit would be to use every ABI possible (choosing the best)


> 	paul
>
>> On Jul 9, 2023, at 4:55 PM, André Albergaria Coelho via Gcc <gcc@gcc.gnu.org> wrote:
>>
>> If we can select the ABi for our program (using gcc), why is there a need for ABI stability?!
>>
>> why not put it on a define
>>
>>
>> #define abi v3
>>
>> int main() {
>>
>> }
>>
>>
>> Each user would just have to compile the code, to follow the abi...no need to worry changing it
>>
>>
>> thanks
>>
>>
>> andre
>>
> andre

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

* Re: abi
  2023-07-06 21:19 abi André Albergaria Coelho
  2023-07-06 21:22 ` abi Paul Koning
@ 2023-07-06 21:42 ` Jonathan Wakely
  1 sibling, 0 replies; 8+ messages in thread
From: Jonathan Wakely @ 2023-07-06 21:42 UTC (permalink / raw)
  To: André Albergaria Coelho; +Cc: gcc

[-- Attachment #1: Type: text/plain, Size: 334 bytes --]

On Thu, 6 Jul 2023, 22:20 André Albergaria Coelho via Gcc, <gcc@gcc.gnu.org>
wrote:

> Could gcc have an option to specify ABI?
>
> say
>
>
> gcc something.c -g -abi 1 -o something
>

Sure, it could do, but what would it do? What would "-abi 1" mean? Which
ABI would it relate to?

What are you actually asking about?

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

* Re: abi
  2023-07-06 21:19 abi André Albergaria Coelho
@ 2023-07-06 21:22 ` Paul Koning
  2023-07-06 21:42 ` abi Jonathan Wakely
  1 sibling, 0 replies; 8+ messages in thread
From: Paul Koning @ 2023-07-06 21:22 UTC (permalink / raw)
  To: André Albergaria Coelho; +Cc: Jonathan Wakely via Gcc

It does, for machine architectures that have multiple ABIs.  MIPS is an example where GCC has supported this for at least 20 years.

	paul

> On Jul 6, 2023, at 5:19 PM, André Albergaria Coelho via Gcc <gcc@gcc.gnu.org> wrote:
> 
> Could gcc have an option to specify ABI?
> 
> say
> 
> 
> gcc something.c -g -abi 1 -o something
> 
> 
> thanks
> 
> 
> andre
> 


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

* abi
@ 2023-07-06 21:19 André Albergaria Coelho
  2023-07-06 21:22 ` abi Paul Koning
  2023-07-06 21:42 ` abi Jonathan Wakely
  0 siblings, 2 replies; 8+ messages in thread
From: André Albergaria Coelho @ 2023-07-06 21:19 UTC (permalink / raw)
  To: gcc

Could gcc have an option to specify ABI?

say


gcc something.c -g -abi 1 -o something


thanks


andre


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

* abi
  1999-03-10  9:01 abi Peter Johnston
@ 1999-03-31 23:46 ` Peter Johnston
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Johnston @ 1999-03-31 23:46 UTC (permalink / raw)
  To: egcs

Dear All,

Using egcs1.1.1 on Irix5.3, is there any reason why the -mabi
(eg -mabi=n32) options should not work?

Cheers

Peter



Dr Peter Johnston
DISAT
Universita' degli Studi di Milano
Via Emanueli, 15
Milano 20126
Italy
peter@alpha.disat.unimi.it
Tel: +39-02-64474415
Fax: +39-02-64474400
IMPORTANT: The '0' is not a mistake!


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

* abi
@ 1999-03-10  9:01 Peter Johnston
  1999-03-31 23:46 ` abi Peter Johnston
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Johnston @ 1999-03-10  9:01 UTC (permalink / raw)
  To: egcs

Dear All,

Using egcs1.1.1 on Irix5.3, is there any reason why the -mabi
(eg -mabi=n32) options should not work?

Cheers

Peter



Dr Peter Johnston
DISAT
Universita' degli Studi di Milano
Via Emanueli, 15
Milano 20126
Italy
peter@alpha.disat.unimi.it
Tel: +39-02-64474415
Fax: +39-02-64474400
IMPORTANT: The '0' is not a mistake!

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

end of thread, other threads:[~2023-07-09 22:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-09 20:55 abi André Albergaria Coelho
2023-07-09 21:04 ` abi Paul Koning
2023-07-09 22:43   ` abi André Albergaria Coelho
  -- strict thread matches above, loose matches on Subject: below --
2023-07-06 21:19 abi André Albergaria Coelho
2023-07-06 21:22 ` abi Paul Koning
2023-07-06 21:42 ` abi Jonathan Wakely
1999-03-10  9:01 abi Peter Johnston
1999-03-31 23:46 ` abi Peter Johnston

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).