Skip to content

Work around incompatibility with ancient GNU as (GNU binutils) #2463

Open
@briansmith

Description

@briansmith

We have multiple bug reports where the latest release of ring doesn't build when using old versions of GNU binutils:

Luckily, this isn't urgent as ring 0.17.12 is available for people to use, but it could become urgent at any time if we have a security fix because we only do security releases on top of the latest version.

There are multiple workarounds available:

  • Upgrade GNU binutils to a later version (2.38 seems sufficient; maybe some earlier versions work?)
  • Use CC=clang or TARGET_CC=clang or similar, to use clang and llvm-as instead of GNU as.

I think somebody needs to investigate exactly why GNU as 2.29 rejects the instruction, to see if we can find an easy workaround. I don't have access to GNU as older than 2.38.

Perhaps there is an easy workaround, such as adding an .arch directive to aes-gcm-avx2-x86_64.pl that would make it work.

Or, there could be more tedious workarounds. In OpenSSL, in the past at least, they have sometimes used .byte directives to directly encode instructions. For example, for mulx in x86_64-mont.pl we have:

.byte	0xc4,0x62,0xfb,0xf6,0xa1,0x10,0x00,0x00,0x00	# mulx	2*8($nptr),%rax,%r12

The difficulty here, of course, is that the registers being accessed are encoded into the instruction, so this is kind of a last resort workaround.

I don't intend to implement such a workaround myself, but others might be interested in doing so.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions