pkgsrc-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: tnftp build fails on aix 6.1 for 2015Q4
I saw that tnftp has libnetbsd to supply some functions that systems
might be missing. I added vasprintf to that, and now I'm able to
build tnftp with ssl enabled.
I've attached a patch.
On Mon, Jan 4, 2016 at 10:12 PM, J Raynor <jxraynor%gmail.com@localhost> wrote:
> I successfully bootstrapped 2015Q4 on aix 6.1, and now I’m trying to install pkgsrc’s gcc. Pkgsrc tries to install tnftp as a prereq, but the build fails because the linker can’t find vasprintf. I’ve included the relevant output at the bottom of this email.
>
> vasprintf only appears once, in ssl.c If I build tnftp without ssl, it compiles just fine.
>
> I believe vasprintf can’t be found because AIX doesn’t have it. If I were to submit a patch, should I modify ssl.c so it doesn’t need to use vasprintf? Should I provide an implementation of vasprintf for systems that don’t have it?
>
>
>
> gcc -DHAVE_CONFIG_H -DHAVE_TNFTPD_H=1 -D_DEFAULT_CONFDIR=\"/opt/pkgsrc-2015Q4/etc\" -I. -I../libnetbsd -I.. -I.. -I../libedit -I/usr/include -I/usr/include -O -I/usr/include -MT tnftp-progressbar.o -MD -MP -MF .deps/tnftp-progressbar.Tpo -c -o tnftp-progressbar.o `test -f 'progressbar.c' || echo './'`progressbar.c
> mv -f .deps/tnftp-progressbar.Tpo .deps/tnftp-progressbar.Po
> gcc -DHAVE_CONFIG_H -DHAVE_TNFTPD_H=1 -D_DEFAULT_CONFDIR=\"/opt/pkgsrc-2015Q4/etc\" -I. -I../libnetbsd -I.. -I.. -I../libedit -I/usr/include -I/usr/include -O -I/usr/include -MT tnftp-ruserpass.o -MD -MP -MF .deps/tnftp-ruserpass.Tpo -c -o tnftp-ruserpass.o `test -f 'ruserpass.c' || echo './'`ruserpass.c
> mv -f .deps/tnftp-ruserpass.Tpo .deps/tnftp-ruserpass.Po
> gcc -DHAVE_CONFIG_H -DHAVE_TNFTPD_H=1 -D_DEFAULT_CONFDIR=\"/opt/pkgsrc-2015Q4/etc\" -I. -I../libnetbsd -I.. -I.. -I../libedit -I/usr/include -I/usr/include -O -I/usr/include -MT tnftp-util.o -MD -MP -MF .deps/tnftp-util.Tpo -c -o tnftp-util.o `test -f 'util.c' || echo './'`util.c
> mv -f .deps/tnftp-util.Tpo .deps/tnftp-util.Po
> gcc -DHAVE_CONFIG_H -DHAVE_TNFTPD_H=1 -D_DEFAULT_CONFDIR=\"/opt/pkgsrc-2015Q4/etc\" -I. -I../libnetbsd -I.. -I.. -I../libedit -I/usr/include -I/usr/include -O -I/usr/include -MT tnftp-ssl.o -MD -MP -MF .deps/tnftp-ssl.Tpo -c -o tnftp-ssl.o `test -f 'ssl.c' || echo './'`ssl.c
> mv -f .deps/tnftp-ssl.Tpo .deps/tnftp-ssl.Po
> /opt/pkgsrc-2015Q4/bin/pdksh ../libtool --tag=CC --mode=link gcc -O -I/usr/include -L/usr/lib -Wl,-R/usr/lib -Wl,-R/opt/pkgsrc-2015Q4/lib -o tnftp tnftp-cmds.o tnftp-cmdtab.o tnftp-complete.o tnftp-domacro.o tnftp-fetch.o tnftp-ftp.o tnftp-main.o tnftp-progressbar.o tnftp-ruserpass.o tnftp-util.o tnftp-ssl.o ../libnetbsd/libnetbsd.la ../libedit/libedit.la -L/usr/lib -lssl -lcrypto -ltermcap
> libtool: link: gcc -O -I/usr/include -Wl,-R/usr/lib -Wl,-R/opt/pkgsrc-2015Q4/lib -o tnftp tnftp-cmds.o tnftp-cmdtab.o tnftp-complete.o tnftp-domacro.o tnftp-fetch.o tnftp-ftp.o tnftp-main.o tnftp-progressbar.o tnftp-ruserpass.o tnftp-util.o tnftp-ssl.o -L/usr/lib ../libnetbsd/.libs/libnetbsd.a ../libedit/.libs/libedit.a -lssl -lcrypto -ltermcap
> ld: 0706-027 The -R /opt/pkgsrc-2015Q4/lib flag is ignored.
> ld: 0711-317 ERROR: Undefined symbol: .vasprintf
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
> collect2: error: ld returned 8 exit status
> *** Error code 1
>
> Stop.
> bmake[2]: stopped in /home/pkgsrc/pkgsrc-2015Q4/net/tnftp/work/tnftp-20151004/src
> *** Error code 1
>
> Stop.
> bmake[1]: stopped in /home/pkgsrc/pkgsrc-2015Q4/net/tnftp/work/tnftp-20151004
> *** Error code 1
>
> Stop.
> bmake: stopped in /home/pkgsrc/pkgsrc-2015Q4/net/tnftp/work/tnftp-20151004
> *** Error code 1
>
> Stop.
> bmake[2]: stopped in /home/pkgsrc/pkgsrc-2015Q4/net/tnftp
> *** Error code 1
>
> Stop.
> bmake[1]: stopped in /home/pkgsrc/pkgsrc-2015Q4/net/tnftp
> *** Error code 1
>
> Stop.
> bmake: stopped in /home/pkgsrc/pkgsrc-2015Q4/lang/gcc49
>
>
>
Index: files/configure
===================================================================
RCS file: /cvsroot/pkgsrc/net/tnftp/files/configure,v
retrieving revision 1.17
diff -u -r1.17 configure
--- files/configure 4 Oct 2015 14:44:06 -0000 1.17
+++ files/configure 8 Jan 2016 04:43:19 -0000
@@ -14390,6 +14390,18 @@
fi
+ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf"
+if test "x$ac_cv_func_vasprintf" = xyes; then :
+ $as_echo "#define HAVE_VASPRINTF 1" >>confdefs.h
+
+else
+ case " $LIBOBJS " in
+ *" vasprintf.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS vasprintf.$ac_objext"
+ ;;
+esac
+
+fi
for ac_func in getcwd gethostbyaddr gethostbyname gethostbyname2 gethostname \
getpass getpassphrase getpgrp gettimeofday isascii \
Index: files/configure.ac
===================================================================
RCS file: /cvsroot/pkgsrc/net/tnftp/files/configure.ac,v
retrieving revision 1.7
diff -u -r1.7 configure.ac
--- files/configure.ac 4 Oct 2015 14:44:06 -0000 1.7
+++ files/configure.ac 8 Jan 2016 04:43:19 -0000
@@ -298,7 +298,7 @@
AC_REPLACE_FUNCS([dirname err fgetln getaddrinfo getnameinfo \
inet_ntop inet_pton mkstemp setprogname sl_init snprintf \
strdup strerror strlcat strlcpy strptime strsep strunvis \
- strvis timegm usleep utimes])
+ strvis timegm usleep utimes vasprintf])
AC_CHECK_FUNCS([getcwd gethostbyaddr gethostbyname gethostbyname2 gethostname \
getpass getpassphrase getpgrp gettimeofday isascii \
memchr memmove memset realpath regcomp \
Index: files/tnftp.h
===================================================================
RCS file: /cvsroot/pkgsrc/net/tnftp/files/tnftp.h,v
retrieving revision 1.14
diff -u -r1.14 tnftp.h
--- files/tnftp.h 4 Nov 2014 22:38:26 -0000 1.14
+++ files/tnftp.h 8 Jan 2016 04:43:19 -0000
@@ -442,6 +442,10 @@
int utimes(const char *, const struct timeval *);
#endif
+#if !defined(HAVE_VASPRINTF)
+int vasprintf(char **, const char *, va_list);
+#endif
+
#if !defined(HAVE_MEMMOVE)
# define memmove(a,b,c) bcopy((b),(a),(c))
/* XXX: add others #defines for borken systems? */
Index: files/libnetbsd/Makefile.in
===================================================================
RCS file: /cvsroot/pkgsrc/net/tnftp/files/libnetbsd/Makefile.in,v
retrieving revision 1.5
diff -u -r1.5 Makefile.in
--- files/libnetbsd/Makefile.in 31 Oct 2014 18:59:32 -0000 1.5
+++ files/libnetbsd/Makefile.in 8 Jan 2016 04:43:19 -0000
@@ -39,7 +39,8 @@
err.c fgetln.c getaddrinfo.c getnameinfo.c glob.c inet_ntop.c \
inet_pton.c mkstemp.c setprogname.c sl_init.c snprintf.c \
strdup.c strerror.c strlcat.c strlcpy.c strptime.c strsep.c \
- strtoll.c strunvis.c strvis.c timegm.c usleep.c utimes.c
+ strtoll.c strunvis.c strvis.c timegm.c usleep.c utimes.c \
+ vasprintf.c
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/buildaux/ax_check_openssl.m4 \
$(top_srcdir)/buildaux/libtool.m4 \
@@ -300,6 +301,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/timegm.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/usleep.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/utimes.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/vasprintf.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
Index: files/libnetbsd/vasprintf.c
===================================================================
RCS file: files/libnetbsd/vasprintf.c
diff -N files/libnetbsd/vasprintf.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ files/libnetbsd/vasprintf.c 8 Jan 2016 04:43:19 -0000
@@ -0,0 +1,30 @@
+
+#include "tnftp.h"
+
+int
+vasprintf(char **str, const char *fmt, va_list ap)
+{
+
+ int len;
+ va_list ap2;
+
+ *str = NULL;
+ va_copy(ap2, ap);
+
+ len = vsnprintf(NULL, 0, fmt, ap);
+ if (len < 0 || (*str = malloc(len + 1)) == NULL) {
+ va_end(ap2);
+ return (-1);
+ }
+
+ if ((len = vsnprintf(*str, len + 1, fmt, ap2)) < 0) {
+ free(*str);
+ *str = NULL;
+ len = -1;
+ }
+
+ va_end(ap2);
+
+ return (len);
+}
+
Home |
Main Index |
Thread Index |
Old Index