pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: sudo 1.8.15 fails to build on Darwin (-static-libgcc weirdness)



Hi,

The modified patch applies, but does not have the desired effect.  The
test passes (the flag is passed to the linker ok), but when the time
comes for linking the flag is passed directly to clang, which chokes on
it, as I believe you noticed:

libtool: link: clang -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o .libs/libsudo_util.0.dylib  .libs/event.o .libs/fatal.o .libs/key_val.o .libs/gethostname.o .libs/gettime.o .libs/gidlist.o .libs/lbuf.o .libs/locking.o .libs/parseln.o .libs/progname.o .libs/secure_path.o .libs/setgroups.o .libs/strsplit.o .libs/strtobool.o .libs/strtoid.o .libs/strtomode.o .libs/sudo_conf.o .libs/sudo_debug.o .libs/sudo_dso.o .libs/term.o .libs/ttysize.o .libs/event_select.o .libs/reallocarray.o .libs/utimens.o .libs/memrchr.o .libs/pw_dup.o .libs/closefrom.o .libs/strtonum.o .libs/sha2.o .libs/sig2str.o   -L/usr/lib -L/opt/pkg/lib -ldl  -fstack-protector-strong -static-libgcc   -install_name  /opt/pkg/lib/sudo/libsudo_util.0.dylib -compatibility_version 1 -current_version 1.0 -Wl,-single_module
clang: error: unsupported option '-static-libgcc'
make[1]: *** [libsudo_util.la] Error 1
make: *** [all] Error 2

Looking in the configure script, it seems that it wasn't generated from
the patched configure.ac file.  It might very well be a problem arising
from patching both the configure.ac file (patch-af) and the configure
script (patch-ag).  Only patch-ag ever takes effect...

Andreas

On Sun, Jan 03, 2016 at 11:34:06AM -0500, Greg Troxel wrote:
> 
> Andreas Kusalananda Kähäri <andreas.kahari%icm.uu.se@localhost> writes:
> 
> >     checking whether C compiler accepts -static-libgcc... yes
> >     [...]
> >     clang: error: unsupported option '-static-libgcc'
> 
> There was a recent issue in postgis that seems similar.  Basically,
> clang (and maybe others) passes linker options to the linker, so
> compiling with -c does not link and therefore does not test the flag,
> resulting in a false pass.  In postgis the fix was to change the
> autoconf test to be for a linker flag.
> 
> configure.ac has 4386 lines.  That's kind of scary all by itself.
> 
> I think this is basically the right approach, but I still had
> static-libgcc in LT_LDFLAGS.  I think that's because both configure and
> configure.ac are patched, vs regenerating configure from the patched
> configure.ac, and I only added the change to the configure.ac patch.
> Removing the offending flag from config.status by hand enabled a package
> to be built.
> 
> Index: patches/patch-af
> ===================================================================
> RCS file: /cvsroot/pkgsrc/security/sudo/patches/patch-af,v
> retrieving revision 1.32
> diff -u -p -r1.32 patch-af
> --- patches/patch-af	1 Jan 2016 17:00:49 -0000	1.32
> +++ patches/patch-af	3 Jan 2016 16:30:11 -0000
> @@ -6,6 +6,7 @@ $NetBSD: patch-af,v 1.32 2016/01/01 17:0
>    even if there is krb5-config.  krb5-config dosen't give all definitions for
>    functions (HAVE_KRB5_*).
>  * Remove setting sysconfdir to "/etc".
> +* Check --static-libgcc as a link flag, not compiler flag.
>  
>  --- configure.ac.orig	2015-10-31 23:35:24.000000000 +0000
>  +++ configure.ac
> @@ -57,6 +58,15 @@ $NetBSD: patch-af,v 1.32 2016/01/01 17:0
>       _LIBS="$LIBS"
>       LIBS="${LIBS} ${SUDOERS_LIBS}"
>       AC_CHECK_FUNCS([krb5_verify_user krb5_init_secure_context])
> +@@ -3801,7 +3817,7 @@ dnl GNU ld (which can avoid linking in l
> + dnl This test relies on AC_LANG_WERROR
> + dnl
> + if test -n "$GCC" -a "$lt_cv_prog_gnu_ld" != "yes" -a -n "$GCC"; then
> +-    AX_CHECK_COMPILE_FLAG([-static-libgcc], [LT_LDFLAGS="$LT_LDFLAGS -Wc,-static-libgcc"])
> ++    AX_CHECK_LINK_FLAG([-static-libgcc], [LT_LDFLAGS="$LT_LDFLAGS -Wc,-static-libgcc"])
> + fi
> + 
> + dnl
>  @@ -4167,7 +4183,7 @@ test "$datarootdir" = '${prefix}/share' 
>   test "$docdir" = '${datarootdir}/doc/${PACKAGE_TARNAME}' && docdir='$(datarootdir)/doc/$(PACKAGE_TARNAME)'
>   test "$localedir" = '${datarootdir}/locale' && localedir='$(datarootdir)/locale'



-- 
Andreas Kusalananda Kähäri, Bioinformatics Developer, Uppsala, Sweden
OpenPGP: url=https://db.tt/2zaB1E7y; id=46082BDF
------------------------------------------------------------------------

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index