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

unshim cxx, add crt[in].o to managarm sysdeps in place of the gcc ones #863

Merged
merged 10 commits into from
Nov 30, 2023

Conversation

ArsenArsen
Copy link
Member

No description provided.

@ArsenArsen
Copy link
Member Author

oh, right. the ci will need gcc 13 for ubuntu. i'll figure out how to make those packages later..


if host_machine.cpu_family() == 'x86_64'
crt_pie = custom_target('Scrt1',
crtstuff = ['crt0']
Copy link
Member

Choose a reason for hiding this comment

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

Are these really the best way to name these variables?

Copy link
Member Author

Choose a reason for hiding this comment

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

open to better names

meson.build Show resolved Hide resolved
Copy link
Member

@no92 no92 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@Dennisbonke Dennisbonke left a comment

Choose a reason for hiding this comment

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

LGTM

@Dennisbonke
Copy link
Member

However, would it be possible to hold this until gha approves too?

@ArsenArsen
Copy link
Member Author

no, it will not do that, but I haven't done a merge yet since I haven't updated the CI to contain new toolchains

@ArsenArsen ArsenArsen force-pushed the kill/cxxshim branch 16 times, most recently from ff3c0eb to 95e61a9 Compare August 19, 2023 15:11
@ArsenArsen
Copy link
Member Author

should be done

@ArsenArsen ArsenArsen requested a review from Geertiebear August 19, 2023 22:51
Copy link
Member

@Geertiebear Geertiebear left a comment

Choose a reason for hiding this comment

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

Does this mean one needs to install build a cross compiler to build mlibc now?

@@ -6,21 +6,20 @@ jobs:
build-mlibc:
strategy:
matrix:
arch: [x86_64, riscv64, aarch64]
arch: [x86_64, aarch64]
Copy link
Member

Choose a reason for hiding this comment

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

Why is riscv removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

the port isn't complete enough to configure a cross compiler

Copy link
Member

Choose a reason for hiding this comment

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

What is missing?

Copy link
Member Author

Choose a reason for hiding this comment

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

unsure, but this is the build log:

239.5 In file included from ../../../tool-src/libgcc/unwind-dw2.c:410:
239.5 ./md-unwind-support.h: In function 'riscv_fallback_frame_state':
239.5 ./md-unwind-support.h:67:6: warning: assignment to 'struct sigcontext *' from incompatible pointer type 'mcontext_t *' [-Wincompatible-pointer-types]
239.5    67 |   sc = &rt_->uc.uc_mcontext;
239.5       |      ^
239.5 ./md-unwind-support.h:77:53: error: invalid use of undefined type 'struct sigcontext'
239.5    77 |       fs->regs.reg[i].loc.offset = (_Unwind_Ptr) &sc->gregs[i] - new_cfa;
239.5       |                                                     ^~
239.5 ./md-unwind-support.h:84:21: error: invalid use of undefined type 'struct sigcontext'
239.5    84 |     (_Unwind_Ptr) sc->gregs[0] - new_cfa;
239.5       |                     ^~
239.5 make[2]: *** [../../../tool-src/libgcc/static-object.mk:17: unwind-dw2.o] Error 1

... slightly mangled by docker. to reproduce it, you can use the script in mlibc-crossers by just adding a riscv target

Copy link
Member

Choose a reason for hiding this comment

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

That seems lie an easy fix, seems like we're just missing a struct sigcontext.

Copy link
Member Author

Choose a reason for hiding this comment

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

sure, but I have no knowledge of riscv64, nor a way to test it.

Copy link
Member

Choose a reason for hiding this comment

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

Right, but I'm also not going to merge a regression on the CI. I'll submit a PR to your branch later to fix this.

Copy link
Member

Choose a reason for hiding this comment

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

This should get fixed once #945 is merged.

@ArsenArsen
Copy link
Member Author

nothing changed in that regard, my guess is that old hacks still work

@Geertiebear
Copy link
Member

Geertiebear commented Aug 22, 2023

We never really used any hacks that I'm aware of, and I'm asking since every sysdep now has a cross file that is not the system compiler, implying that we can no longer compile mlibc with the system compiler.

@ArsenArsen
Copy link
Member Author

using a mistargeted compiler should still work as before. the current configuration just gets us GCC 13 with libstdc++ 13 in CI

@Geertiebear
Copy link
Member

But using a mistargeted compiler required cxxshim. Is cxxshim still supported?

@ArsenArsen
Copy link
Member Author

could be the case that we can even use libstdc++ from gcc 13 without cxxshim even when configured hosted and for the wrong target, but I haven't tested it. cxxshim should also work, bugs in it notwithstanding

Copy link
Member

@Dennisbonke Dennisbonke left a comment

Choose a reason for hiding this comment

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

LGTM

@Dennisbonke Dennisbonke merged commit 749b27b into managarm:master Nov 30, 2023
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.

4 participants