--- Quote Start ---
originally posted by janhendrik@Aug 18 2004, 11:49 AM
hi guys i’ve been trying to compile the jpeg source code for the nios ii linux distro, but i’ve caught a snag. it seems that the libc.a that i have gives a compiler error. now i am completely new to this cross-compiling thing so maybe i’m doing something wrong, or just missing something. but the source compiles flawlessly wit the gcc that came with the windows nt update.
here is the ./configure output
<div class='quotetop'>quote
--- quote end ---
--- quote start ---
checking for gcc... gcc
checking whether the c compiler (gcc ) works... yes
checking whether the c compiler (gcc ) is a cross-compiler... no
checking whether we are using gnu c... egrep: not found
no
checking how to run the c preprocessor... gcc -e
checking for function prototypes... yes
checking for stddef.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for size_t... yes
checking for type unsigned char... yes
checking for type unsigned short... yes
checking for type void... yes
checking for working const... yes
checking for inline... __inline__
checking for broken incomplete types... ok
checking for short external names... ok
checking to see if char is signed... yes
checking to see if right shift is signed... yes
checking to see if fopen accepts b spec... yes
checking for a bsd compatible install... /bin/install -c
checking for ranlib... ranlib
checking libjpeg version number... 62
creating ./config.status
creating makefile
creating jconfig.h
jconfig.h is unchanged --- Quote End ---
Then I edit the Makefile and change the CC option from gcc to nios2-elf-gcc.
Next I run nios2-elf-make.
<div class='quotetop'>QUOTE </div>
--- Quote Start ---
nios2-elf-gcc -O -I. -c -o jcapistd.o jcapistd.c
nios2-elf-gcc -O -I. -c -o jctrans.o jctrans.c
nios2-elf-gcc -O -I. -c -o jcparam.o jcparam.c
nios2-elf-gcc -O -I. -c -o jdatadst.o jdatadst.c
nios2-elf-gcc -O -I. -c -o jcinit.o jcinit.c
nios2-elf-gcc -O -I. -c -o jcmaster.o jcmaster.c
nios2-elf-gcc -O -I. -c -o jcmarker.o jcmarker.c
nios2-elf-gcc -O -I. -c -o jcmainct.o jcmainct.c
nios2-elf-gcc -O -I. -c -o jcprepct.o jcprepct.c
nios2-elf-gcc -O -I. -c -o jccoefct.o jccoefct.c
nios2-elf-gcc -O -I. -c -o jccolor.o jccolor.c
nios2-elf-gcc -O -I. -c -o jcsample.o jcsample.c
nios2-elf-gcc -O -I. -c -o jchuff.o jchuff.c
nios2-elf-gcc -O -I. -c -o jcphuff.o jcphuff.c
nios2-elf-gcc -O -I. -c -o jcdctmgr.o jcdctmgr.c
nios2-elf-gcc -O -I. -c -o jfdctfst.o jfdctfst.c
nios2-elf-gcc -O -I. -c -o jfdctflt.o jfdctflt.c
nios2-elf-gcc -O -I. -c -o jfdctint.o jfdctint.c
nios2-elf-gcc -O -I. -c -o jdapimin.o jdapimin.c
nios2-elf-gcc -O -I. -c -o jdapistd.o jdapistd.c
nios2-elf-gcc -O -I. -c -o jdtrans.o jdtrans.c
nios2-elf-gcc -O -I. -c -o jdatasrc.o jdatasrc.c
nios2-elf-gcc -O -I. -c -o jdmaster.o jdmaster.c
nios2-elf-gcc -O -I. -c -o jdinput.o jdinput.c
nios2-elf-gcc -O -I. -c -o jdmarker.o jdmarker.c
nios2-elf-gcc -O -I. -c -o jdhuff.o jdhuff.c
nios2-elf-gcc -O -I. -c -o jdphuff.o jdphuff.c
nios2-elf-gcc -O -I. -c -o jdmainct.o jdmainct.c
nios2-elf-gcc -O -I. -c -o jdcoefct.o jdcoefct.c
nios2-elf-gcc -O -I. -c -o jdpostct.o jdpostct.c
nios2-elf-gcc -O -I. -c -o jddctmgr.o jddctmgr.c
nios2-elf-gcc -O -I. -c -o jidctfst.o jidctfst.c
nios2-elf-gcc -O -I. -c -o jidctflt.o jidctflt.c
nios2-elf-gcc -O -I. -c -o jidctint.o jidctint.c
nios2-elf-gcc -O -I. -c -o jidctred.o jidctred.c
nios2-elf-gcc -O -I. -c -o jdsample.o jdsample.c
nios2-elf-gcc -O -I. -c -o jdcolor.o jdcolor.c
nios2-elf-gcc -O -I. -c -o jquant1.o jquant1.c
nios2-elf-gcc -O -I. -c -o jquant2.o jquant2.c
nios2-elf-gcc -O -I. -c -o jdmerge.o jdmerge.c
nios2-elf-gcc -O -I. -c -o jcomapi.o jcomapi.c
nios2-elf-gcc -O -I. -c -o jutils.o jutils.c
nios2-elf-gcc -O -I. -c -o jerror.o jerror.c
nios2-elf-gcc -O -I. -c -o jmemmgr.o jmemmgr.c
nios2-elf-gcc -O -I. -c -o jmemnobs.o jmemnobs.c
rm -f libjpeg.a
ar rc libjpeg.a jcapimin.o jcapistd.o jctrans.o jcparam.o jdatadst.o jcinit.o j
cmaster.o jcmarker.o jcmainct.o jcprepct.o jccoefct.o jccolor.o jcsample.o jchuf
f.o jcphuff.o jcdctmgr.o jfdctfst.o jfdctflt.o jfdctint.o jdapimin.o jdapistd.o
jdtrans.o jdatasrc.o jdmaster.o jdinput.o jdmarker.o jdhuff.o jdphuff.o jdmainct
.o jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o jidctint.o jidctred.o
jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o jcomapi.o jutils.o jerror.o j
memmgr.o jmemnobs.o
ranlib libjpeg.a
nios2-elf-gcc -O -I. -c -o cjpeg.o cjpeg.c
nios2-elf-gcc -O -I. -c -o rdppm.o rdppm.c
nios2-elf-gcc -O -I. -c -o rdgif.o rdgif.c
nios2-elf-gcc -O -I. -c -o rdtarga.o rdtarga.c
nios2-elf-gcc -O -I. -c -o rdrle.o rdrle.c
nios2-elf-gcc -O -I. -c -o rdbmp.o rdbmp.c
nios2-elf-gcc -O -I. -c -o rdswitch.o rdswitch.c
nios2-elf-gcc -O -I. -c -o cdjpeg.o cdjpeg.c
nios2-elf-gcc -o cjpeg cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswit
ch.o cdjpeg.o libjpeg.a
/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc
-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(closer.o): In function `_c
lose_r':
closer.o(.text+0x20): warning: _close is not implemented and will always fail
/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc
-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(fstatr.o): In function `_f
stat_r':
fstatr.o(.text+0x28): warning: _fstat is not implemented and will always fail
/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc
-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(makebuf.o): In function `_
_smakebuf':
makebuf.o(.text+0xf8): warning: isatty is not implemented and will always fail
/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc
-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(lseekr.o): In function `_l
seek_r':
lseekr.o(.text+0x2c): warning: _lseek is not implemented and will always fail
/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc
-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(openr.o): In function `_op
en_r':
openr.o(.text+0x2c): warning: _open is not implemented and will always fail
/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc
-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(readr.o): In function `_re
ad_r':
readr.o(.text+0x2c): warning: _read is not implemented and will always fail
/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc
-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(writer.o): In function `_w
rite_r':
writer.o(.text+0x2c): warning: _write is not implemented and will always fail
/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc
-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(getenv_r.o): In function `
_findenv_r':
getenv_r.o(.text+0x34): undefined reference to `__env_lock'
getenv_r.o(.text+0xb8): undefined reference to `__env_unlock'
getenv_r.o(.text+0x100): undefined reference to `__env_unlock'
collect2: ld returned 1 exit status
nios2-elf-make: *** [cjpeg] Error 1[/b]
--- Quote End ---
How do I regenerate libc.a? Is that even where the problem is? Is there another way to compile the jpeg source for the NIOS II Linux distro?
MORE INFO:
JPEG source version : 6b
gcc version: 2.95.3-5 (cygwin special)
nios2-elf-gcc version: 3.3.3 (Altera Nios II 1.0 b316) [/b]
--- Quote End ---
it looks like the library compiled with the PC compiler. I think you'll need to force the cc & library tools to be the nios2-elf ones.
Adrian