Cannot build latest krb5 on Mac 10.9

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Cannot build latest krb5 on Mac 10.9

Weijun Wang
Hi All

I just git cloned krb5 from github and cannot build it on my OS X 10.9
with Xcode 5. The error is

ld: warning: ignoring file builtin/aes/iaesx64.so, file was built for
unsupported file format ( 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 ) which is not the architecture being
linked (x86_64): builtin/aes/iaesx64.so
Undefined symbols for architecture x86_64:
   "_k5_iDec128_CBC", referenced from:
       _cbc_dec in aes.so
   "_k5_iDecExpandKey128", referenced from:
       _krb5int_aes_decrypt in aes.so
   "_k5_iDec256_CBC", referenced from:
       _cbc_dec in aes.so
   "_k5_iEnc128_CBC", referenced from:
       _cbc_enc in aes.so
   "_k5_iDecExpandKey256", referenced from:
       _krb5int_aes_decrypt in aes.so
   "_k5_iEnc256_CBC", referenced from:
       _cbc_enc in aes.so
   "_k5_iEncExpandKey128", referenced from:
       _krb5int_aes_encrypt in aes.so
   "_k5_iEncExpandKey256", referenced from:
       _krb5int_aes_encrypt in aes.so
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
make[2]: *** [libk5crypto.3.1.dylib] Error 1
make[1]: *** [all-recurse] Error 1
make: *** [all-recurse] Error 1

The so files in builtin/aes are

$ file lib/crypto/builtin/aes/*.so
lib/crypto/builtin/aes/aescrypt.so: Mach-O 64-bit object x86_64
lib/crypto/builtin/aes/aeskey.so:   Mach-O 64-bit object x86_64
lib/crypto/builtin/aes/aestab.so:   Mach-O 64-bit object x86_64
lib/crypto/builtin/aes/iaesx64.so:  ELF 64-bit LSB relocatable, x86-64,
version 1 (SYSV), not stripped

So this iaesx64.so has a different arch. Could that be the problem?

Thanks
Max
_______________________________________________
krbdev mailing list             [hidden email]
https://mailman.mit.edu/mailman/listinfo/krbdev
Reply | Threaded
Open this post in threaded view
|

Re: Cannot build latest krb5 on Mac 10.9

Greg Hudson
On 12/19/2013 09:52 AM, Weijun Wang wrote:
> So this iaesx64.so has a different arch. Could that be the problem?

Configuring with --disable-aesni should work around this for now.

We either need to restrict AESNI support to ELF platforms, or compile
the AESNI assembly files with the right yasm -f option for OS X if that
works.  I'll work with some Mac users on our team to figure out which is
the case and how we can do proper detection at configure time.  I was
only thinking about Linux and *BSD when I wrote the configure logic we
have now.

Most people probably don't see this problem (including the other people
on the team) because we skip AESNI support unless yasm is installed.
_______________________________________________
krbdev mailing list             [hidden email]
https://mailman.mit.edu/mailman/listinfo/krbdev
Reply | Threaded
Open this post in threaded view
|

Re: Cannot build latest krb5 on Mac 10.9

Weijun Wang


On 12/20/13, 0:54, Greg Hudson wrote:
> On 12/19/2013 09:52 AM, Weijun Wang wrote:
>> So this iaesx64.so has a different arch. Could that be the problem?
>
> Configuring with --disable-aesni should work around this for now.

Thanks. This works.

I met another problem:

+ gcc -undefined error -dead_strip -dynamiclib -compatibility_version 0
-current_version 0.0 -install_name /usr/local/lib/libkrad.0.0.dylib
-exported_symbols_list darwin.exports -g -O2 -fno-common -o
libkrad.0.0.dylib attr.so attrset.so client.so code.so packet.so
remote.so -L../../lib -lkrb5 -lk5crypto -lcom_err -lkrb5support -lresolv
-lverto -Wl,-search_paths_first -dylib_file
/usr/local/lib/libkrb5support.1.1.dylib:../../lib/libkrb5support.1.1.dylib
-dylib_file
/usr/local/lib/libkadm5srv.5.1.dylib:../../lib/libkadm5srv.5.1.dylib
-dylib_file /usr/local/lib/libkdb5.4.0.dylib:../../lib/libkdb5.4.0.dylib
Undefined symbols for architecture x86_64:
   "_verto_set_flags", referenced from:
       _remote_add_flags in remote.so
       _on_io in remote.so
ld: symbol(s) not found for architecture x86_64

There is a libverto.dylib in my /usr/local/lib but I don't know how it's
installed. The owner is root so it does not come from brew. Running
strings on it does not show the symbols krb5 needs.

Anyway, I go inside util/verto and manually call make there to generate
krb5's own libverto. Then the whole make runs fine.

Thanks
Max

>
> We either need to restrict AESNI support to ELF platforms, or compile
> the AESNI assembly files with the right yasm -f option for OS X if that
> works.  I'll work with some Mac users on our team to figure out which is
> the case and how we can do proper detection at configure time.  I was
> only thinking about Linux and *BSD when I wrote the configure logic we
> have now.
>
> Most people probably don't see this problem (including the other people
> on the team) because we skip AESNI support unless yasm is installed.
>
_______________________________________________
krbdev mailing list             [hidden email]
https://mailman.mit.edu/mailman/listinfo/krbdev
Reply | Threaded
Open this post in threaded view
|

Re: Cannot build latest krb5 on Mac 10.9

Greg Hudson
On 12/19/2013 08:52 PM, Weijun Wang wrote:
> There is a libverto.dylib in my /usr/local/lib but I don't know how it's
> installed. The owner is root so it does not come from brew. Running
> strings on it does not show the symbols krb5 needs.

It could be from an earlier version of MIT krb5, maybe.  We should check
for verto_set_flags to make sure we don't pick up a system libverto
which is too old.  Configuring with --without-system-verto will work
around the problem for now.
_______________________________________________
krbdev mailing list             [hidden email]
https://mailman.mit.edu/mailman/listinfo/krbdev