Fix build issues when compiling WAMRC as a cross-compiler #4112
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request addresses issues encountered when compiling WAMRC to be a cross-compiler—running on a PC while targeting an embedded ARM platform. The key fixes include:
Fixes in This PR
-m32 compiler flag
-m32
flag was previously added unconditionally for 32-bit targets, causing issues for non-x86 platforms.-m32
is only added when targeting a 32-bit x86 platform (X86_32
), ensuring it is only applied where supported.Improved PIC Flag Handling:
-fPIC
) based onWAMR_BUILD_PLATFORM
was overly complex.AOT Relocation Functions:
<arm_neon.h>
) that are not available on a PC.SIMD Compilation Issues: