Skip to content

linux configure $CFLAGS 环境变量导致大小端测试失败("endian test failed") #27

@smsxgli

Description

@smsxgli

Describe the bug

linux环境下,在build/linux/目录下,执行./configure,当存在“CFLAGS”环境变量时,会干扰大小端的测试,导致configure失败,终端输出“endian test failed”

To Reproduce

设置环境变量CFLAGS:
export CFLAGS="-march=native -O2 -ftree-loop-vectorize -pipe -fstack-protector-strong -fstack-clash-protection -fno-plt -fexceptions -fasynchronous-unwind-tables -flto -grecord-gcc-switches"
执行./configure
输出:endian test failed

Expected behavior

在编译发布版本时,使用上述CFLAGS以获得更好的优化是很常见的,configure不应当因此而失败。

Screenshots

image

Desktop (please complete the following information):

  • OS: Arch Linux
  • Compiler: gcc (GCC) 10.2.0
  • yasm: 1.3.0

个人解决方案:
见附件
fix-endian-test-failed-with-cflags.patch.txt

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