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)



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'

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index