GnuPG 1.0.5 mpi build problems on Solaris

Jos Backus josb at cncdsl.com
Tue May 1 02:17:02 CEST 2001


I am having some problems getting the i386 mpi assembly code to build on
Solaris 2.[78]. I am using gcc-2.95.3 and Sun's as.

gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include    -g -O2 -Wall  -c _mpih-mul1.s
Assembler: 
        aline 112       : syntax error
        aline 116       : Illegal register
        aline 116       : syntax error
        aline 117       : Illegal register
        aline 117       : syntax error
[etc.]

This is because cpp by default puts spaces around expanded symbols, which
Sun's as doesn't like:

     pushl     % edi
     pushl     % esi
     pushl     % ebx
     pushl     % ebp

     movl       20 (%  esp   )  , % edi
     movl       24 (%  esp   )  , % esi
     movl       28 (%  esp   )  , % ecx
     movl       32 (%  esp   )  , % ebp

I "fixed" this by using cpp in -traditional mode (cpp by default assumes a
C-like language):

--- Makefile.orig     Mon Apr 30 12:32:16 2001
+++ Makefile    Mon Apr 30 12:34:13 2001
@@ -86,7 +86,7 @@
 CATALOGS =  da.mo de.mo eo.mo es_ES.mo et.mo fr.mo id.mo it.mo ja.mo nl.mo pl.mo pt_BR.mo pt_PT.mo ru.mo sv.mo tr.mo
 CATOBJEXT = .mo
 CC = gcc
-CPP = gcc -E
+CPP = gcc -E -traditional-cpp
 DATADIRNAME = lib
 DLLTOOL = @DLLTOOL@
 DOCBOOK_TO_MAN = no

(Of course this isn't the proper fix. configure needs to be taught to use this
switch when defining $CPP but I am not sure how to do that, sorry).

Also, the Sun assembler doesn't like parentheses in the argument to .align:

--- i386/syntax.h.orig        Mon Apr 30 15:57:51 2001
+++ i386/syntax.h       Mon Apr 30 15:58:05 2001
@@ -45,7 +45,7 @@
 #define ALIGN(log) .align log
 #endif
 #if defined (ELF_SYNTAX)
-#define ALIGN(log) .align 1<<(log)
+#define ALIGN(log) .align 1<<log
 #endif
 #define GLOBL .globl
 #endif

This leaves me with:

gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include    -g -O2 -Wall  -c _mpih-add1.s
Assembler: 
        "_mpih-add1.s", line 132 : Syntax error
gmake: *** [mpih-add1.o] Error 1

where the offending line is

    leal    (Loop - 3)(%eax,%eax,8),%eax

(It doesn't like the PIC variant either, btw).

I know I can build gpg with without the assembly code, I was just wondering if
anybody else has gotten this to work.

Thanks,
-- 
Jos Backus                 _/  _/_/_/        "Modularity is not a hack."
                          _/  _/   _/                -- D. J. Bernstein
                         _/  _/_/_/             
                    _/  _/  _/    _/
josb at cncdsl.com     _/_/   _/_/_/            use Std::Disclaimer;




More information about the Gnupg-devel mailing list