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

Clean up GCC arch/triple handling #791

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

Conversation

mqudsi
Copy link
Contributor

@mqudsi mqudsi commented Feb 9, 2023

Clean up the GCC triple targeting code

Identify which if statements can coincide and which are mutually exclusive and
then reorganize them into `if .. else if ..` blocks to make it clearer which
code may or may not apply to any given target.

Remove duplicated handling of certain triple cases (e.g. armv7a).

Move everything that's not to do with the target architecture/instruction
set/calling convention/fpu to the top, then deal with the rest (the messiest and
most complicated bits of the code).

Clean up and clarify Android targeting code

Use the online NDK compiler docs at [0] as a reference to document some of the
existing behavior and supplement with a linker argument.

Don't rely on vague things like "x86 doesn't contain eabi" and just test for the
architectures we are targeting in the Android-specific code.

[0]: https://developer.android.com/ndk/guides/standalone_toolchain

I would certainly appreciate another set of eyes on the changes. The previously logic was highly interleaved and out-of-order, but my aim was to (in the first patch) only refactor and remove redundant code without changing any of the logic.

Identify which if statements can coincide and which are mutually exclusive and
then reorganize them into `if .. else if ..` blocks to make it clearer which
code may or may not apply to any given target.

Remove duplicated handling of certain triple cases (e.g. armv7a).

Move everything that's not to do with the target architecture/instruction
set/calling convention/fpu to the top, then deal with the rest (the messiest and
most complicated bits of the code).
Use the online NDK compiler docs at [0] as a reference to document some of the
existing behavior and supplement with a linker argument.

Don't rely on vague things like "x86 doesn't contain eabi" and just test for the
architectures we are targeting in the Android-specific code.

[0]: https://developer.android.com/ndk/guides/standalone_toolchain
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