Skip to content

Conversation

@kleisauke
Copy link

See for example:
https://github.com/kleisauke/libvips-packaging/actions/runs/20065009063/job/57551203630
https://github.com/kleisauke/libvips-packaging/actions/runs/20065009063/job/57551203641

Note that I considered adding architecture-specific compile flags, similar to what's done here:

libultrahdr/CMakeLists.txt

Lines 295 to 323 in 8cbc983

if(ARCH STREQUAL "i386")
add_compile_options(-m32)
add_compile_options(-march=i386)
add_compile_options(-mtune=generic)
elseif(ARCH STREQUAL "amd64")
add_compile_options(-m64)
add_compile_options(-march=x86-64)
add_compile_options(-mtune=generic)
elseif(ARCH STREQUAL "arm")
add_compile_options(-march=armv7-a)
add_compile_options(-marm)
if(NOT ANDROID_ABI)
add_compile_options(-mfloat-abi=hard)
endif()
add_compile_options(-mfpu=neon-vfpv3)
add_compile_options(-fno-lax-vector-conversions)
elseif(ARCH STREQUAL "aarch64")
add_compile_options(-march=armv8-a)
add_compile_options(-fno-lax-vector-conversions)
elseif(ARCH STREQUAL "riscv64")
add_compile_options(-march=rv64gc)
add_compile_options(-mabi=lp64d)
elseif(ARCH STREQUAL "riscv32")
add_compile_options(-march=rv32gc)
add_compile_options(-mabi=ilp32d)
elseif(ARCH STREQUAL "loong64")
add_compile_options(-march=loongarch64)
add_compile_options(-mabi=lp64d)
endif()

However, I don't think that makes much sense, as Linux distributions usually handle this themselves.

@kleisauke
Copy link
Author

Alternatively, here's a changeset that removes the platform and architecture detection logic (including the arch-specific flags):
main...kleisauke:remove-platform-arch-detect

For example, this allows building for a Raspberry Pi Zero W (ARMv6). Without this change, the build fails with:

cc1plus: warning: switch '-mcpu=arm1176jzf-s' conflicts with '-march=armv7-a' switch
Assembler messages:
Error: unknown floating point format `neon-vfpv3'

(and this is just one case, there are likely better examples of why injecting those flags is not advisable)

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.

2 participants