Wouter van Heyst
2004-06-29 09:22:14 UTC
Hello all,
I'm running into a problem trying to make a gcc 3.4.0 based toolchain
with MaverickCrunch support, during the final linkage of libc.so,
several functions turn up undefined references to __divdf3.
I think Richard Earnshaw and Vladimir Ivanov have spoken about this:
http://gcc.gnu.org/ml/gcc-patches/2004-03/msg00513.html
other than that thread I can't find a lot of references, neither is it
clear if Nucleusys have their copyright assignment yet, nor what the
current status is for the Cirrus ep9312 processor.
Anyway, trying to reproduce my problem I configured gcc seperately.
Multilib options in gcc/config/arm/t-arm-elf are uncommented per
http://gcc.gnu.org/gcc-3.4/changes.html:
MULTILIB_OPTIONS += mcpu=ep9312
MULTILIB_DIRNAMES += ep9312
MULTILIB_EXCEPTIONS += *mthumb/*mcpu=ep9312*
(no divdf3 mentioned in LIB1ASMFUNCS in that file, should it?)
Configured thusly:
../gcc-3.4.0/configure --target=arm-ep93xx-linux-gnu --host=powerpc-linux
--prefix=/opt/crosstool/arm-ep93xx-linux-gnu/gcc-3.4.0-glibc-2.3.2
--with-local-prefix=/opt/crosstool/arm-ep93xx-linux-gnu/gcc-3.4.0-glibc-2.3.2/arm-ep93xx-linu-gnu
--with-newlib --disable-nls --with-cpu=ep9312 --enable-threads=no
--enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c
--disable-shared --enable-cxx-flags=-mcpu=ep9312
Followed by:
make all-gcc
make install-gcc
Results in a semi-working toolchain:
# cat test.c
int bar(float foo) {
float c = foo / 12.34;
}
int _start() {
bar(2);
}
# arm-ep93xx-linux-gnu-gcc test.c -nostdlib
/tmp/cc2t8YCe.o(.text+0x2c): In function `bar':
: undefined reference to `__divdf3'
collect2: ld returned 1 exit status
Assembly:
str r0, [fp, #-16] @ float
cfldrs mvf0, [fp, #-16]
cfcvtsd mvd0, mvf0
cfmvrdl r0, mvd0
cfmvrdh r1, mvd0
adr r2, .L2
ldmia r2, {r2-r3}
bl __divdf3
cfcvtds mvf0, mvd0
cfstrs mvf0, [fp, #-20]
Richard Earnshaw commented the divdf3 define_expand pattern might need
disabling, should I try that? I'm not well versed in gcc internals, but
I'm eager to tackle this. Pointers are greatly appreciated.
Of course, it's possible this is not a gcc bug, and I messed up,
pointing that out is welcome too :)
Wouter van Heyst
I'm running into a problem trying to make a gcc 3.4.0 based toolchain
with MaverickCrunch support, during the final linkage of libc.so,
several functions turn up undefined references to __divdf3.
I think Richard Earnshaw and Vladimir Ivanov have spoken about this:
http://gcc.gnu.org/ml/gcc-patches/2004-03/msg00513.html
other than that thread I can't find a lot of references, neither is it
clear if Nucleusys have their copyright assignment yet, nor what the
current status is for the Cirrus ep9312 processor.
Anyway, trying to reproduce my problem I configured gcc seperately.
Multilib options in gcc/config/arm/t-arm-elf are uncommented per
http://gcc.gnu.org/gcc-3.4/changes.html:
MULTILIB_OPTIONS += mcpu=ep9312
MULTILIB_DIRNAMES += ep9312
MULTILIB_EXCEPTIONS += *mthumb/*mcpu=ep9312*
(no divdf3 mentioned in LIB1ASMFUNCS in that file, should it?)
Configured thusly:
../gcc-3.4.0/configure --target=arm-ep93xx-linux-gnu --host=powerpc-linux
--prefix=/opt/crosstool/arm-ep93xx-linux-gnu/gcc-3.4.0-glibc-2.3.2
--with-local-prefix=/opt/crosstool/arm-ep93xx-linux-gnu/gcc-3.4.0-glibc-2.3.2/arm-ep93xx-linu-gnu
--with-newlib --disable-nls --with-cpu=ep9312 --enable-threads=no
--enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c
--disable-shared --enable-cxx-flags=-mcpu=ep9312
Followed by:
make all-gcc
make install-gcc
Results in a semi-working toolchain:
# cat test.c
int bar(float foo) {
float c = foo / 12.34;
}
int _start() {
bar(2);
}
# arm-ep93xx-linux-gnu-gcc test.c -nostdlib
/tmp/cc2t8YCe.o(.text+0x2c): In function `bar':
: undefined reference to `__divdf3'
collect2: ld returned 1 exit status
Assembly:
str r0, [fp, #-16] @ float
cfldrs mvf0, [fp, #-16]
cfcvtsd mvd0, mvf0
cfmvrdl r0, mvd0
cfmvrdh r1, mvd0
adr r2, .L2
ldmia r2, {r2-r3}
bl __divdf3
cfcvtds mvf0, mvd0
cfstrs mvf0, [fp, #-20]
Richard Earnshaw commented the divdf3 define_expand pattern might need
disabling, should I try that? I'm not well versed in gcc internals, but
I'm eager to tackle this. Pointers are greatly appreciated.
Of course, it's possible this is not a gcc bug, and I messed up,
pointing that out is welcome too :)
Wouter van Heyst