* [Bug target/94236] -mcmodel=large does not work on aarch64
2020-03-20 15:42 [Bug c/94236] New: -mcmodel=large does not work on aarch64 baratharon at caesar dot elte.hu
@ 2020-03-20 16:08 ` pinskia at gcc dot gnu.org
2020-03-20 16:17 ` pinskia at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2020-03-20 16:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94236
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
-mcmodel=large does not control long calls.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/94236] -mcmodel=large does not work on aarch64
2020-03-20 15:42 [Bug c/94236] New: -mcmodel=large does not work on aarch64 baratharon at caesar dot elte.hu
2020-03-20 16:08 ` [Bug target/94236] " pinskia at gcc dot gnu.org
@ 2020-03-20 16:17 ` pinskia at gcc dot gnu.org
2020-03-20 16:19 ` baratharon at caesar dot elte.hu
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2020-03-20 16:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94236
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
A patch for -mlong-calls was posted a long time ago but never made it in:
https://gcc.gnu.org/legacy-ml/gcc-patches/2014-10/msg02933.html
You should not need -mlong-calls really because the linker should insert stubs
to do the long calls in the end.
Why do you think you need full 64bit addressing for calls rather than the
stubs?
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/94236] -mcmodel=large does not work on aarch64
2020-03-20 15:42 [Bug c/94236] New: -mcmodel=large does not work on aarch64 baratharon at caesar dot elte.hu
2020-03-20 16:08 ` [Bug target/94236] " pinskia at gcc dot gnu.org
2020-03-20 16:17 ` pinskia at gcc dot gnu.org
@ 2020-03-20 16:19 ` baratharon at caesar dot elte.hu
2020-03-20 16:25 ` pinskia at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: baratharon at caesar dot elte.hu @ 2020-03-20 16:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94236
--- Comment #3 from Aron <baratharon at caesar dot elte.hu> ---
(In reply to Andrew Pinski from comment #1)
> -mcmodel=large does not control long calls.
Sadly, aarch64 lacks -mlong-calls which I use on armv7, therefore I thought
based on the specification -mcmodel=large would handle it. Also, on x86_64,
-mcmodel=large handles it. I'm confused.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/94236] -mcmodel=large does not work on aarch64
2020-03-20 15:42 [Bug c/94236] New: -mcmodel=large does not work on aarch64 baratharon at caesar dot elte.hu
` (2 preceding siblings ...)
2020-03-20 16:19 ` baratharon at caesar dot elte.hu
@ 2020-03-20 16:25 ` pinskia at gcc dot gnu.org
2020-03-23 7:11 ` baratharon at caesar dot elte.hu
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2020-03-20 16:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94236
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Do you have a source where you run into a relocation overflowing?
Or is there a specific reason why you need long calls here?
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/94236] -mcmodel=large does not work on aarch64
2020-03-20 15:42 [Bug c/94236] New: -mcmodel=large does not work on aarch64 baratharon at caesar dot elte.hu
` (3 preceding siblings ...)
2020-03-20 16:25 ` pinskia at gcc dot gnu.org
@ 2020-03-23 7:11 ` baratharon at caesar dot elte.hu
2020-03-23 7:15 ` pinskia at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: baratharon at caesar dot elte.hu @ 2020-03-23 7:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94236
--- Comment #5 from Aron <baratharon at caesar dot elte.hu> ---
(In reply to Andrew Pinski from comment #4)
> Do you have a source where you run into a relocation overflowing?
> Or is there a specific reason why you need long calls here?
The current form of Threos OS requires such executables at a very early boot
stage. I wouldn't say it is impossible to change that stage, but I intended to
use the same method as on x86_64.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/94236] -mcmodel=large does not work on aarch64
2020-03-20 15:42 [Bug c/94236] New: -mcmodel=large does not work on aarch64 baratharon at caesar dot elte.hu
` (4 preceding siblings ...)
2020-03-23 7:11 ` baratharon at caesar dot elte.hu
@ 2020-03-23 7:15 ` pinskia at gcc dot gnu.org
2020-03-23 7:24 ` baratharon at caesar dot elte.hu
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2020-03-23 7:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94236
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note for Threos OS, please don't reuse the same target triplet as elf or linux;
use your own triplet. Also adding long calls is not hard and such.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/94236] -mcmodel=large does not work on aarch64
2020-03-20 15:42 [Bug c/94236] New: -mcmodel=large does not work on aarch64 baratharon at caesar dot elte.hu
` (5 preceding siblings ...)
2020-03-23 7:15 ` pinskia at gcc dot gnu.org
@ 2020-03-23 7:24 ` baratharon at caesar dot elte.hu
2020-03-23 10:56 ` rearnsha at gcc dot gnu.org
2021-01-25 20:17 ` wilco at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: baratharon at caesar dot elte.hu @ 2020-03-23 7:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94236
--- Comment #7 from Aron <baratharon at caesar dot elte.hu> ---
(In reply to Andrew Pinski from comment #6)
> Note for Threos OS, please don't reuse the same target triplet as elf or
> linux; use your own triplet. Also adding long calls is not hard and such.
As a simple start, I used the -ffreestanding -nostdlib -nostdinc combination,
but they did not made any difference on the output object file, so I removed
them in post #1. On x86_64 and armv7 we already have target (cross) gcc, but we
just started to work on aarch64. Either Linux target or Threos target, CALL26
would be also an issue. It seems, I have to mock with the target gcc first
before we can ran anything on the HW to include the long calls patch. Still, I
would be happy if the mainline gcc have the -mlong-calls for aarch64.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/94236] -mcmodel=large does not work on aarch64
2020-03-20 15:42 [Bug c/94236] New: -mcmodel=large does not work on aarch64 baratharon at caesar dot elte.hu
` (6 preceding siblings ...)
2020-03-23 7:24 ` baratharon at caesar dot elte.hu
@ 2020-03-23 10:56 ` rearnsha at gcc dot gnu.org
2021-01-25 20:17 ` wilco at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: rearnsha at gcc dot gnu.org @ 2020-03-23 10:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94236
--- Comment #8 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #6)
> Note for Threos OS, please don't reuse the same target triplet as elf or
> linux; use your own triplet. Also adding long calls is not hard and such.
The correct solution is to implement long call support in the linker in
conformance with the ABI.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/94236] -mcmodel=large does not work on aarch64
2020-03-20 15:42 [Bug c/94236] New: -mcmodel=large does not work on aarch64 baratharon at caesar dot elte.hu
` (7 preceding siblings ...)
2020-03-23 10:56 ` rearnsha at gcc dot gnu.org
@ 2021-01-25 20:17 ` wilco at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: wilco at gcc dot gnu.org @ 2021-01-25 20:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94236
Wilco <wilco at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
CC| |wilco at gcc dot gnu.org
Status|UNCONFIRMED |RESOLVED
--- Comment #9 from Wilco <wilco at gcc dot gnu.org> ---
(In reply to Richard Earnshaw from comment #8)
> (In reply to Andrew Pinski from comment #6)
> > Note for Threos OS, please don't reuse the same target triplet as elf or
> > linux; use your own triplet. Also adding long calls is not hard and such.
>
> The correct solution is to implement long call support in the linker in
> conformance with the ABI.
And ld does this correctly, so I fail to see an actual issue here. -mlong-calls
is a terrible hack, so should be avoided unless it's to work around a broken
linker.
^ permalink raw reply [flat|nested] 10+ messages in thread