Skip to content

fix syntax of conditional assembly directives for aarch64#1630

Closed
qurious-pixel wants to merge 6 commits into
cemu-project:mainfrom
qurious-pixel:patch-1
Closed

fix syntax of conditional assembly directives for aarch64#1630
qurious-pixel wants to merge 6 commits into
cemu-project:mainfrom
qurious-pixel:patch-1

Conversation

@qurious-pixel

Copy link
Copy Markdown
Contributor

fixes #1618

@qurious-pixel qurious-pixel marked this pull request as draft July 4, 2025 01:10
"decoder/arm/ih264d_function_selector.c"
)
target_compile_options(ih264d PRIVATE -DARMV8)
target_compile_options(ih264d PRIVATE -DARMV8 $<$<COMPILE_LANGUAGE:ASM,Clang>:-Wno-unused-command-line-argument>)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think the issue on aarch64 Linux is that clang doesn't run the C preprocessor on the assembly files.
According to https://developer.arm.com/documentation/100066/0611/assembling-assembly-code/preprocessing-assembly-code you could either replace the assembly code source file suffix from .s to .S or use the -x assembler-with-cpp option. Also, revert the assembly files back to use the #ifdef preprocessor directive.

Suggested change
target_compile_options(ih264d PRIVATE -DARMV8 $<$<COMPILE_LANGUAGE:ASM,Clang>:-Wno-unused-command-line-argument>)
target_compile_options(ih264d PRIVATE -DARMV8 $<$<COMPILE_LANGUAGE:ASM,Clang>:-Wno-unused-command-line-argument>)
if(NOT MSVC)
set(CMAKE_ASM_FLAGS "${CFLAGS} -x assembler-with-cpp")
endif()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is the right way. closing this PR in favor of @SSimco 's suggestion.

@qurious-pixel qurious-pixel deleted the patch-1 branch July 4, 2025 14:21
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.

Failed to build git on ARM64 Linux

2 participants