[OE-core] Illegal instruction when running go binaries in qemux86

Paul Barker pbarker at toganlabs.com
Mon Oct 9 16:16:11 UTC 2017


On Mon, Oct 9, 2017 at 5:04 PM, Khem Raj <raj.khem at gmail.com> wrote:
> On Mon, Oct 9, 2017 at 6:15 AM, Paul Barker <pbarker at toganlabs.com> wrote:
>> On Thu, Oct 5, 2017 at 3:35 PM, Paul Barker <pbarker at toganlabs.com> wrote:
>>> On Thu, Oct 5, 2017 at 3:31 PM, Burton, Ross <ross.burton at intel.com> wrote:
>>>> On 5 October 2017 at 15:23, Paul Barker <pbarker at toganlabs.com> wrote:
>>>>>
>>>>> So my question is: should we just set GO386 = "387" so that it applies
>>>>> to all go binaries and accept the slight loss of performance on x86
>>>>> systems that do support sse2 instructions? Or should we make this
>>>>> MACHINE specific so that sse2 instructions can be used where
>>>>> supported?
>>>>
>>>>
>>>> Definitely machine-specific.  Need a way of mapping from OE tunes to Go
>>>> options that control the instructions used.
>>>>
>>>> Ross
>>>
>>> Looking again, we already have go_map_arm() in goarch.bbclass to set
>>> HOST_GOARM and TARGET_GOARM. We probably need to do the same for the
>>> GO386 variable.
>>>
>>
>> I'm looking at what I can use to determine if sse2 is supported for a
>> given machine/tune.
>>
>> In TUNE_FEATURES I could check for "core2" or "corei7" based on what's
>> in oe-core, but not sure this will cover tunings which might be
>> defined in other layers.
>>
>> Alternatively I could check TUNE_CCARGS for "-msse2" or later but that
>> feels dirty.
>>
>> Any suggestions on this?
>>
>
> For cross compile there is no easy way, I would think using a map is
> probably the
> best thing we can do,

This is my intention, just trying to work out what I can map from.
What I'm currently thinking is, in rough pseudocode:

go_map_386():
    if "core2" or "corei7" in TUNE_FEATURES:
        return "sse2"
    else:
        return "387"

Then set TARGET_GO386 and HOST_GO386 appropriately. This can then
determine the final "export GO386 = ...." depending on if we're
building for host or target. Much the same way GOARM is currently
handled.

Cheers,

-- 
Paul Barker
Togán Labs Ltd



More information about the Openembedded-core mailing list