This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH] Make sure to always build with build-ids.
- From: Mark Wielaard <mark at klomp dot org>
- To: elfutils-devel at sourceware dot org
- Date: Wed, 11 Dec 2019 14:35:39 +0100
- Subject: Re: [PATCH] Make sure to always build with build-ids.
- References: <20191206162241.3203-1-mark@klomp.org>
Hi,
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"
> +fi
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).
Cheers,
Mark