LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Please help building a toolchain (https://www.linuxquestions.org/questions/linux-general-1/please-help-building-a-toolchain-4175526587/)

delta67 11-26-2014 10:01 AM

Please help building a toolchain
 
Hi all
First, sorry if this is the wrong place, I don't know where I can post my question !

I'm bulding a toolchain for an i386 target using a linuxmint16 host.

I've succussfully built the following:
- binutils-2.22
- first pass gcc-4.6.4
- Installing linux-2.6.30 and eglibc-2.17 headers
- second gcc pass

But when I try to build the full eglibc I get this error:

Code:

-o /home/toto/mydev/build/eglibc/nptl/cleanup_compat.os -MD -MP -MF /home/toto/mydev/build/eglibc/nptl/cleanup_compat.os.dt -MT /home/toto/mydev/build/eglibc/nptl/cleanup_compat.os
make[2]: *** [/home/toto/mydev/build/eglibc/nptl/sem_post.os] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/home/toto/mydev/source/eglibc/nptl'
make[1]: *** [nptl/subdir_lib] Error 2
make[1]: Leaving directory `/home/toto/mydev/source/eglibc'
make: *** [all] Error 2

PLEASE help.

business_kid 11-26-2014 02:46 PM

Are you following an LFS book? If not, I suggest you do.

http://www.linuxfromscratch.org/lfs

They have the whole system worked out fairly well.

delta67 11-27-2014 09:09 AM

Thanks business_kid for the reply.
I'm following other tutorials found on the web.

business_kid 11-27-2014 11:15 AM

Better post a url for whatever you are following. Looking for help here, you really have to explain clearly what you are doing.

What's the difference between first & second pass at GCC?

The toolchain usually consists of glibc(eglibc in your case) kernel headers, and gcc. So, to build eglibc, surely you will have to link it against the system glibc, which is not optimal, as it won't see the system glibc once you are running.

LFS does a static build using the*system tools, then a dynamic build using the static tools, and gets around issues that way. It's probably not building for embedded.

As for your error posted below in post #1: Error no. 1 is "Operation Not Permitted." Probably you have a permissions problem.

delta67 11-28-2014 12:31 AM

Here is an url:

http://www.eglibc.org/archives/patches/msg00068.html

brebs 11-28-2014 01:12 AM

Quote:

Originally Posted by delta67 (Post 5275427)
I get this error:

You haven't shown the real error message. You've only show the final result of the error msg. Look at the rest of the output.

delta67 11-28-2014 05:02 AM

OK, here's more output:

Code:

-I../include -I/home/toto/mydev/build/eglibc/nptl -I/home/toto/mydev/build/eglibc -I../nptl/sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux/x86 -I../sysdeps/unix/sysv/linux/x86 -I../sysdeps/unix/sysv/linux/i386/nptl -I../sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/inet -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/fpu -I../sysdeps/x86/fpu -I../nptl/sysdeps/i386 -I../sysdeps/i386 -I../sysdeps/x86 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic -I../nptl -I../ports  -I.. -I../libio -I. -nostdinc -isystem /home/toto/mydev/tools/lib/gcc/i386-pc-linux/4.6.4/include -isystem /home/toto/mydev/tools/lib/gcc/i386-pc-linux/4.6.4/include-fixed -isystem /home/toto/mydev/sysroot/usr/include  -D_LIBC_REENTRANT -include ../include/libc-symbols.h  -DPIC -DSHARED -DNOT_IN_libc=1 -DIS_IN_libpthread=1 -DIN_LIB=libpthread    -o /home/toto/mydev/build/eglibc/nptl/cleanup.os -MD -MP -MF /home/toto/mydev/build/eglibc/nptl/cleanup.os.dt -MT /home/toto/mydev/build/eglibc/nptl/cleanup.os
../nptl/sysdeps/unix/sysv/linux/sem_trywait.c: In function ‘__new_sem_trywait’:
../nptl/sysdeps/unix/sysv/linux/sem_trywait.c:37:7: warning: implicit declaration of function ‘atomic_decrement_if_positive’ [-Wimplicit-function-declaration]
../nptl/sysdeps/unix/sysv/linux/sem_post.c: In function ‘__new_sem_post’:
../nptl/sysdeps/unix/sysv/linux/sem_post.c:43:3: warning: implicit declaration of function ‘atomic_compare_and_exchange_bool_rel’ [-Wimplicit-function-declaration]
../nptl/sysdeps/unix/sysv/linux/sem_post.c:45:3: warning: implicit declaration of function ‘atomic_full_barrier’ [-Wimplicit-function-declaration]
../nptl/sysdeps/unix/sysv/linux/sem_post.c:48:17: error: expected expression before ‘do’
../nptl/sysdeps/unix/sysv/linux/sem_post.c: In function ‘__old_sem_post’:
../nptl/sysdeps/unix/sysv/linux/sem_post.c:68:3: warning: implicit declaration of function ‘atomic_increment_val’ [-Wimplicit-function-declaration]
../nptl/sysdeps/unix/sysv/linux/sem_post.c:70:13: error: expected expression before ‘do’
make[2]: *** [/home/toto/mydev/build/eglibc/nptl/sem_post.os] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/home/toto/mydev/source/eglibc/nptl'
make[1]: *** [nptl/subdir_lib] Error 2
make[1]: Leaving directory `/home/toto/mydev/source/eglibc'
make: *** [all] Error 2


business_kid 11-28-2014 11:33 AM

Code:

../nptl/sysdeps/unix/sysv/linux/sem_post.c:43:3: warning: implicit declaration of function ‘atomic_compare_and_exchange_bool_rel’ [-Wimplicit-function-declaration]
../nptl/sysdeps/unix/sysv/linux/sem_post.c:45:3: warning: implicit declaration of function ‘atomic_full_barrier’ [-Wimplicit-function-declaration]
../nptl/sysdeps/unix/sysv/linux/sem_post.c:48:17: error: expected expression before ‘do’
../nptl/sysdeps/unix/sysv/linux/sem_post.c: In function ‘__old_sem_post’:
../nptl/sysdeps/unix/sysv/linux/sem_post.c:68:3: warning: implicit declaration of function ‘atomic_increment_val’ [-Wimplicit-function-declaration]

In that lot, the 'implicit declaration of function' stuff means this: All functions should be declared, and their type set before they are referenced in code. These are not defined, but just appear in the code.

That implies you are missing at least one file to include with the above. You have your system set up in /home/toto. Try something like
Code:

cd /home/toto
grep -re 'atomic_compare_and_exchange_bool_rel' * |less

you are looking for that in a header (.h) file, as usually found in /usr/include & subdirs. In this setup I don't know where they will be. Make sure that file is referenced, or symlink it in one of those subdirs. If the grep only shows that in .c files and it doesn't appear in an include, you need to install more stuff.

The "error expected expression before ‘do’ " looks more like a syntax error, but I wouldn't worry about that until you sort the others, as it will probably go away of it's own accord.

BTW, I am an amateur with C :-P.

I looked at the guide. I note it's for developers, not the public. Good luck with it.

delta67 12-02-2014 10:25 AM

There's a bug in eglibc-2.17 !!
Probleme solved when migrating to 2.18.


All times are GMT -5. The time now is 02:51 AM.