For FreeBSD 10 we have changed /usr/lib/libc.so to be a text linker
script and no longer a symlink. This breaks the config check on i386 for
what binary format to use when building with ASM support. The current
config check expects /usr/lib/libc.so to symlink to a /usr/lib/libc.so.X
file to run file(1) against. For FreeBSD the real libc.so is in
/lib/libc.so.X.

Because the proper libc.so is not found, a.out format is chosen when
using ASM and the build fails.

Operating system: i386-pc-freebsd8.3
Configuring for BSD-x86
[...]
    no-sse2         [option]
[...]
cc -I.. -I../.. -I../modes -I../asn1 -I../evp -I../../include  -fPIC
-DOPENSSL_PIC -DZLIB_SHARED -DZLIB -DOPENSSL_THREADS -pthread
-D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -DL_ENDIAN
-DTERMIOS -O3 -fomit-frame-pointer -Wall -O2 -pipe -fstack-protector
-fno-strict-aliasing -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_BN_ASM_MONT
-DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM
-DRMD160_ASM -DAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -c -o sha256-586.o
sha256-586.s
sha256-586.s: Assembler messages:
sha256-586.s:235: Error: alignment not a power of 2

With patch:
Operating system: i386-pc-freebsd8.3
Configuring for BSD-x86-elf
[...]
Build passes.


I have 2 proposed patches which solve the problem. Only 1 is needed.

1. Use file(1) against /bin/sh for all BSD platforms. I believe this
will be more portable long-term. It will determine the binary type,
regardless of where libc.so is or how it is setup. Note that -L is used
to follow symlink incase someone symlinks /bin/sh to something else.

  http://people.freebsd.org/~bdrewery/openssl-ldscript-elf-bin-sh.diff

2. Or just include /lib/libc.so.* in the search path to run file(1)
against. I prefer #1 as it is possible that /usr/lib/libc.so is
symlinked to a libc.ld script, which cause file(1) to return 'ASCII' and
the config falls back on a.out.

  http://people.freebsd.org/~bdrewery/openssl-ldscript-elf-lib-libc.diff

-- 
Regards,
Bryan Drewery


Attachment: signature.asc
Description: PGP signature

Reply via email to