Bug 5135

Summary: nativesdk-pseudo: do_compile failed when NO32LIBS = "0": fatal error: gnu/stubs-32.h: No such file or directory
Product: [Yocto Project Subprojects] Pseudo Reporter: Jackie Huang <jackie.huang>
Component: poky integrationAssignee: Mark Hatle <mark.hatle>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: meta.mr.watcher, meta.watcher, sgw, sjolley.yp.pm, yp.pseudo.watcher, yp.watcher
Version: master   
Target Milestone: 1.5.3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Jackie Huang 2013-09-07 12:46:31 UTC
$ grep  NO32LIBS recipes-devtools/pseudo/pseudo.inc
NO32LIBS ??= "1"
       case "${NO32LIBS}" in
       echo "If you need to run 32-bit executables, ensure that NO32LIBS is set to 0."

If we set NO32LIBS to 0:
$ tail -n 1 conf/local.conf
NO32LIBS = "0"

nativesdk-pseudo do_compile failed:
NOTE: Running task 560 of 571 (ID: 5, virtual:nativesdk:/buildarea/jhuang0/git/yocto/poky/meta/recipes-devtools/pseudo/pseudo_1.5.1.bb, do_configure)
NOTE: recipe nativesdk-pseudo-1.5.1-r3: task do_configure: Started
NOTE: recipe nativesdk-pseudo-1.5.1-r3: task do_configure: Succeeded
NOTE: Running task 561 of 571 (ID: 6, virtual:nativesdk:/buildarea/jhuang0/git/yocto/poky/meta/recipes-devtools/pseudo/pseudo_1.5.1.bb, do_compile)
NOTE: recipe nativesdk-pseudo-1.5.1-r3: task do_compile: Started
ERROR: Function failed: do_compile (log file is located at /buildarea/jhuang0/yp/y_x64_0705/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-pseudo/1.5.1-r3/temp/log.do_compile.12446)
ERROR: Logfile of failure stored in: /buildarea/jhuang0/yp/y_x64_0705/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-pseudo/1.5.1-r3/temp/log.do_compile.12446
Log data follows:
| DEBUG: Executing shell function do_compile
| Attempting to build 32-bit libpseudo.so for nativesdk-pseudo.
| WARNING: Guessing architecture CFLAGS '-m32'.
| If you need specific flags, use --cflags.
| SQLite header for version 3007017 found in /buildarea/jhuang0/yp/y_x64_0705/tmp/sysroots/x86_64-nativesdk-pokysdk-linux/opt/poky/1.4+snapshot/sysroots/x86_64-pokysdk-linux/usr.
| Enabling in-memory database by default.
| NOTE: make -j 4 -e MAKEFLAGS= libpseudo
| mkdir -p lib/pseudo/lib
| ./makewrappers
| ./maketables enums/*.in
| enums/msg_type.in: type: msg_type_t (prefix 'PSEUDO_MSG_ENUM')
|    ping               shutdown           op                 ack
|    nak                fastop
|
| enums/op.in: type: op_t (prefix 'OP_ENUM')
|   extra column: int wait (default 0)
|    chdir              chmod              chown              chroot
|    close              creat              dup                fchmod
|    fchown             fstat              link               mkdir
|    mknod              open               rename             stat
|    unlink             symlink            exec               may-unlink
|    did-unlink         cancel-unlink
|
| enums/query_field.in: type: query_field_t (prefix 'PSQF_ENUM')
|    access             client             dev                fd
|    ftype              gid                id                 inode
|    mode               op                 order              path
|    perm               program            result             severity
|    stamp              tag                text               type
|    uid
|
| enums/query_type.in: type: query_type_t (prefix 'PSQT_ENUM')
|   extra column: const char * sql (default "LITTLE BOBBY TABLES")
|    exact              less               greater            bitand
|    notequal           like               notlike            sqlpat
|
|
| enums/res.in: type: res_t (prefix 'RESULT_ENUM')
|    succeed            fail               error
|
| enums/sev.in: type: sev_t (prefix 'SEVERITY_ENUM')
|    debug              info               warn               error
|    critical
|
| Writing datatypes... done.  Cleaning up.
| x86_64-pokysdk-linux-gcc  --sysroot=/buildarea/jhuang0/yp/y_x64_0705/tmp/sysroots/x86_64-nativesdk-pokysdk-linux -isystem/buildarea/jhuang0/yp/y_x64_0705/tmp/sysroots/x86_64-nativesdk-pokysdk-linux/opt/poky/1.4+snapshot/sysroots/x86_64-pokysdk-linux/usr/include -O2 -pipe -pipe -std=gnu99 -Wall -W -Wextra -fPIC -D_LARGEFILE64_SOURCE -D_ATFILE_SOURCE -m32 -DPSEUDO_PREFIX='"/opt/poky/1.4+snapshot/sysroots/x86_64-pokysdk-linux/usr"' -DPSEUDO_SUFFIX='""' -DPSEUDO_BINDIR='"bin"' -DPSEUDO_LIBDIR='"lib/pseudo/lib"' -DPSEUDO_LOCALSTATEDIR='"var/pseudo"' -DPSEUDO_VERSION='"1.5.1"' -DUSE_MEMORY_DB -DPSEUDO_FORCE_ASYNC -O2 -g -L/buildarea/jhuang0/yp/y_x64_0705/tmp/sysroots/x86_64-nativesdk-pokysdk-linux/opt/poky/1.4+snapshot/sysroots/x86_64-pokysdk-linux/usr/lib -I/buildarea/jhuang0/yp/y_x64_0705/tmp/sysroots/x86_64-nativesdk-pokysdk-linux/opt/poky/1.4+snapshot/sysroots/x86_64-pokysdk-linux/usr/include  -c -o pseudo_tables.o pseudo_tables.c
| In file included from /buildarea/jhuang0/yp/y_x64_0705/tmp/sysroots/x86_64-nativesdk-pokysdk-linux/opt/poky/1.4+snapshot/sysroots/x86_64-pokysdk-linux/usr/include/features.h:388:0,
|                  from /buildarea/jhuang0/yp/y_x64_0705/tmp/sysroots/x86_64-nativesdk-pokysdk-linux/opt/poky/1.4+snapshot/sysroots/x86_64-pokysdk-linux/usr/include/string.h:25,
|                  from pseudo_tables.h:24,
|                  from pseudo_tables.c:23:
| /buildarea/jhuang0/yp/y_x64_0705/tmp/sysroots/x86_64-nativesdk-pokysdk-linux/opt/poky/1.4+snapshot/sysroots/x86_64-pokysdk-linux/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory
|  # include <gnu/stubs-32.h>
|                            ^
| compilation terminated.
| make: *** [pseudo_tables.o] Error 1
| make: *** Waiting for unfinished jobs....
| Checking for old/new clone mechanics...New clone.
| common
| ports/common/wrapfuncs.in: .......
| linux
| ports/linux/wrapfuncs.in: ................................................................
| unix
| ports/unix/wrapfuncs.in: ................................................................
| uids_generic
| ports/uids_generic/wrapfuncs.in: ........................
| linux/newclone
| ports/linux/newclone/wrapfuncs.in: .
| Writing functions... Warning: lchown from linux overriding unix
| done.  Cleaning up.
| ERROR: oe_runmake failed
| WARNING: /buildarea/jhuang0/yp/y_x64_0705/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-pseudo/1.5.1-r3/temp/run.do_compile.12446:1 exit 1 from
|   exit 1
| ERROR: Function failed: do_compile (log file is located at /buildarea/jhuang0/yp/y_x64_0705/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-pseudo/1.5.1-r3/temp/log.do_compile.12446)
NOTE: recipe nativesdk-pseudo-1.5.1-r3: task do_compile: Failed
ERROR: Task 6 (virtual:nativesdk:/buildarea/jhuang0/git/yocto/poky/meta/recipes-devtools/pseudo/pseudo_1.5.1.bb, do_compile) failed with exit code '1'
NOTE: recipe nativesdk-sqlite3-3071700-r0: task do_package: Succeeded
NOTE: Tasks Summary: Attempted 561 tasks of which 183 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  virtual:nativesdk:/buildarea/jhuang0/git/yocto/poky/meta/recipes-devtools/pseudo/pseudo_1.5.1.bb, do_compile
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
Comment 1 Mark Hatle 2013-09-19 16:14:57 UTC
The implementation is expected to add the following to the pseudo recipe:
   NO32LIBS_class-nativesdk = '0'

This should be fine, as the pseudo in the SDK is only designed to be used for the NFS usermode server and extraction of the rootfs if necessary.  It isn't used for compiling or other activities where the user is likely to have multilib host binaries.

There is also no way that I can see to allow this to be '1', as the nativesdk compiler is not multilib enabled...
Comment 2 Jackie Huang 2013-09-22 02:16:43 UTC
(In reply to comment #1)
> The implementation is expected to add the following to the pseudo recipe:
>    NO32LIBS_class-nativesdk = '0'

I think you meant NO32LIBS_class-nativesdk = '1'

> 
> This should be fine, as the pseudo in the SDK is only designed to be used
> for the NFS usermode server and extraction of the rootfs if necessary.  It
> isn't used for compiling or other activities where the user is likely to
> have multilib host binaries.
> 
> There is also no way that I can see to allow this to be '1', as the

And here should be '0'

> nativesdk compiler is not multilib enabled...
Comment 3 Mark Hatle 2014-02-27 15:46:23 UTC
The fix for this issue is to set NO32LIB = "1" when running a nativesdk build.

There is no reason to have both 32 and 64-bit pseudo when running the SDK mode, as the only reason for pseudo is to allow the user-mode NFS server to work, which will be the same byte size as the whole nativesdk.

As Jackie indicated,

NO32LIBS_class-nativesdk = '1'

is the correct fix.  That should be placed either in a regular configuration file or in the pseudo.bb file.