cross-compiling on Solaris 2.5 host to SunOS 4.1.4 target
Mike Boyer
boyer@scrooge.cecer.army.mil
Fri Jul 11 07:11:00 GMT 1997
Hello, I have been trying to setup a cross-compiler on my Solaris 2.5
Sparc 10 so that I could compile/link/assemble SunOS 4.1.4 programs and
have not been having much luck. Currently the compile dies at the following
point with this message:
Testing libgcc1. Ignore linker warning messages.
./xgcc -B./ -DCROSS_COMPILE -DIN_GCC -DSVR4 -I./include libgcc1-test.o -o
libgcc1-test \
-nostartfiles -nostdlib `./xgcc -B./ --print-libgcc-file-name`
libgcc1-test.o(.text+0x94): undefined reference to `umul'
libgcc1-test.o(.text+0xb4): undefined reference to `div'
libgcc1-test.o(.text+0xd8): undefined reference to `rem'
libgcc1-test.o(.text+0xf8): undefined reference to `udiv'
libgcc1-test.o(.text+0x11c): undefined reference to `urem'
make: *** [libgcc1-test] Error 1
Now in the GCC readme it says that this is normal if you did not
provide some sort of libgcc1.a file, but I have, or at least think I
have. I will try to describe in as much detail as possible what
I have done so far.
1. I set up a /usr/local/sparc-sun-sunos4.1.4 directory that contains
the entire /usr/lib directory from a 4.1.4 machine. Also the
entire /usr/include directory.
2. I build binutils-2.8.1 with build sparc-sun-solaris2.5 and target
sparc-sun-sunos4.1.4.
./configure --build=sparc-sun-solaris2.5 --target=sparc-sun-sunos4.1.4
--enable-targets=sparc-sun-solaris2.5,sparc-sun-sunos4.1.4
./configure --build=sparc-sun-solaris2.5
--enable-targets=sparc-sun-solaris2.5,sparc-sun-sunos4.1.4
Now the docs for binutils shows the following which I did (before)
./configure --enable-targets=sparc-sun-solaris2.5,sparc-sun-sunos4.1.4
which did not seem to do the same thing as the above two commands,
however neither one seemed to have an effect on the results of
libgcc1-test.o.
3. I compiled gcc 2.7.2.2 on a sunos4.1.4 machine and copied the
/usr/local/lib/gcc-lib/sparc-sun-sunos4.1.4 to my /usr/local/lib/gcc-lib
directory. I also copied libgcc1.a to the build directory as
instructed in the gcc docs. Lastly I copied the *crt* files
over to my /usr/local/sparc-sun-sunos4.1.4/lib directory per
the gcc doc. (Attempts to compile past the libgcc1-test.o
point produced complaints that crt0.o could not be found until
I actually copied them the the build directory).
4. The little bit I know about compiling and linking, does not
"undefined reference to" mean that a library can not be found.
I have not added anything to my environment variables. Maybe
this is part of the problem. Any suggestions would be greatly
appreciated. Thanks.
--Mike Boyer
--UNIX System Administrator
More information about the crossgcc
mailing list