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

Remaining fixes for Apple Silicon and QEMU #27

Merged
merged 3 commits into from Mar 9, 2021

Conversation

osy
Copy link
Contributor

@osy osy commented Mar 9, 2021

These last couple of fixes are needed for the following

  1. Building as a subproject in QEMU
  2. Building for/on M1 Macs
  3. Building for iOS

osy added 3 commits Mar 8, 2021
This is needed because in libucontext.h we include "libucontext/bits.h".
We therefore need to have bits.h in somepath/libucontext/bits.h. In the
Makefile, somepath/freestanding/bits.h was copied to the right path but
in the meson build system, the include copy happens at the end.
_GNU_SOURCE can be defined without defining REG_X macros so it is not a
good indicator. (QEMU for example defines it in the build system.) x86
and x86_64 should have consistant looking defs.h so ifndef guards are
added to each REG_X definition.
Clang's arm64 assembler does not support multiple directives on a single
line. C macros ALWAYS expand to a single line.
@osy
Copy link
Contributor Author

osy commented Mar 9, 2021

I still don't know of a good workaround for 9b1d8f0 the other way I considered is writing a Python script that generates the .S file but it seems like overkill.

@kaniini
Copy link
Owner

kaniini commented Mar 9, 2021

i think we can live with it for now. we should raise a bug with the clang project though to have this fixed:

kaniini
kaniini approved these changes Mar 9, 2021
@kaniini kaniini merged commit 464f98a into kaniini:master Mar 9, 2021
@osy
Copy link
Contributor Author

osy commented Mar 9, 2021

I think having macros expand to a single line is standard but how assemblers handle newline alternative (like ;) is dependent on the assembler: https://stackoverflow.com/questions/27685548/can-i-write-multiple-assembly-instructions-on-the-same-line

Seems like clang's arm64 assembler does not interpret ; as a new line even though clang's x86_64 assembler does...

@kaniini
Copy link
Owner

kaniini commented Mar 9, 2021

yeah to be clear i was talking about the ; issue

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.

None yet

2 participants