This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Building und/libiberty for powerpc-eabi cross compiler fails dueto linker error


Hello all,

I am trying to build a powerpc-eabi cross compiler on an i686-pc-cygwin host. I followed Bill Gatliff's tutorial, however, building the complete cross compiler fails.

I am using binutils-2.14, gcc-3.3.2 and newlib-1.11.0. Compiling binutils, the bootstrap gcc, and newlib isn't a problem.

When compiling the complete gcc, 'make all' fails because the compiler does not know what target it should generate executables for. This problem is mentioned several times on the net, however, the suggested solution (a subsequent 'make CFLAGS="-myellowknife" all') fails, too.

I examined the log files and found out, that after specifying '-myellowknife', the le, ca, and nof versions of libiberty could successfully be configured. Things go wrong when configuring und.

This is how 'make CFLAGS="-myellowknife" all' fails:

--(snip)------------------------------------------------------------------------------
checking for sys/table.h... no
checking for sys/sysctl.h... no
checking for sys/systemcfg.h... no
checking for sys/wait.h that is POSIX.1 compatible... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether errno must be declared... no
checking for ANSI C header files... no
checking for uintptr_t... no
checking for pid_t... yes
checking whether the C compiler (/home/gem/crossgcc/build-gcc/gcc/xgcc -B/home/gem/crossgcc/build-gcc/gcc/ -B/usr/local/powerpc-eabi/bin/ -B/us
r/local/powerpc-eabi/lib/ -isystem /usr/local/powerpc-eabi/include -fleading-underscore -mrelocatable-lib -mno-eabi -mstrict-align -O2 -myello
wknife ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
make: *** [configure-target-libiberty] Error 1
--------------------------------------------------------------------------------------


Analyzing the config.log in build-gcc/powerpc-eabi/und/libiberty reveals a linker error:

--(snip)------------------------------------------------------------------------------
configure:1513: checking for ANSI C header files
configure:1526: /home/gem/crossgcc/build-gcc/gcc/xgcc -B/home/gem/crossgcc/build-gcc/gcc/ -B/usr/local/powerpc-eabi/bin/ -B/usr/local/powerpc-e
abi/lib/ -isystem /usr/local/powerpc-eabi/include -fleading-underscore -mrelocatable-lib -mno-eabi -mstrict-align -E conftest.c >/dev/null 2>
conftest.out
configure:1593: /home/gem/crossgcc/build-gcc/gcc/xgcc -B/home/gem/crossgcc/build-gcc/gcc/ -B/usr/local/powerpc-eabi/bin/ -B/usr/local/powerpc-e
abi/lib/ -isystem /usr/local/powerpc-eabi/include -fleading-underscore -mrelocatable-lib -mno-eabi -mstrict-align -o conftest -O2 -myellowknif
e conftest.c 1>&5
/usr/local/powerpc-eabi/lib/und/libyk.a(sbrk.o)(.got2+0x4): In function `sbrk':
../../../../../newlib-1.11.0/libgloss/sbrk.c:33: undefined reference to `__end'
collect2: ld returned 1 exit status
configure: failed program was:
#line 1582 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int main () { int i; for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }


configure:1617: checking for uintptr_t
configure:1658: checking for pid_t
configure:2392: checking whether the C compiler (/home/gem/crossgcc/build-gcc/gcc/xgcc -B/home/gem/crossgcc/build-gcc/gcc/ -B/usr/local/powerpc
-eabi/bin/ -B/usr/local/powerpc-eabi/lib/ -isystem /usr/local/powerpc-eabi/include -fleading-underscore -mrelocatable-lib -mno-eabi -mstrict-a
lign -O2 -myellowknife ) works
configure:2408: /home/gem/crossgcc/build-gcc/gcc/xgcc -B/home/gem/crossgcc/build-gcc/gcc/ -B/usr/local/powerpc-eabi/bin/ -B/usr/local/powerpc-e
abi/lib/ -isystem /usr/local/powerpc-eabi/include -fleading-underscore -mrelocatable-lib -mno-eabi -mstrict-align -o conftest -O2 -myellowknif
e conftest.c 1>&5
/usr/local/powerpc-eabi/lib/und/libyk.a(sbrk.o)(.got2+0x4): In function `sbrk':
../../../../../newlib-1.11.0/libgloss/sbrk.c:33: undefined reference to `__end'
collect2: ld returned 1 exit status
configure: failed program was:


#line 2403 "configure"
#include "confdefs.h"

main(){return(0);}
--------------------------------------------------------------------------------------

Interestingly, this problem isn't mentioned anywhere on the net. At least I wasn't able to google something appropriate.

A couple of question arise:

1. Isn't __end a target-specific function that need to be written for the particular board? Shouldn't libgloss cover its existence?

2. How come this problem arises when configuring und whereas le, nof, and ca don't show this problem? The -fleading-underscore option can't be the cause of all this trouble, can it?

Thanks for any pointers into the right direction.
Hermann

PS: Compilation is done under a clean Cygwin install. However, I get the same kind of error during compilation under a BSD box.


------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]