Skip to content

Conversation

gsmecher
Copy link

The binutils patches carried in meta-xilinx/meta-microblaze/recipes-devtools/binutils do not build when using gcc-14. This patch series contains two kinds of things:

  1. Workarounds for compiler errors that seem reasonable, and
  2. A couple of workarounds for compiler errors that look more serious

Item (1) needs review, but item (2) needs some care and attention. This PR is not meant to be merged wholesale.

The patches themselves contain build error messages in fairly excruciating detail.


opcode->inst_type=INST_TYPE_RD_R1_IMML;
- opcode->inst_offset_type = OPCODE_MASK_H;
+ opcode->inst_offset_type = 0; /* FIXME OPCODE_MASK_H; */
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a "short" field getting a 32-bit-long constant. The gcc-14 error, above, tells me it's truncating to 0. For the time being, I'm just making that truncation explicit. (See? I told you not to merge this patch.)

}
if (strcmp (op_end, ""))
- op_end = parse_reg (op_end + 1, &immed); /* Get rfslN. */
+ op_end = parse_reg (op_end + 1, (unsigned *)&immed); /* Get rfslN. */
Copy link
Author

@gsmecher gsmecher Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, immed is long long (i.e. at least 64 bits), and parse_reg expects a pointer to a 32-bit quantity. Assuming we're on a little-endian system, it's a bad-but-seemingly-functional idea to cast between them like this. On a big-endian system it would certainly not work as expected.

@vai-tomme
Copy link

FWIW Bumped into the same build errors on Debian 13, these patches fix the build issues. Can these be reworked towards a version that is mergeable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants