delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/26/14:23:53

Date: Sat, 26 Feb 2000 13:21:26 -0500 (EST)
From: Frank Donahoe <fdonahoe AT wilkes1 DOT wilkes DOT edu>
To: DJGPP List <djgpp AT delorie DOT com>
Subject: LD errors compiling source from gnupg-1.0.1.tar.gz
Message-ID: <Pine.A32.3.96.1000226114113.84774A-100000@wilkes1.wilkes.edu>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

../gnu/gnupg-1.0.1> sh configure i586-*-msdosdjgpp

went well and when it came to linking the assembler files from
the target sub-subdirectory, copied them straight-a-way to the
proper subdirectory.  While a DOS window under Windows 98 will
preserve the case of file names, it counts `foo.S' and `foo.s'
as the same file.  The rule for compiling the assembler files
must be modified by changing the name of the intermediate file(s);

_mpih-mul1.o: mpih-mul1.S
	$(CPP) $(INCLUDES) $(DEFS) $< | grep -v '^#' > _mpih-mul1.s
	$(COMPILE) -c _mpih-mul1.s

or by substituting a different rule, causing the compiler to
choose a intermediate temporary file name for the `.s' file

gcc -c -x assembler-with-cpp -DDOS -I../include -DHAVE_CONFIG_H \
   -I. -I.. -g -O2 -Wall  mpih-mul1.S

rm -f libmpi.a
ar cru libmpi.a mpi-add.o mpi-bit.o mpi-cmp.o mpi-div.o mpi-gcd.o \
  mpi-inline.o mpi-inv.o mpi-mul.o mpi-pow.o mpi-mpow.o mpi-scan.o \
  mpicoder.o mpih-cmp.o mpih-div.o mpih-mul.o mpiutil.o g10m.o \
  mpih-mul1.o mpih-mul2.o mpih-mul3.o mpih-add1.o mpih-sub1.o \
  mpih-lshift.o mpih-rshift.o 
ranlib libmpi.a

Seven files at the end of the above list of object files are from
the assembler files.

The needed libraries are built and now comes the tools subdirectory
where "mpicalc.exe" is to be built first.

gcc -DHAVE_CONFIG_H -I. -I.. -I../include -I../intl -g -O2  \
   -Wall -c mpicalc.c
gcc -g -O2 -Wall -o mpicalc mpicalc.o \
   ../cipher/libcipher.a ../mpi/libmpi.a ../util/libutil.a  

-add.c:129: undefined reference to `mpihelp_sub_n'
mpi-add.c:136: undefined reference to `mpihelp_sub_n'
mpi-add.c:143: undefined reference to `mpihelp_sub_n'
mpi-add.c:151: undefined reference to `mpihelp_add_n'
../mpi/libmpi.a(mpi-bit.o): In function `mpi_rshift':
mpi-bit.c:209: undefined reference to `mpihelp_rshift'
../mpi/libmpi.a(mpi-div.o): In function `mpi_tdiv_qr':
mpi-div.c:222: undefined reference to `mpihelp_lshift'
mpi-div.c:228: undefined reference to `mpihelp_lshift'
mpi-div.c:271: undefined reference to `mpihelp_rshift'
../mpi/libmpi.a(mpi-div.o): In function `mpi_tdiv_q_2exp':
mpi-div.c:302: undefined reference to `mpihelp_rshift'
../mpi/libmpi.a(mpi-mul.o): In function `mpi_mul_ui':
mpi-mul.c:58: undefined reference to `mpihelp_mul_1'
../mpi/libmpi.a(mpi-mul.o): In function `mpi_mul_2exp':
mpi-mul.c:93: undefined reference to `mpihelp_lshift'
../mpi/libmpi.a(mpi-pow.o): In function `mpi_powm':
mpi-pow.c:91: undefined reference to `mpihelp_lshift'
mpi-pow.c:240: undefined reference to `mpihelp_lshift'
mpi-pow.c:259: undefined reference to `mpihelp_rshift'
mpi-pow.c:265: undefined reference to `mpihelp_rshift'
mpi-pow.c(.text+0x677): undefined reference to `mpihelp_sub_n'
../mpi/libmpi.a(mpih-div.o): In function `mpihelp_divrem':
mpih-div.c:324: undefined reference to `mpihelp_sub_n'
mpih-div.c:369: undefined reference to `mpihelp_submul_1'
mpih-div.c:372: undefined reference to `mpihelp_add_n'
../mpi/libmpi.a(mpih-mul.o): In function `mul_n_basecase':
mpih-mul.c:92: undefined reference to `mpihelp_mul_1'
mpih-mul.c:104: undefined reference to `mpihelp_add_n'
mpih-mul.c:107: undefined reference to `mpihelp_addmul_1'
../mpi/libmpi.a(mpih-mul.o): In function `mul_n':
mpih-mul.c:136: undefined reference to `mpihelp_addmul_1'
mpih-mul.c:138: undefined reference to `mpihelp_addmul_1'
mpih-mul.c:172: undefined reference to `mpihelp_sub_n'
mpih-mul.c:176: undefined reference to `mpihelp_sub_n'
mpih-mul.c:180: undefined reference to `mpihelp_sub_n'
mpih-mul.c:184: undefined reference to `mpihelp_sub_n'
mpih-mul.c:195: undefined reference to `mpihelp_add_n'
mpih-mul.c:200: undefined reference to `mpihelp_sub_n'
mpih-mul.c:202: undefined reference to `mpihelp_add_n'
mpih-mul.c:214: undefined reference to `mpihelp_add_n'
mpih-mul.c:219: undefined reference to `mpihelp_add_n'
../mpi/libmpi.a(mpih-mul.o): In function `mpih_sqr_n_basecase':
mpih-mul.c:244: undefined reference to `mpihelp_mul_1'
mpih-mul.c:256: undefined reference to `mpihelp_add_n'
mpih-mul.c:259: undefined reference to `mpihelp_addmul_1'
../mpi/libmpi.a(mpih-mul.o): In function `mpih_sqr_n':
mpih-mul.c:285: undefined reference to `mpihelp_addmul_1'
mpih-mul.c:287: undefined reference to `mpihelp_addmul_1'
mpih-mul.c:308: undefined reference to `mpihelp_sub_n'
mpih-mul.c:317: undefined reference to `mpihelp_add_n'
mpih-mul.c:321: undefined reference to `mpihelp_sub_n'
mpih-mul.c:331: undefined reference to `mpihelp_add_n'
mpih-mul.c:337: undefined reference to `mpihelp_add_n'
../mpi/libmpi.a(mpih-mul.o): In function `mpihelp_mul':
mpih-mul.c:416: undefined reference to `mpihelp_mul_1'
mpih-mul.c:428: undefined reference to `mpihelp_add_n'
mpih-mul.c:431: undefined reference to `mpihelp_addmul_1'
mpih-mul.c:452: undefined reference to `mpihelp_add_n'
mpih-mul.c:463: undefined reference to `mpihelp_add_n'
collect2: ld returned 1 exit status
make.exe[2]: *** [mpicalc] Error 1
make.exe[1]: *** [all-recursive] Error 1
make.exe: *** [all-recursive-am] Error 2

Naturally, the functions remaining undefined are those in
the assembler files.  So, to make the linker try harder...

:/djg/tmp/dj200000: line 1: syntax error near unexpected token `-Wl,-('
c:/djg/tmp/dj200000: line 1: `gcc -g -O2 -mpentiumpro -march=pentiumpro -W
-Wall -o mpicalc.exe  mpicalc.o ../cipher/libcipher.a ../mpi/libmpi.a
../util/libutil.a  -Wl,-( ../mpi/libmpi.a -)'
make.exe[2]: *** [mpicalc.exe] Error 2
make.exe[1]: *** [all-recursive] Error 1
make.exe: *** [all-recursive-am] Error 2

we learn that it doesn't like the form "-Wl,-( archives -) and the
same long list of undefined references is also produced by...

gcc  -g -O2 -Wall  -o mpicalc.exe  mpicalc.o \
   -Wl,--start-group ../cipher/libcipher.a ../mpi/libmpi.a \
   ../util/libutil.a --end-group 

and

gcc  -g -O2 -mpentiumpro -march=pentiumpro -W -Wall  -o mpicalc.exe \
   mpicalc.o ../cipher/libcipher.a ../mpi/libmpi.a ../util/libutil.a \
   -Wl,--start-group ../mpi/libmpi.a --end-group

but at least there are no syntax errors!

The output with the `-v' switch is below for one of the assembler
files.
 
gcc -v -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -mpentiumpro \
   -march=pentiumpro -W -Wall  -c -x assembler-with-cpp mpih-mul1.S 

Reading specs from c:/djg/lib/gcc-lib/djgpp/2.952/specs
gcc version 2.95.2 19991024 (release)
 c:/djg/lib/gcc-lib/djgpp/2.952/cpp.exe -lang-asm -v -I. -I.. \
   -I../include -$ -Dunix -Di386 -DGO32 -DDJGPP=2 -DMSDOS \
   -D__unix__ -D__i386__ -D__GO32__ -D__DJGPP__=2 -D__MSDOS__ \
   -D__unix -D__i386 -D__GO32 -D__DJGPP=2 -D__MSDOS -Asystem(unix) \
   -Asystem(msdos) -Acpu(i386) -Amachine(i386) -D__ASSEMBLER__ \
   -D__OPTIMIZE__ -g -W -Wall -Acpu(i386) -Amachine(i386) -Di386 \
   -D__i386 -D__i386__ -D__pentiumpro -D__pentiumpro__ \
   -D__tune_pentiumpro__ -D__tune_pentiumpro__ \
   -imacros c:/djg/lib/../include/sys/version.h -remap \
   -DHAVE_CONFIG_H mpih-mul1.S c:/djg/tmp\ccjqFqg6.s

GNU CPP version 2.95.2 19991024 (release) (80386, BSD syntax)

The verbose option in the "tools" subdirectory prepends the following
to the same list of unresolved references.

Reading specs from c:/djg/lib/gcc-lib/djgpp/2.952/specs
gcc version 2.95.2 19991024 (release)
 c:/djg/lib/gcc-lib/djgpp/2.952/collect2.exe -o mpicalc.exe \
  c:/djg/lib/crt0.o -Lc:/djg/contrib/lib -Lc:/djg/lib \
   -Lc:/djg/CONTRIB/lib -Lc:/djg/lib/gcc-lib/djgpp/2.952 \
   -Lc:/djg/bin -Lc:/djg/lib mpicalc.o \
   ../cipher/libcipher.a ../mpi/libmpi.a ../util/libutil.a \
   --start-group ../mpi/libmpi.a -lgcc -lc -lgcc -Tdjgpp.djl

"nm" reveals the functions are in libmpi.a

What shall I try next?

Regards,
Frank


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019