Skip to content

[BUG] CXXFLAGS replacements are not applied #19

Description

@mnightingale

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I have not checked which version it changed in but as of 7.2.7 unrars makefile does not contain -march=native, the line is:

CXXFLAGS=-O2 -std=c++11 -Wno-logical-op-parentheses -Wno-switch -Wno-dangling-else

Therefore these all silently fail.

sed -i 's|CXXFLAGS=-march=native |CXXFLAGS=|' makefile && \

sed -i 's|CXXFLAGS=-march=native|CXXFLAGS=-march=armv8-a+crypto+crc|' makefile && \

sed -i 's|CXXFLAGS=-march=native |CXXFLAGS=|' makefile && \

X86_64 and RISV are no-ops because they just wanted to remove native, so they are not needed any more. However, aarch64 results in a build with no crypto or crc instructions because it's not passing -march=armv8-a+crypto+crc

However, I'm not sure what level of compatibility you actually want, I'm not familiar with the hardware but I know older RPi models wont have crypto but that's maybe too large a sacrifice for some old hardware.

edit: +crc+crypto is safe, unrar checks at runtime CRC_Neon (crc.cpp:44) and AES_Neon (rijndael.cpp:125) test getauxval(AT_HWCAP)

It could instead just match the lines starting LDFLAGS= or CXXFLAGS=, or grep -q to check the match exists and avoid such silent failures in the future.

Expected Behavior

No response

Steps To Reproduce

objdump -d unrar-alpine | grep -Ei 'aes|crc32'

Environment

- OS:
- How docker service was installed:

Docker creation

N/A

Container logs

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions