Compilation Optimization Guide contains outdated information about LDFLAGS. LDFLAGS are now officially supported. Some suggestions: 1. Create a section which will describe some safe flags: -Wl,-O1 -Wl,--as-needed Some information: http://www.gentoo.org/proj/en/qa/asneeded.xml -Wl,--hash-style=gnu Mention that -Wl,--hash-style=gnu can be used only in GLibC non-MIPS systems. -Wl,--sort-common 2. Create a section which will describe some safe flags, which rather should not be specified in LDFLAGS, because they are enabled by default in Gentoo (if sys-devel/binutils was built with USE="-vanilla"): -Wl,--enable-new-dtags -Wl,--hash-style=both -Wl,-z,relro Some information: http://www.gentoo.org/proj/en/hardened/hardened-toolchain.xml#RELRO 3. Consider splitting LDFLAGS documentation to "Linking Optimization Guide".
I updated the LDFLAGS section to account for the changed stance on LDFLAGS. However, under no circumstances should any more information on individual LDFLAGS or separate guides on linking optimizations be created. We don't encourage users to set their own LDFLAGS; that's the whole point of the developer decision to set them in the base profiles. User-specified LDFLAGS are *still not* supported. Users should not be messing with LDFLAGS. Also, as things like gnu hash style have yet to settle down, the guide will not discuss those nor any other specific LDFLAGS. As the discussion on the ML has indicated, soon enough the default LDFLAGS will take those into account, depending on environment.