Skip to content

configure --enable-optimize doesn't seem to override CFG_DISABLE_OPTIMIZE #8721

Closed
@catamorphism

Description

@catamorphism

If CFG_DISABLE_OPTIMIZE is set in the environment, and I run ../configure --enable-optimize, I would expect an optimized build. However, this seems to have the effect of building an optimized LLVM but not an optimized rustc. (Doing VERBOSE=1 make rustc-stage1, I see the -O3 flag in the LLVM compile command lines, but no -O flag in the Rust compile commands.) The Makefile.in suggests my suspicion is right:

ifdef CFG_DISABLE_OPTIMIZE
  $(info cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE))
  CFG_RUSTC_FLAGS +=
else
  CFG_RUSTC_FLAGS += -O
endif

If this is the intended behavior, it should at least be documented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions