root@:/openssh-6.7p1>oslevel 5.3.0.0 root@:/openssh-6.7p1>./configure --prefix=/usr --sysconfdir=/etc/ssh ... OpenSSH has been configured with the following options: User binaries: /usr/bin System binaries: /usr/sbin Configuration files: /etc/ssh Askpass program: /usr/libexec/ssh-askpass Manual pages: /usr/share/man/manX PID file: /etc/ssh Privilege separation chroot path: /var/empty sshd default user PATH: /usr/bin:/bin:/usr/sbin:/sbin Manpage format: man PAM support: no OSF SIA support: no KerberosV support: no SELinux support: no Smartcard support: S/KEY support: no MD5 password support: no libedit support: no Solaris process contract support: no Solaris project support: no IP address in $DISPLAY hack: no Translate v4 in v6 hack: no BSD Auth support: no Random number source: OpenSSL internal ONLY Privsep sandbox style: rlimit Host: powerpc-ibm-aix5.3.0.0 Compiler: cc -qlanglvl=extc89 Compiler flags: -g Preprocessor flags: Linker flags: -blibpath:/usr/lib:/lib Libraries: -lcrypto -lz root@:/openssh-6.7p1>make ... "/usr/include/stdarg.h", line 89.9: 1506-236 (W) Macro name va_copy has been redefined. "/usr/include/stdarg.h", line 89.9: 1506-358 (I) "va_copy" is defined on line 829 of defines.h. cc -qlanglvl=extc89 -g -I. -I. -DSSHDIR=\"/etc/ssh\" -D_PATH_SSH_PROGRAM=\"/usr/bin/ssh\" -D_PATH_SSH_ASKPASS_DEFAULT=\"/usr/libexec/ssh-askpass\" -D_PATH_SFTP_SERVER=\"/usr/libexec/sftp-server\" -D_PATH_SSH_KEY_SIGN=\"/usr/libexec/ssh-keysign\" -D_PATH_SSH_PKCS11_HELPER=\"/usr/libexec/ssh-pkcs11-helper\" -D_PATH_SSH_PIDDIR=\"/etc/ssh\" -D_PATH_PRIVSEP_CHROOT_DIR=\"/var/empty\" -DHAVE_CONFIG_H -c misc.c -o misc.o ... cc -qlanglvl=extc89 -o ssh ssh.o readconf.o clientloop.o sshtty.o sshconnect.o sshconnect1.o sshconnect2.o mux.o roaming_common.o roaming_client.o -L. -Lopenbsd-compat/ -blibpath:/usr/lib:/lib -lssh -lopenbsd-compat -lcrypto -lz ld: 0711-317 ERROR: Undefined symbol: .va_copy ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. make: The error code from the last command is 8. Stop. root@:/openssh-6.7p1>
See also bug#2315. I thought this was fixed in https://anongit.mindrot.org/openssh.git/commit/?id=cf5392c2db2bb1dbef9818511d34056404436109 That's dependent on configure correctly detecting va_copy, though. Could you please attach (using "Add an attachment") the output of ./configure, and the config.log file it generated?
Also, 6.7 is several years old. Do you have the problem using a current version?
Created attachment 2830 [details] the output of ./configure
(In reply to Darren Tucker from comment #2) > Also, 6.7 is several years old. Do you have the problem using a > current version? Yes, I tried to build 7.2p2 also, it showed the same error messages.
(In reply to Mason from comment #3) > Created attachment 2830 [details] > the output of ./configure checking whether va_copy exists... no checking whether __va_copy exists... no so it's not detecting va_copy. The reason would be in config.log which you haven't attached yet.
Created attachment 2831 [details] config.log
(In reply to Darren Tucker from comment #5) > (In reply to Mason from comment #3) > > Created attachment 2830 [details] > > the output of ./configure > > checking whether va_copy exists... no > checking whether __va_copy exists... no > > so it's not detecting va_copy. The reason would be in config.log > which you haven't attached yet. Just uploaded config.log. Thanks!
(In reply to Mason from comment #7) [...] > Just uploaded config.log. Thanks. The log has: configure:15964: checking whether va_copy exists configure:15984: cc -qlanglvl=extc89 -o conftest -g conftest.c -lcrypto -lz >&5 ld: 0711-317 ERROR: Undefined symbol: .va_copy ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. configure:15984: $? = 8 configure: failed program was: [...] | #include <stdarg.h> | va_list x,y; | | int | main () | { | va_copy(x,y); however the compiler error indicates that stdarg.h has va_copy, at least under some conditions. In stdarg.h, is the definition of va_copy inside an ifdef or something? From bug#2315: maybe try "CC=xlc ./configure [other opts]"
(In reply to Darren Tucker from comment #8) > (In reply to Mason from comment #7) > [...] > > Just uploaded config.log. > > Thanks. The log has: > > configure:15964: checking whether va_copy exists > configure:15984: cc -qlanglvl=extc89 -o conftest -g conftest.c > -lcrypto -lz >&5 > ld: 0711-317 ERROR: Undefined symbol: .va_copy > ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more > information. > configure:15984: $? = 8 > configure: failed program was: > [...] > | #include <stdarg.h> > | va_list x,y; > | > | int > | main () > | { > | va_copy(x,y); > > however the compiler error indicates that stdarg.h has va_copy, at > least under some conditions. In stdarg.h, is the definition of > va_copy inside an ifdef or something? > > From bug#2315: maybe try "CC=xlc ./configure [other opts]" I tried "CC=xlc ./configure [other opts]", it's not work for me. It ended up with the same error. stdarg.h has the definition of va_copy inside an ifdef. #ifdef _ISOC99_SOURCE #define va_copy(__list1,__list2) ((void)(__list1 = __list2)) #endif Also, I uploaded stdarg.h
Created attachment 2833 [details] stdarg.h
Ah, I think the warning from stdarg.h is a red herring. Both stdarg.h and defines.h will define a va_copy and either should work. Instead, I think there's a source file that includes neither but still uses va_copy. If you run "nm" on all of the .o files, you should find one that reports "U va_copy" or similar. Failing that, "grep va_copy `find . -type f`" should find it.
(In reply to Darren Tucker from comment #11) > Failing that, "grep va_copy `find . -type f`" should find it. make that grep va_cpy `find . -type f -a -name \*.o`
(In reply to Darren Tucker from comment #12) > (In reply to Darren Tucker from comment #11) > > Failing that, "grep va_copy `find . -type f`" should find it. > > make that > > grep va_cpy `find . -type f -a -name \*.o` root@:/openssh-6.7p1>nm *.o | grep va_copy .va_copy U - root@:/openssh-6.7p1>grep va_copy `find . -type f` ./ChangeLog: - (dtucker) [defines.h] Add va_copy if we don't already have it, taken from ./configure.ac:AC_CACHE_CHECK([whether va_copy exists], ac_cv_have_va_copy, [ ./configure.ac: ]], [[ va_copy(x,y); ]])], ./configure.ac: [ ac_cv_have_va_copy="yes" ], ./configure.ac: [ ac_cv_have_va_copy="no" ./configure.ac:if test "x$ac_cv_have_va_copy" = "xyes" ; then ./configure.ac: AC_DEFINE([HAVE_VA_COPY], [1], [Define if va_copy exists]) ./configure.ac:AC_CACHE_CHECK([whether __va_copy exists], ac_cv_have___va_copy, [ ./configure.ac: ]], [[ __va_copy(x,y); ]])], ./configure.ac: [ ac_cv_have___va_copy="yes" ], [ ac_cv_have___va_copy="no" ./configure.ac:if test "x$ac_cv_have___va_copy" = "xyes" ; then ./configure.ac: AC_DEFINE([HAVE___VA_COPY], [1], [Define if __va_copy exists]) ./defines.h:# define va_copy(dest, src) __va_copy(dest, src) ./defines.h:# define va_copy(dest, src) (dest) = (src) ./config.h.in:/* Define if va_copy exists */ ./config.h.in:/* Define if __va_copy exists */ ./configure:{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether va_copy exists" >&5 ./configure:$as_echo_n "checking whether va_copy exists... " >&6; } ./configure:if ${ac_cv_have_va_copy+:} false; then : ./configure: va_copy(x,y); ./configure: ac_cv_have_va_copy="yes" ./configure: ac_cv_have_va_copy="no" ./configure:{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_va_copy" >&5 ./configure:$as_echo "$ac_cv_have_va_copy" >&6; } ./configure:if test "x$ac_cv_have_va_copy" = "xyes" ; then ./configure:{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __va_copy exists" >&5 ./configure:$as_echo_n "checking whether __va_copy exists... " >&6; } ./configure:if ${ac_cv_have___va_copy+:} false; then : ./configure: __va_copy(x,y); ./configure: ac_cv_have___va_copy="yes" ./configure: ac_cv_have___va_copy="no" ./configure:{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have___va_copy" >&5 ./configure:$as_echo "$ac_cv_have___va_copy" >&6; } ./configure:if test "x$ac_cv_have___va_copy" = "xyes" ; then ./config.log:configure:15964: checking whether va_copy exists ./config.log:ld: 0711-317 ERROR: Undefined symbol: .va_copy ./config.log:| va_copy(x,y); ./config.log:configure:16002: checking whether __va_copy exists ./config.log:ld: 0711-317 ERROR: Undefined symbol: .__va_copy ./config.log:| __va_copy(x,y); ./config.log:ac_cv_have___va_copy=no ./config.log:ac_cv_have_va_copy=no ./config.h:/* Define if va_copy exists */ ./config.h:/* Define if __va_copy exists */ ./libssh.a: ./openbsd-compat/bsd-asprintf.c:# define VA_COPY(dest, src) va_copy(dest, src) ./openbsd-compat/bsd-asprintf.c:# define VA_COPY(dest, src) __va_copy(dest, src) ./openbsd-compat/bsd-snprintf.c: * Fix usage of va_list passed as an arg. Use __va_copy before using it ./openbsd-compat/bsd-snprintf.c:# define VA_COPY(dest, src) va_copy(dest, src) ./openbsd-compat/bsd-snprintf.c:# define VA_COPY(dest, src) __va_copy(dest, src) ./sshbuf-getput-basic.c: va_copy(ap2, ap); ./sshbuf-getput-basic.c: va_copy(ap2, ap); ./sshbuf-getput-basic.o: root@:/openssh-6.7p1> root@:/openssh-6.7p1> grep va_cpy `find . -type f -a -name \*.o` ./sshbuf-getput-basic.o:
(In reply to Mason from comment #13) > root@:/openssh-6.7p1> grep va_cpy `find . -type f -a -name \*.o` > ./sshbuf-getput-basic.o: I assume "va_cpy" is a transcription error? Assuming so, it looks like sshbuf-getput-basic.c is the culprit. Next question is: why? Even in 6.7p1, sshbuf-getput-basic.c includes "includes.h" which includes "defines.h". defines.h has: #ifndef HAVE_VA_COPY # ifdef HAVE___VA_COPY # define va_copy(dest, src) __va_copy(dest, src) # else # define va_copy(dest, src) (dest) = (src) # endif #endif which should have taken care of it. The other thing of note is that sshbuf-getput-basic.c uses va_copy without including stdarg.h although it probably should. Maybe try adding #include <stdarg.h> with the rest of the includes at the start of sshbuf-getput-basic.c ?
(In reply to Darren Tucker from comment #14) > (In reply to Mason from comment #13) > > root@:/openssh-6.7p1> grep va_cpy `find . -type f -a -name \*.o` > > ./sshbuf-getput-basic.o: > > I assume "va_cpy" is a transcription error? Assuming so, it looks > like sshbuf-getput-basic.c is the culprit. Next question is: why? > > Even in 6.7p1, sshbuf-getput-basic.c includes "includes.h" which > includes "defines.h". defines.h has: > > #ifndef HAVE_VA_COPY > # ifdef HAVE___VA_COPY > # define va_copy(dest, src) __va_copy(dest, src) > # else > # define va_copy(dest, src) (dest) = (src) > # endif > #endif > > which should have taken care of it. > > The other thing of note is that sshbuf-getput-basic.c uses va_copy > without including stdarg.h although it probably should. > > Maybe try adding > > #include <stdarg.h> > > with the rest of the includes at the start of sshbuf-getput-basic.c ? I tried, it ended with exactly the same error messages.
(In reply to Mason from comment #15) > I tried, it ended with exactly the same error messages. I'm kinda stumped. Does anything in the system headers do "#undef va_copy" ?
maybe worth a try: CC="xlc -qlanglvl=extc99" ./configure && make clean && make
(In reply to Darren Tucker from comment #17) > maybe worth a try: > > CC="xlc -qlanglvl=extc99" ./configure && make clean && make still same error messages.
(In reply to Mason from comment #18) > (In reply to Darren Tucker from comment #17) > > maybe worth a try: > > > > CC="xlc -qlanglvl=extc99" ./configure && make clean && make > > still same error messages. OK, now I'm stumped. Could you please attach the config.h file generated by configure? Just to check: you are doing these tests in a cleanly extracted copy of the source tarball? If the compiler can find a config.h somewhere in its path (eg if you've run ./configure in the top-level directory then tried re-running configure in another directory) then it'll use the wrong config.h file.
(In reply to Darren Tucker from comment #19) > (In reply to Mason from comment #18) > > (In reply to Darren Tucker from comment #17) > > > maybe worth a try: > > > > > > CC="xlc -qlanglvl=extc99" ./configure && make clean && make > > > > still same error messages. > > OK, now I'm stumped. Could you please attach the config.h file > generated by configure? > > Just to check: you are doing these tests in a cleanly extracted copy > of the source tarball? If the compiler can find a config.h > somewhere in its path (eg if you've run ./configure in the top-level > directory then tried re-running configure in another directory) then > it'll use the wrong config.h file. root@:/openssh-6.7p1>./configure --prefix=/usr --sysconfdir=/etc/ssh root@:/openssh-6.7p1>make As you can see, I run all the commands in the same path. uploaded config.h. Thank you!
Created attachment 2835 [details] config.h
(In reply to Mason from comment #21) > Created attachment 2835 [details] > config.log config.h instead please.
(In reply to Mason from comment #20) > root@:/openssh-6.7p1>./configure --prefix=/usr --sysconfdir=/etc/ssh > root@:/openssh-6.7p1>make You should also "make clean" before "make", the dependencies don't always catch everything (they should, but I'm always suspicious).
(In reply to Darren Tucker from comment #23) > (In reply to Mason from comment #20) > > root@:/openssh-6.7p1>./configure --prefix=/usr --sysconfdir=/etc/ssh > > root@:/openssh-6.7p1>make > > You should also "make clean" before "make", the dependencies don't > always catch everything (they should, but I'm always suspicious). Actually, I run the "make clean" every time, it didn't change anything.
Comment on attachment 2835 [details] config.h Oh, right file, wrong description.
(In reply to Darren Tucker from comment #25) > Comment on attachment 2835 [details] > config.h > > Oh, right file, wrong description. Any suggestions?
(In reply to Mason from comment #26) > Any suggestions? I don't understand why it doesn't work. I do have access to an AIX box however it doesn't have xlc. I was hoping to use the config.h you supplied to figure out why it doesn't work, but I haven't done that yet. If you need to get it built right now, I'd suggest using 7.2p2 and adding this line to sshbuf-getput-basic.c after all the #defines and #includes: #define va_copy(dest, src) (dest) = (src)
(In reply to Darren Tucker from comment #27) > I don't understand why it doesn't work. There might be a hint here: https://lists.gnu.org/archive/html/bug-gnulib/2008-02/msg00139.html """ Turns out that even though config.h correctly has '#define va_copy gl_va_copy', xlc's stddef.h #undefs va_copy and does not define it to the builtin. xlc's stdarg.h also does not have any include guards, so you can not #include <stdarg.h> then #define va_copy, as the next time stdarg.h gets included it will get undefined all over again. """ which sounds a lot like what we're seeing. Is there another stdarg.h file somewhere that xlc picks up instead of the system one, or does one of the files included by stdarg.h contain "#undef va_copy" ?
Created attachment 2842 [details] move VA_COPY into openbsd-compat.h and use in sshbuf-getput-basic.c If comment#27 checks out, please try this patch.
Did the patch help? if so I'd like to include it in the next release.
(In reply to Darren Tucker from comment #30) > Did the patch help? if so I'd like to include it in the next > release. Sorry, my test server was removed, I can't continue the testing. I would like to put it on hold, and will continue the testing once I get another server. Thanks!
I'm pretty sure this is the right thing to do so I've committed it for the next release. (if there are still problems when you are able to test it please reopen this bug)
Bulk mark issues CLOSED in 7.3 release