vanilla build of 7.7p1 release on linux/4.17 fails with gcc8 @ "/usr/bin/ld: unrecognized option '-Wl,-z,retpolineplt'"

Darren Tucker dtucker at dtucker.net
Fri Jun 8 13:37:55 AEST 2018


On 8 June 2018 at 12:21, Darren Tucker <dtucker at dtucker.net> wrote:
> On 8 June 2018 at 12:09, PGNet Dev <pgnet.dev at gmail.com> wrote:
> [...]
>>         /usr/bin/ld -o ssh ssh.o readconf.o clientloop.o sshtty.o sshconnect.o sshconnect2.o mux.o -L. -Lopenbsd-compat/  -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -fstack-protector-strong -pie  -lssh -lopenbsd-compat  -lutil -lz  -lcrypt -lresolv
>>         /usr/bin/ld: unrecognized option '-Wl,-z,relro'
>
> That's a slightly different problem: -Wl is a gcc flag that means
> "pass the following flag through to the linker".  Since AC_LINK_IFLESE
> uses $CC and not $LD, this works in configure, but apparently bare ld
> does not understand -Wl.  The only way I can think of right now to fix
> that is to manually invoke $LD inside the test macro.  Lemme have a
> bit more of a think.

Looking into autoconf some more it appears that its C language support
does not include $LD at all:
https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=blob;f=lib/autoconf/c.m4;h=42c6ac1b1c29748ef7a9f9792301e3280b5be049;hb=HEAD#l65

ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS
conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'

I'm thinking we should remove the ability to set $LD and if you want
to override the linker you would have to use the corresponding
compiler option such as gcc's -fuse-ld.  That would be simpler than
trying to code around this particular problem.

-- 
Darren Tucker (dtucker at dtucker.net)
GPG key 11EAA6FA / A86E 3E07 5B19 5880 E860  37F4 9357 ECEF 11EA A6FA (new)
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.


More information about the openssh-unix-dev mailing list