rui314 / mold

Mold: A Modern Linker 🦠
MIT License
14.45k stars 473 forks source link

Feature Request: Use environment flags for mold-specific switches #1369

Open EndlessEden opened 2 weeks ago

EndlessEden commented 2 weeks ago

What: Add a check for env flags on launch that executes mold with mold specific switches

Why: When trying to use mold with GCC/Clang using the LDFLAGS variable, gcc/clang produces a error when supplied with mold-specific flags during startup. preventing building prior to reaching the linker stage.

Alcaro commented 2 weeks ago

gcc does, as far as I can determine, not use the LDFLAGS variable. Do ld.bfd flags, like --gc-sections, work? Are you prefixing your linker flags with -Wl,?