[PATCH libevdev] Check for GNU ld and use the flags depending on the outcome

David Herrmann dh.herrmann at gmail.com
Tue Sep 3 04:34:40 PDT 2013


Hi

On Tue, Sep 3, 2013 at 3:11 AM, Peter Hutterer <peter.hutterer at who-t.net> wrote:
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
>  configure.ac         | 5 +++++
>  libevdev/Makefile.am | 5 +----
>  2 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 9b56500..b2fc7ff 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -32,6 +32,11 @@ AC_PROG_CC
>  # Initialize libtool
>  LT_PREREQ([2.2])
>  LT_INIT
> +LT_PATH_LD
> +if test "x$lt_cv_prog_gnu_ld" = "xyes"; then
> +       GNU_LD_FLAGS="-Wl,--as-needed -Wl,--gc-sections -Wl,-z,relro -Wl,-z,now"
> +       AC_SUBST(GNU_LD_FLAGS)
> +fi

I am not sure what LT_PATH_LD does for gnu-ld.gold compared to
gnu-ld.bfd. But I just checked, the gold linker supports our flags so
it works with any GNU-ld.

Reviewed-by: David Herrmann <dh.herrmann at gmail.com>

>
>  PKG_PROG_PKG_CONFIG()
>  PKG_CHECK_MODULES(CHECK, [check], [HAVE_CHECK="yes"], [HAVE_CHECK="no"])
> diff --git a/libevdev/Makefile.am b/libevdev/Makefile.am
> index 64adf58..851a5a0 100644
> --- a/libevdev/Makefile.am
> +++ b/libevdev/Makefile.am
> @@ -15,10 +15,7 @@ libevdev_la_LDFLAGS = \
>         -version-info $(LIBEVDEV_LT_VERSION) \
>         -export-symbols-regex '^libevdev_' \
>         $(GCOV_LDFLAGS) \
> -       -Wl,--as-needed \
> -       -Wl,--gc-sections \
> -       -Wl,-z,relro \
> -       -Wl,-z,now
> +       $(GNU_LD_FLAGS)
>
>  libevdevincludedir = $(includedir)/libevdev-1.0/libevdev
>  libevdevinclude_HEADERS = libevdev.h libevdev-uinput.h
> --
> 1.8.2.1
>


More information about the Input-tools mailing list