Nikos Mavrogiannopoulos <[email protected]> writes:
> On Tue, Nov 25, 2014 at 10:36 AM, Niels Möller <[email protected]> wrote:
>
>> I think it lacked a linker script for hogweed, with symbol version
>> tracking libhogweed's major version rather than libnettle's.
>
> Attached a patch which separates the .map files.
Looks good, thanks. I'll try to do some testing and see if I understand this,
and
then merge on the master branch.
> --- a/.gitignore
> +++ b/.gitignore
> @@ -67,3 +67,6 @@ core
> /nettle.tps
> /nettle.vr
> /nettle.vrs
> +*.po
> +/libhogweed.map
> +/libnettle.map
I take it adding *.po is not really intended? These files were
eliminated a while ago.
> +# gl_LD_VERSION_SCRIPT
> +# --------------------
> +# Check if LD supports linker scripts, and define automake conditional
> +# HAVE_LD_VERSION_SCRIPT if so.
I see no automake-things in here. Right?
> +AC_DEFUN([LD_VERSION_SCRIPT],
> +[
> + AC_ARG_ENABLE([ld-version-script],
> + AS_HELP_STRING([--enable-ld-version-script],
> + [enable linker version script (default is enabled when possible)]),
> + [have_ld_version_script=$enableval], [])
> + if test -z "$have_ld_version_script"; then
> + AC_MSG_CHECKING([if LD -Wl,--version-script works])
> + save_LDFLAGS="$LDFLAGS"
> + LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
> + cat > conftest.map <<EOF
> +foo
> +EOF
> + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
> + [accepts_syntax_errors=yes], [accepts_syntax_errors=no])
> + if test "$accepts_syntax_errors" = no; then
> + cat > conftest.map <<EOF
> +VERS_1 {
> + global: sym;
> +};
> +
> +VERS_2 {
> + global: sym;
> +} VERS_1;
> +EOF
> + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
> + [have_ld_version_script=yes],
> [have_ld_version_script=no])
> + else
> + have_ld_version_script=no
> + fi
> + rm -f conftest.map
> + LDFLAGS="$save_LDFLAGS"
> + AC_MSG_RESULT($have_ld_version_script)
> + fi
> + if test "$have_ld_version_script" = "yes";then
> + EXTRA_LINKER_FLAGS="-Wl,--version-script=\$(srcdir)/libnettle.map"
> + AC_SUBST(EXTRA_LINKER_FLAGS)
> +
> EXTRA_HOGWEED_LINKER_FLAGS="-Wl,--version-script=\$(srcdir)/libhogweed.map"
> + AC_SUBST(EXTRA_HOGWEED_LINKER_FLAGS)
> + fi
It would in some way be cleaner to have this nettle-specific setup in
configure.ac, rather than in aclocal.m4. Maybe the macro could have an
optional if-true argument? Or one could just move the test of
have_ld_version_script.
Regards,
/Niels
--
Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.
_______________________________________________
nettle-bugs mailing list
[email protected]
http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs