Comment 24 for bug 1988710

Revision history for this message
In , Ubizjak (ubizjak) wrote :

(In reply to Christian Ehrhardt from comment #3)
> > Just drop -mbuild-constants.
>
> Thanks for the hint Uroš, but I'm not sure if one can do that, this option
> is from [1]. I do not have the background on this, but it reads as there was
> a reason "Use -mbuild-constants to prevent the compiler using static data"
> to set this which seems more breaking than my current workaround (reduce -O2
> to -O1).
>
> [1]:
> https://github.com/qemu/qemu-palcode/commit/
> 0830e72f0bce29bdf1de0d67ad503a9a8b99c968

-mbuild-constants is used here together with -msmall-data (which limits relocations to the small data area to 16 bits). -mbuild-constants option tries harder to construct 64-bit constants using arithmetic with immediates instead of loads from the small data area. So, if the linker does not error out with relocation overflow, it can be safely omitted.

The fix to the compiler is relatively straightforward, but I have no access to alpha system any more to properly test the fix (and I have no patience to run the testsuite on the simulator). The -mbuild-constant option is rarely used, and the proposed workaround should be safe.