Skip to content

vendored libelf compilation issue on ARM64 with clang #144

@KarstenB

Description

@KarstenB

When I try to clippy the build with a vendored libelf on arm64 with clang:

sudo apt install  libclang-dev autopoint m4 flex bison gawk clang
export CC=clang
cargo clippy --all-targets --features=vendored-libelf

I get the following error:

 configure: WARNING: not running biarch tests, clang -m32 does not work
  error: unknown warning option '-Werror=stringop-overflow'; did you mean '-Werror=shift-overflow'? [-Werror,-Wunknown-warning-option]
  error: unknown warning option '-Werror=stringop-overflow'; did you mean '-Werror=shift-overflow'? [-Werror,-Wunknown-warning-option]
  error: unknown warning option '-Werror=stringop-overflow'; did you mean '-Werror=shift-overflow'? [-Werror,-Wunknown-warning-option]
  make: *** [Makefile:497: xasprintf.o] Error 1
  make: *** Waiting for unfinished jobs....
  make: *** [Makefile:497: xstrdup.o] Error 1
  error: unknown warning option '-Werror=stringop-overflow'; did you mean '-Werror=shift-overflow'? [-Werror,-Wunknown-warning-option]
  error: unknown warning option '-Werror=stringop-overflow'; did you mean '-Werror=shift-overflow'? [-Werror,-Wunknown-warning-option]
  error: unknown warning option '-Werror=stringop-overflow'; did you mean '-Werror=shift-overflow'? [-Werror,-Wunknown-warning-option]
  make: *** [Makefile:497: xstrndup.o] Error 1
  error: unknown warning option '-Werror=stringop-overflow'; did you mean '-Werror=shift-overflow'? [-Werror,-Wunknown-warning-option]
  error: make: *** [Makefile:497: xmalloc.o] Error 1
  unknown warning option '-Werror=stringop-overflow'; did you mean '-Werror=shift-overflow'? [-Werror,-Wunknown-warning-option]
  error: unknown warning option '-Werror=stringop-overflow'; did you mean '-Werror=shift-overflow'? [-Werror,-Wunknown-warning-option]
  make: *** [Makefile:497: next_prime.o] Error 1
  make: *** [Makefile:497: crc32_file.o] Error 1
  error: unknown warning option '-Werror=stringop-overflow'; did you mean '-Werror=shift-overflow'? [-Werror,-Wunknown-warning-option]
  make: *** [Makefile:497: error.o] Error 1
  make: *** [Makefile:497: crc32.o] Error 1
  make: *** [Makefile:497: color.o] Error 1
  make: *** [Makefile:497: printversion.o] Error 1

This is caused by this code, which when removed, works as expected:

    #[cfg(target_arch = "aarch64")]
    cflags.push_str(" -Wno-error=stringop-overflow");

When this code is removed, and I use GCC, it still compiles successfully. Maybe something that this was supposed to workaround has been fixed upstream?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions