[krbdev.mit.edu #8910] Building with --enable-static fails when Yasm is available

"Nikhil Benesch via RT" <[email protected]>
Newsgroups gmane.comp.encryption.kerberos.bugs
Message-ID <[email protected]>
Sat May 23 22:41:20 2020: Request 8910 was acted upon.
 Transaction: Ticket created by [email protected]
       Queue: krb5
     Subject: Building with --enable-static fails when Yasm is available
       Owner: Nobody
  Requestors: [email protected]
      Status: new
 Ticket <URL: https://krbdev.mit.edu/rt/Ticket/Display.html?id=8910 >


Building krb5 statically is broken if autoconf is able to find Yasm on the
build system.

    $ ../configure --enable-static --disable-shared
    ...
    checking for yasm... yasm
    ....
    $ make
    make[4]: Entering directory
'/home/benesch/Sites/krb5/src/build/lib/crypto/builtin/aes'
    as   -o iaesx64.o ../../../../../lib/crypto/builtin/aes/iaesx64.s
    ../../../../../lib/crypto/builtin/aes/iaesx64.s: Assembler messages:
    ../../../../../lib/crypto/builtin/aes/iaesx64.s:1: Error: junk at
end of line, first unrecognized character is `['
    ../../../../../lib/crypto/builtin/aes/iaesx64.s:2: Error: junk at
end of line, first unrecognized character is `['

Similar errors continue for many lines.

The error appears to be a missing rule for building iaesx64.o statically using
Yasm. Make falls back to its default rule that uses the system assembler, which
of course is not capable of processing this file.

The following patch fixes the issue for me.

--- a/src/lib/crypto/builtin/aes/Makefile.in
+++ b/src/lib/crypto/builtin/aes/Makefile.in
@@ -34,10 +34,10 @@ GEN_OBJS=\

 all-unix: all-libobjs # aes-gen

-iaesx64@SHOBJEXT@: $(srcdir)/iaesx64.s
+iaesx64@STOBJEXT@ iaesx64@SHOBJEXT@: $(srcdir)/iaesx64.s
        $(YASM) $(AESNI_FLAGS) -o $@ $(srcdir)/iaesx64.s

-iaesx86@SHOBJEXT@: $(srcdir)/iaesx86.s
+iaesx86@STOBJEXT@ iaesx86@SHOBJEXT@: $(srcdir)/iaesx86.s
        $(YASM) $(AESNI_FLAGS) -o $@ $(srcdir)/iaesx86.s

 includes: depend
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.