rui314 / mold

Mold: A Modern Linker 🦠
MIT License
14.37k stars 470 forks source link

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

Open EndlessEden opened 3 days ago

EndlessEden commented 3 days 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 3 days 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,?