Yocto compilation error (shm.h)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Yocto compilation error (shm.h)

Jump to solution
1,740 Views
dgotfroi
Contributor IV

Hello

I'm trying to bitbake a Core-image-minimal with yocto daisy(for an imx28evk board).

But I've a compilation error :

ERROR: Function failed: do_compile (log file is located at /home/gwio/fsl-community-bsp/build/tmp/work/x86_64-linux/perl-native/5.14.3-r0/temp/log.do_compile.17607)

ERROR: Logfile of failure stored in: /home/gwio/fsl-community-bsp/build/tmp/work/x86_64-linux/perl-native/5.14.3-r0/temp/log.do_compile.17607

Log data follows:

| DEBUG: Executing shell function do_compile

| NOTE: make -j 12 -e MAKEFLAGS=

| `sh  cflags "optimize='-O2'" doio.o` -fPIC doio.c

| gcc  -o generate_uudmap -L/home/gwio/fsl-community-bsp/build/tmp/sysroots/x86_64-linux/usr/lib -L/home/gwio/fsl-community-bsp/build/tmp/sysroots/x86_64-linux/lib -Wl,-rpath-link,/home/gwio/fsl-community-bsp/build/tmp/sysroots/x86_64-linux/usr/lib -Wl,-rpath-link,/home/gwio/fsl-community-bsp/build/tmp/sysroots/x86_64-linux/lib -Wl,-rpath,/home/gwio/fsl-community-bsp/build/tmp/sysroots/x86_64-linux/usr/lib -Wl,-rpath,/home/gwio/fsl-community-bsp/build/tmp/sysroots/x86_64-linux/lib -Wl,-O1 generate_uudmap.o -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc

| ./generate_uudmap uudmap.h bitcount.h

| `sh  cflags "optimize='-O2'" globals.o` -fPIC globals.c

|  CCCMD =  gcc  -DPERL_CORE -c -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -std=c89 -O2  -Wall -ansi -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat -Wwrite-strings

|  CCCMD =  gcc  -DPERL_CORE -c -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -std=c89 -O2  -Wall -ansi -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat -Wwrite-strings

| doio.c:39:20: error: conflicting types for 'shmat'

|      extern Shmat_t shmat (int, char *, int);

|                     ^

| In file included from doio.c:37:0:

| /usr/include/x86_64-linux-gnu/sys/shm.h:56:14: note: previous declaration of 'shmat' was here

|  extern void *shmat (int __shmid, const void *__shmaddr, int __shmflg)

|               ^

| doio.c: In function 'Perl_nextargv':

| doio.c:871:7: warning: ignoring return value of 'fchown', declared with attribute warn_unused_result [-Wunused-result]

|        (void)fchown(PL_lastfd,fileuid,filegid);

|        ^

| In file included from perl.h:3395:0,

|                  from doio.c:27:

| doio.c: In function 'S_exec_failed':

| iperlsys.h:769:39: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]

|  #define PerlLIO_write(fd, buf, count) write((fd), (buf), (count))

|                                        ^

| doio.c:1383:2: note: in expansion of macro 'PerlLIO_write'

|   PerlLIO_write(fd, (void*)&e, sizeof(int));

|   ^

| makefile:248: recipe for target 'doio.o' failed

| make: *** [doio.o] Error 1

| make: *** Waiting for unfinished jobs....

| ERROR: oe_runmake failed

| WARNING: exit code 1 from a shell command.

| ERROR: Function failed: do_compile (log file is located at /home/gwio/fsl-community-bsp/build/tmp/work/x86_64-linux/perl-native/5.14.3-r0/temp/log.do_compile.17607)

ERROR: Task 694 (/home/gwio/fsl-community-bsp/sources/poky/meta/recipes-devtools/perl/perl-native_5.14.3.bb, do_compile) failed with exit code '1'

WARNING: Failed to fetch URL ftp://ftp.uni-erlangen.de/pub/Linux/LOCAL/dosfstools/dosfstools-2.11.src.tar.gz, attempting MIRRORS if available

NOTE: Tasks Summary: Attempted 720 tasks of which 703 didn't need to be rerun and 1 failed.

Waiting for 0 running tasks to finish:

Can you help me ?

Labels (1)
Tags (3)
0 Kudos
1 Solution
831 Views
dgotfroi
Contributor IV

I think I found the solution by myself.

I edited sys/shm.h and I added : "#define HAS_SHMAT_PROTOTYPE".

In this case, doio.c will not try to redefined SHMAT prototype and perl compiles with no error.

View solution in original post

0 Kudos
1 Reply
832 Views
dgotfroi
Contributor IV

I think I found the solution by myself.

I edited sys/shm.h and I added : "#define HAS_SHMAT_PROTOTYPE".

In this case, doio.c will not try to redefined SHMAT prototype and perl compiles with no error.

0 Kudos