Page MenuHome GnuPG

FreeBSD 10.1: mpi alignment error during compile
Closed, ResolvedPublic

Description

while compiling libgcrypt on FreeBSD 10.1, I get a variety of errors that did
not appear on other operating systems. The same type of error appears in the
other mpi programs related to addition, subtraction, multiplication, etc...

Making all in mpi
/bin/sh ../libtool --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -I../src
-I../src -D_THREAD_SAFE -g -O2 -MT mpih-add1-asm.lo -MD -MP -MF
.deps/mpih-add1-asm.Tpo -c -o mpih-add1-asm.lo mpih-add1-asm.S
libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I../src -I../src -D_THREAD_SAFE
-g -O2 -MT mpih-add1-asm.lo -MD -MP -MF .deps/mpih-add1-asm.Tpo -c
mpih-add1-asm.S -fPIC -DPIC -o .libs/mpih-add1-asm.o
mpih-add1-asm.S:44:9: error: alignment must be a power of 2
.align 3,0x90

^

mpih-add1-asm.S:79:9: error: alignment must be a power of 2
.align 3,0x90

The program will compile if all instances of "ALIGN (3)" are changed to "ALIGN
(2)" within the mpi directory, but I'm not sure if this will break something
something or if it should be fixed with a compiler option.

The build system is:
kern.ostype: FreeBSD
kern.osrelease: 10.1-RELEASE
kern.osrevision: 199506
kern.version: FreeBSD 10.1-RELEASE #0 r274401: Tue Nov 11 22:51:51 UTC 2014

root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC

Details

Version
1.6.3

Event Timeline

We did not changed anything in this code for many many years. This seems to be
a configure problem: The configure script (actually mpi/config.links) figured
that you are using BSD_SYNTAX but in reality as(1) requires ELF_SYNAX.

What is the cpu-os-vendor string? Look at mpi/asm-syntax.h in the build
directory - the top 3 lines shows this.

be an as(1) problem.

This is related to the "ALIGN (3)" mpi code that caused a compile
problem on FreeBSD 10.1 (I changed it to "ALIGN (2)" and it compiled,
but I'm not sure if that will break something).

I attached four files:

naturalmessageLneovoN50hw.txt contains info about my hardware (a
Lenovo N580 laptop).

The other three appear to have been created when mpi was compiled. It
shows that ELF_SYNTAX is set:

asm-syntax.h
mod-source-info.h
sysdep.h

The first three lines of asm-syntax.h are:

/* created by config.links - do not edit */
/* Host: x86_64-unknown-freebsd10.1 */
#define ELF_SYNTAX

Robert Hoot
Natural Message, LLC
1237 Bourbon Street
Pahrump NV, 89048

naturalmessage@fastmail.nl

On Sun, Mar 29, 2015, at 06:49 AM, Werner Koch via BTS wrote:

Werner Koch <wk@gnupg.org> added the comment:

We did not changed anything in this code for many many years. This seems
to be
a configure problem: The configure script (actually mpi/config.links)
figured
that you are using BSD_SYNTAX but in reality as(1) requires ELF_SYNAX.

What is the cpu-os-vendor string? Look at mpi/asm-syntax.h in the build
directory - the top 3 lines shows this.

be an as(1) problem.


status: unread -> chatting


g10 Code's BTS <gnupg@bugs.g10code.com>
<T1936>


It seems for me that your build environment is not clean and has some links for
i386, while your arch is x86_64. It is i386's mpih-add1 which has ALIGN(3) at
line number 44.

Please do 'make distclean' and configure, then make.

libgcrypt compiles fine on regular FreeBSD 10.1 with the proper
architecture. The problem with the mismatched architecture was because
I was on a virtual machine and I had to run a 32 bit OS in the machine
because my 64-bit hardware didn't have hardware virtualization and
would only run a 32-bit OS. I guess that situation isn't too common,
but I'll leave it to you to classify the original report as a bug or
converted feature request/idea.

thx

Robert Hoot
Natural Message, LLC
1237 Bourbon Street
Pahrump NV, 89048

naturalmessage@fastmail.nl

On Thu, Apr 2, 2015, at 11:56 PM, NIIBE Yutaka via BTS wrote:

NIIBE Yutaka <gniibe@fsij.org> added the comment:

It seems for me that your build environment is not clean and has some
links for
i386, while your arch is x86_64. It is i386's mpih-add1 which has
ALIGN(3) at
line number 44.

Please do 'make distclean' and configure, then make.


g10 Code's BTS <gnupg@bugs.g10code.com>
<T1936>


Thank you for further information.
Now, I understand your situation of mixture of architectures.
I think that your source code was once configured by 32-bit environment (which
created links to 32-bit), and then you tried to configure and to compile by
64-bit environment which caused errors.

I think that "make distclean; configure; make" would success even on the 32-bit
environment with different host OS.

The version string match bug was fixed in master and 1.6 branch.

gniibe removed a project: Restricted Project.Sep 10 2015, 4:37 AM

Fixed in 1.6.4.