Bug 10354 - gcc-runtime_5.3: misplaced include files
Summary: gcc-runtime_5.3: misplaced include files
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 2.1.2
Hardware: x86 x86_64
: Medium+ normal
Target Milestone: 2.2 M4
Assignee: Juro Bystricky
QA Contact:
URL:
Whiteboard:
Depends on: 10380
Blocks:
  Show dependency tree
 
Reported: 2016-09-30 17:46 UTC by Michel D'HOOGE
Modified: 2016-10-10 16:24 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michel D'HOOGE 2016-09-30 17:46:08 UTC
I bitbaked the meta-toolchain with the following local.conf:

MACHINE = "genericx86-64"
DEFAULTTUNE = "x86-64-x32"
baselib = "${@d.getVar('BASE_LIB_tune-' + (d.getVar('DEFAULTTUNE', True) or 'INVALID'), True) or 'lib'}"
DISTRO = "poky"
PACKAGE_CLASSES = "package_rpm"

The following include files are placed into folder /sysroots/x86_64_x32-poky-linux-gnux32/usr/include/c++/5.3.0/x86_64-poky-linux-gnux32 and they cannot be found by the g++ compiler.

bits:
atomic_word.h   c++config.h  cpu_defines.h   cxxabi_tweaks.h    gthr-default.h  gthr-single.h       os_defines.h  time_members.h
basic_file.h    c++io.h      ctype_base.h    error_constants.h  gthr.h          messages_members.h  stdc++.h
c++allocator.h  c++locale.h  ctype_inline.h  extc++.h           gthr-posix.h    opt_random.h        stdtr1c++.h

ext:
opt_random.h

If I merge the x86_64-poky-linux-gnux32/bits & x86_64-poky-linux-gnux32/ext folders with their matching siblings one level above, everything is fine.

The following simple main.cpp, with a single include and no body, is enough to test:
#include <bits/c++config.h>
Comment 1 Michel D'HOOGE 2016-09-30 19:50:02 UTC
To be sure, I compared with a plain genericx86-64 meta-toolchain (i.e. without DEFAULTTUNE set to x86-64-x32).

The headers are also in a subfolder (x86_64-poky-linux), but they are correctly found by the g++ compiler.

HTH
Comment 2 Juro Bystricky 2016-10-04 20:45:58 UTC
Yes, CPP is looking for the include files in a folder which does not exist.
This can/should be fixed by a symlink in location:

<sdkinstall>/sysroots/x86_64_x32-poky-linux-gnux32/usr/include/c++/6.2.0

which should contain a symlink named "x86_64-poky-linux" with the target
"x86_64-poky-linux-gnux32" 

Because CPP looks for the include files in:
<sdkinstall>/sysroots/x86_64_x32-poky-linux-gnux32/usr/include/c++/6.2.0/x86_64-poky-linux

however the files are located in the folder 

<sdkinstall>/sysroots/x86_64_x32-poky-linux-gnux32/usr/include/c++/6.2.0/x86_64-poky-linux-gnunx32
Comment 3 Juro Bystricky 2016-10-10 16:24:26 UTC
Patch fixing the problem merged with master:
https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=8209a01242b3ea265c69049879e9ade951bf9602