1.1 --- a/config/cc/gcc.in Thu Jun 30 18:14:01 2011 +0200
1.2 +++ b/config/cc/gcc.in Mon Jun 27 13:52:15 2011 +0200
1.3 @@ -237,6 +237,7 @@
1.4 select CC_GCC_HAS_GRAPHITE
1.5 select CC_GCC_HAS_LTO
1.6 select CC_GCC_HAS_PKGVERSION_BUGURL
1.7 + select CC_GCC_HAS_BUILD_ID
1.8
1.9 config CC_GCC_4_5_or_later
1.10 bool
1.11 @@ -250,6 +251,7 @@
1.12 select CC_GCC_HAS_GRAPHITE
1.13 select CC_GCC_HAS_LTO
1.14 select CC_GCC_HAS_PKGVERSION_BUGURL
1.15 + select CC_GCC_HAS_BUILD_ID
1.16
1.17 config CC_GCC_4_6_or_later
1.18 bool
1.19 @@ -272,6 +274,9 @@
1.20 config CC_GCC_HAS_PKGVERSION_BUGURL
1.21 bool
1.22
1.23 +config CC_GCC_HAS_BUILD_ID
1.24 + bool
1.25 +
1.26 # Only enable gcc's support for plugins if binutils has it as well
1.27 # They are usefull only when doing LTO, but it does no harm enabling
1.28 # them even without LTO.
2.1 --- a/config/cc/gcc.in.2 Thu Jun 30 18:14:01 2011 +0200
2.2 +++ b/config/cc/gcc.in.2 Mon Jun 27 13:52:15 2011 +0200
2.3 @@ -198,3 +198,16 @@
2.4 glibc >= 2.4, 64-bit otherwise)
2.5
2.6 If in doubt, keep the default, ie. 'M'.
2.7 +
2.8 +config CC_GCC_BUILD_ID
2.9 + bool
2.10 + prompt "Enable build-id"
2.11 + depends on CC_GCC_HAS_BUILD_ID
2.12 + help
2.13 + Tells GCC to pass --build-id option to the linker for all final
2.14 + links (links performed without the -r or --relocatable option),
2.15 + if the linker supports it. If you say 'y' here, but your linker
2.16 + does not support --build-id option, a warning is issued and this
2.17 + option is ignored.
2.18 +
2.19 + The default is off.
3.1 --- a/scripts/build/cc/gcc.sh Thu Jun 30 18:14:01 2011 +0200
3.2 +++ b/scripts/build/cc/gcc.sh Mon Jun 27 13:52:15 2011 +0200
3.3 @@ -258,6 +258,10 @@
3.4 "") extra_config+=("--without-long-double-128");;
3.5 esac
3.6
3.7 + if [ "${CT_CC_GCC_BUILD_ID}" = "y" ]; then
3.8 + extra_config+=( --enable-linker-build-id )
3.9 + fi
3.10 +
3.11 CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'"
3.12
3.13 # Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532)
3.14 @@ -526,6 +530,10 @@
3.15 "") extra_config+=("--without-long-double-128");;
3.16 esac
3.17
3.18 + if [ "${CT_CC_GCC_BUILD_ID}" = "y" ]; then
3.19 + extra_config+=( --enable-linker-build-id )
3.20 + fi
3.21 +
3.22 if [ "${CT_CC_GCC_ENABLE_PLUGINS}" = "y" ]; then
3.23 extra_config+=( --enable-plugin )
3.24 fi