[PATCH] Make sure to always build with build-ids.
Wed Dec 11 13:35:00 GMT 2019
On Fri, Dec 06, 2019 at 05:22:41PM +0100, Mark Wielaard wrote:
> We really need build-ids for various things. If the system compiler
> doesn't generate build-ids warn and generate them anyway for both the
> binaries and the tests.
I pushed this to master with one change:
> +# We really want build-ids. Warn and force generating them if gcc was
> +# configure without --enable-linker-build-id
> +AC_CACHE_CHECK([whether the compiler generates build-ids], ac_cv_buildid, [dnl
> +AC_LINK_IFELSE([AC_LANG_PROGRAM()],[ac_cv_buildid=yes; readelf -n conftest$EXEEXT | grep -q NT_GNU_BUILD_ID || ac_cv_buildid=no],AC_MSG_FAILURE([unexpected compile failure]))])
> +if test "$ac_cv_buildid" = "no"; then
> + AC_MSG_WARN([compiler doesn't generate build-id by default])
> + CFLAGS="$CFLAGS -Wl,--build-id"
This should have been LDFLAGS="$LDFLAGS -Wl,--build-id"
With this the testsuite now also passes when everything was build with
a gcc that wasn't configured with --enable-linker-build-id (sadly the
default is off).
More information about the Elfutils-devel