On Wed, Feb 25, 2015 at 09:04:57AM +1100, Darren Tucker wrote:> On Tue, Feb 24, 2015 at 12:11:16PM -0800, Kevin Brott wrote: > > ld: Unsatisfied symbol "xstrdup" in file > > openbsd-compat//libopenbsd-compat.a[bsd-misc.o] > > How about removing the dependency on xmalloc? eg (untested):Shoulda tested it. Now one that will compile: diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index 65e8003..40efc87 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c @@ -31,8 +31,6 @@ #include <time.h> #include <unistd.h> -#include "xmalloc.h" - #ifndef HAVE___PROGNAME char *__progname; #endif @@ -43,13 +41,12 @@ char *__progname; */ char *ssh_get_progname(char *argv0) { + char *p, *q; #ifdef HAVE___PROGNAME extern char *__progname; - return xstrdup(__progname); + p = progname; #else - char *p; - if (argv0 == NULL) return ("unknown"); /* XXX */ p = strrchr(argv0, '/'); @@ -57,9 +54,12 @@ char *ssh_get_progname(char *argv0) p = argv0; else p++; - - return (xstrdup(p)); #endif + if ((q = strdup(p)) == NULL) { + perror("strdup"); + exit(1); + } + return q; } #ifndef HAVE_SETLOGIN -- Darren Tucker (dtucker at zip.com.au) GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69 Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement.
On Wed, 25 Feb 2015, Darren Tucker wrote:> On Wed, Feb 25, 2015 at 09:04:57AM +1100, Darren Tucker wrote: > > On Tue, Feb 24, 2015 at 12:11:16PM -0800, Kevin Brott wrote: > > > ld: Unsatisfied symbol "xstrdup" in file > > > openbsd-compat//libopenbsd-compat.a[bsd-misc.o] > > > > How about removing the dependency on xmalloc? eg (untested): > > Shoulda tested it. Now one that will compile:even finer by me
On Wed, Feb 25, 2015 at 09:13:22AM +1100, Darren Tucker wrote:> On Wed, Feb 25, 2015 at 09:04:57AM +1100, Darren Tucker wrote: > > On Tue, Feb 24, 2015 at 12:11:16PM -0800, Kevin Brott wrote: > > > ld: Unsatisfied symbol "xstrdup" in file > > > openbsd-compat//libopenbsd-compat.a[bsd-misc.o] > > > > How about removing the dependency on xmalloc? eg (untested): > > Shoulda tested it. Now one that will compile:Sigh. And now the right patch from the tree that compiled. (djm: I get the idea :-) diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index 65e8003..f7be415 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c @@ -31,8 +31,6 @@ #include <time.h> #include <unistd.h> -#include "xmalloc.h" - #ifndef HAVE___PROGNAME char *__progname; #endif @@ -43,13 +41,12 @@ char *__progname; */ char *ssh_get_progname(char *argv0) { + char *p, *q; #ifdef HAVE___PROGNAME extern char *__progname; - return xstrdup(__progname); + p = __progname; #else - char *p; - if (argv0 == NULL) return ("unknown"); /* XXX */ p = strrchr(argv0, '/'); @@ -57,9 +54,12 @@ char *ssh_get_progname(char *argv0) p = argv0; else p++; - - return (xstrdup(p)); #endif + if ((q = strdup(p)) == NULL) { + perror("strdup"); + exit(1); + } + return q; } #ifndef HAVE_SETLOGIN -- Darren Tucker (dtucker at zip.com.au) GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69 Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement.
On Wed, Feb 25, 2015 at 09:20:01AM +1100, Darren Tucker wrote: [...]> Sigh. And now the right patch from the tree that compiled. > (djm: I get the idea :-)Tim: is this sufficient to back out the "Work around finicky USL linker" change? https://anongit.mindrot.org/openssh.git/commit/?id=d1db656021d0cd8c001a6692f772f1de29b67c8b> diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c > index 65e8003..f7be415 100644 > --- a/openbsd-compat/bsd-misc.c > +++ b/openbsd-compat/bsd-misc.c > @@ -31,8 +31,6 @@ > #include <time.h> > #include <unistd.h> > > -#include "xmalloc.h" > - > #ifndef HAVE___PROGNAME > char *__progname; > #endif > @@ -43,13 +41,12 @@ char *__progname; > */ > char *ssh_get_progname(char *argv0) > { > + char *p, *q; > #ifdef HAVE___PROGNAME > extern char *__progname; > > - return xstrdup(__progname); > + p = __progname; > #else > - char *p; > - > if (argv0 == NULL) > return ("unknown"); /* XXX */ > p = strrchr(argv0, '/'); > @@ -57,9 +54,12 @@ char *ssh_get_progname(char *argv0) > p = argv0; > else > p++; > - > - return (xstrdup(p)); > #endif > + if ((q = strdup(p)) == NULL) { > + perror("strdup"); > + exit(1); > + } > + return q; > } > > #ifndef HAVE_SETLOGIN-- Darren Tucker (dtucker at zip.com.au) GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69 Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement.
On Tue, Feb 24, 2015 at 2:20 PM, Darren Tucker <dtucker at zip.com.au> wrote:> On Wed, Feb 25, 2015 at 09:13:22AM +1100, Darren Tucker wrote: > > On Wed, Feb 25, 2015 at 09:04:57AM +1100, Darren Tucker wrote: > > > On Tue, Feb 24, 2015 at 12:11:16PM -0800, Kevin Brott wrote: > > > > ld: Unsatisfied symbol "xstrdup" in file > > > > openbsd-compat//libopenbsd-compat.a[bsd-misc.o] > > > > > > How about removing the dependency on xmalloc? eg (untested): > > > > Shoulda tested it. Now one that will compile: > > Sigh. And now the right patch from the tree that compiled. > (djm: I get the idea :-) > > diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c > index 65e8003..f7be415 100644 > >Applying this patch against the git clone from this morning, the patched openssh-SNAP-20150225.tar.gz that worked finally for AIX and the git clone I just pulled gives me: patching file openbsd-compat/bsd-misc.c Hunk #2 FAILED at 41. Hunk #3 FAILED at 54. 2 out of 3 hunks FAILED -- saving rejects to file openbsd-compat/bsd-misc.c.rej Suggestions?