Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

microblaze: pull in gcc/bintuils/gdb patches from meta-xilinx #647

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alpsayin
Copy link
Collaborator

@alpsayin alpsayin commented Mar 13, 2023

This commit pulls in the fix for the Microblaze gcc atomic compare-and-swap issue where atomic cas returns the inverse Boolean value of what it should. zephyrproject-rtos/gcc#21

These patchsets fixes many known issues on gnu-toolchain for microblaze.
But mainly the atomic-cas and binutils incorrect relocation issues.
Patches obtained from https://github.com/xilinx/meta-xilinx/ repository,

Fixes

  1. microblaze: atomic compare-and-swap returns incorrect value #646
  2. microblaze: CAS operation in raise is overwriting the signal handler with SIGDFL picolibc/picolibc#460
  3. microblaze: Fix -Os right shift optimization is allowed into delay slot gcc#37
  4. and other yet-to-be-seen issues.

I've given up and disabled microblaze64 toolchain build. meta-xilinx patches somehow manage to break the same toolchain that they introduced. I have no intention to support microblaze64 yet and this saves a few CI cycles.

Finally; if/when AMD/Xilinx software group manages to upstream these to gnu-gcc, the squashed commits in individual repositories should provide an easy transition (revert and rebase) when it's time to upgrade zephyr-gcc.

CC @keith-packard

@keith-packard
Copy link
Collaborator

I think the whole series of pending microblaze fixes should be added here, not just one of them.

@alpsayin
Copy link
Collaborator Author

alpsayin commented Apr 7, 2023

I think the whole series of pending microblaze fixes should be added here, not just one of them.

Sorry, I've been busy with work. I'll make use of the holidays now and start applying. I have some catching up to do...

@alpsayin alpsayin force-pushed the asayin-topic-microblaze branch 4 times, most recently from fcf0562 to 872e6eb Compare April 18, 2023 21:20
@alpsayin alpsayin changed the title gcc: Pull in Microblaze gcc atomic cas return value fix gcc: Pull in Microblaze gcc/bintuils/gdb patches from Meta-Xilinx May 24, 2023
@alpsayin alpsayin changed the title gcc: Pull in Microblaze gcc/bintuils/gdb patches from Meta-Xilinx Pull in Microblaze gcc/bintuils/gdb patches from Meta-Xilinx May 24, 2023
@alpsayin
Copy link
Collaborator Author

Tried to apply all patches I could find in binutils as the 1st step. Came across various conflicts. Tried to solve them naively but it seems I failed.
Will have to approach this a bit more clever.

@alpsayin
Copy link
Collaborator Author

I'll be damned. Binutils patches applied cleanly with 464c189
With the toolchain built in https://github.com/zephyrproject-rtos/sdk-ng/actions/runs/5068098583 , all Zephyr tests passing except builds for picolibc. Using this sdk-ng I also face the same issues as reported before in picolibc/picolibc#460 . I'm now trying to build only with the GCC fix in zephyrproject-rtos/gcc@b4654fb so that I can have a trusted base from which I can continue to apply binutils and gcc patches.

@alpsayin
Copy link
Collaborator Author

GCC and binutils patches applied successfully but GDB patches are problematic. I'm working on it.

@alpsayin alpsayin force-pushed the asayin-topic-microblaze branch 8 times, most recently from 4fc35b2 to cac164f Compare August 31, 2023 12:02
@alpsayin
Copy link
Collaborator Author

alpsayin commented Oct 2, 2023

CI building for the last time. I will confirm microblaze toolchain still passes all tests (Zephyr & picolibc) and mark this as "Ready for review". I expect no issues.

@alpsayin alpsayin changed the title Pull in Microblaze gcc/bintuils/gdb patches from Meta-Xilinx microblaze: pull in gcc/bintuils/gdb patches from meta-xilinx Oct 2, 2023
@alpsayin alpsayin marked this pull request as ready for review October 9, 2023 23:43
@alpsayin alpsayin added area: GCC Issues related to GCC (GNU Compiler Collection) area: Binutils Issues related to GNU Binutils area: GDB Issues related to GDB (GNU Debugger) area: Toolchain Issues related to Toolchain (Binutils+GCC+GDB+libs) labels Oct 15, 2023
@stephanosio
Copy link
Member

stephanosio commented Nov 13, 2023

Copy link
Member

@stephanosio stephanosio left a comment

Choose a reason for hiding this comment

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

Leaving a -1 until all the relevant toolchain patches are merged and this PR is updated to reference the merged commits.

@alpsayin
Copy link
Collaborator Author

Seen it, on it. Thank you!

@alpsayin alpsayin force-pushed the asayin-topic-microblaze branch 3 times, most recently from 170e540 to 94298da Compare December 2, 2023 14:31
@alpsayin alpsayin force-pushed the asayin-topic-microblaze branch 2 times, most recently from 5460835 to 563a6be Compare December 19, 2023 18:40
@alpsayin alpsayin force-pushed the asayin-topic-microblaze branch 3 times, most recently from b24d363 to 214f390 Compare October 8, 2024 11:03
@alpsayin
Copy link
Collaborator Author

Note to self: microblaze-qemu might be out of date, I'll need to figure out what's going on with that.
Context:
xlnx,ill-opcode-exception = < 0x01 >; option for Microblaze CPU emulation didn't bite even though it's clearly upstreamed:
qemu/qemu@5143fdf
Example usage:
https://github.com/qemu/qemu/blob/master/pc-bios/petalogix-ml605.dts#L95

@alpsayin
Copy link
Collaborator Author

New issue found, potential fix under test zephyrproject-rtos/gcc#37

@alpsayin alpsayin self-assigned this Oct 18, 2024
This patchset fixes many known issues on gnu-toolchain for microblaze.
But mainly the atomic-cas and binutils incorrect relocation issues.

Patches obtained from https://github.com/xilinx/meta-xilinx/

Signed-off-by: Alp Sayin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Binutils Issues related to GNU Binutils area: GCC Issues related to GCC (GNU Compiler Collection) area: GDB Issues related to GDB (GNU Debugger) area: Toolchain Issues related to Toolchain (Binutils+GCC+GDB+libs)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants