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

Mediatek DSP fixups #844

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

andyross
Copy link
Contributor

Fixed needed to get a real working toolchain out of the recently merged overlays. Not quite sure how I convinced myself that was going to work. My own builds with upstream ct-ng were doing OK, but it's possible it was confounded by a union of the two directory schemes (or maybe we're a little behind?).

@andyross
Copy link
Contributor Author

Yeah... how about a respin that after running git add correctly...

The new directory structure in the upstream Cadence tarballs wasn't as
compatible as I thought.  Binutils will produce a working assembler,
but only if it does NOT see the new xtensa-config.h (which was added
in a path it doesn't look at).  Also gcc ends up hitting the
in-tree/non-overlayed xtensa-config.h and produces a big endian
compiler!  Don't be fancy.  Move stuff around to match the older
overlays exactly.

Also add the "defs.h" inclusion as generated by make-overlay.sh, and
rename the copy of xtensa-xtregs.c in gdbserver to .cc as required by
current binutils and done by other sdk-ng overlays.

And I'd forgotten the copy of core-isa.h for newlib (which SOF doesn't
use, but should still be present in the SDK).

Signed-off-by: Andy Ross <[email protected]>

squashme defs.h
There is no "predicted branches" extension in any version of the
Xtensa ISA reference I have.  Newer versions of Cadence tooling have
removed (and presumably deprecated) this symbol, but binutils still
relies on seeing it (even just to evaluate to a zero to diable the
feature).

Really the proper fix would be to patch binutils upstream, but let's
have compatible headers here first.

Signed-off-by: Andy Ross <[email protected]>
The name of the rmap array changed in upstream bintuils commit
2b16913cdca2 ("gdb: make gdbarch_alloc take ownership of the tdep").
At the same time it seems like the xtensa_tdep definition (which
contra the filename is actually a C++ object definition and not a
function prototype!) moved into this file from elsewhere in binutils.

The xtensa_rmap symbol is only used by newer binutils versions than
the Zephyr SDK builds, but add an alias so it builds with upstream
crosstools-ng, and commit it here as a reference if we want to port
the other Xtensa overlays.

Signed-off-by: Andy Ross <[email protected]>
@andyross
Copy link
Contributor Author

andyross commented Dec 2, 2024

And I see we now have a build. And I can confirm it generates working binaries for all four devices with these two in-flight PRs applied:

zephyrproject-rtos/zephyr#82350
zephyrproject-rtos/hal_xtensa#34

Once those merge we can uncomment the test lines in the Github integration.

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.

1 participant