Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(10659)

Issue 5394041: [trunk] RFS: translate built-in include paths for sysroot

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 5 months ago by shenhan
Modified:
12 years, 4 months ago
Reviewers:
joseph
CC:
gcc-patches_gcc.gnu.org
Visibility:
Public.

Description

ChangeLog * Makefile.in (gcc_gxx_include_dir_add_sysroot): New. (PREPROCESSOR_DEFINES): Define GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT. * cppdefault.c (cpp_include_defaults): replace hard coded "1" with GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT for "add_sysroot" field. * configure.ac (AC_SUBST): Add gcc_gxx_include_dir_add_sysroot to control whether sysroot should be prepended to gxx include dir. * configure: Regenerate. Hi, this is a follow up for issue "http://codereview.appspot.com/4641076". The rationale for the patch copied from previous thread: ======================================= The setup: Configuring a toolchain targeting x86-64 GNU Linux (Ubuntu Lucid), as a cross-compiler. Using a sysroot to provide the Lucid headers+libraries, with the sysroot path being within the GCC install tree. Want to use the Lucid system libstdc++ and headers, which means that I'm not building/installing libstdc++-v3. So, configuring with: --with-sysroot="$SYSROOT" --disable-libstdc++-v3 \ --with-gxx-include-dir="$SYSROOT/usr/include/c++/4.4" \ (among other options). Hoping to support two usage models with this configuration, w.r.t. use of the sysroot: (1) somebody installs the sysroot in the normal location relative to the GCC install, and relocates the whole bundle (sysroot+GCC). This works great AFAICT, GCC finds its includes (including the C++ includes) thanks to the add_standard_paths iprefix handling. (2) somebody installs the sysroot in a non-standard location, and uses --sysroot to try to access it. This works fine for the C headers, but doesn't work. For the C headers, add_standard_paths prepends the sysroot location to the /usr/include path (since that's what's specified in cppdefault.c for that path). It doesn't do the same for the C++ include path, though (again, as specified in cppdefault.c). add_standard_paths doesn't attempt to relocate built-in include paths that start with the compiled-in sysroot location (e.g., the g++ include dir, in this case). This isn't surprising really: normally you either prepend the sysroot location or you don't (as specified by cppdefault.c); none of the built-in paths normally *start* with the sysroot location and need to be relocated. However, in this odd-ball case of trying to use the C++ headers from the sysroot, one of the paths *does* need to be relocated in this way. =========================== Chris(cgd@) provided a patch for the issue, but Joseph had a different opinion, my patch here is just coded as suggested. Tested before/after on a x86_64-unknown-linux-gnu system, with --enable-languages=all, RUNTESTFLAGS='--target_board=unix\{-m32,-m64\}'. No changes in test results.

Patch Set 1 #

Patch Set 2 : updated #

Patch Set 3 : updated #

Patch Set 4 : updated #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -3 lines) Patch
M gcc/Makefile.in View 2 chunks +2 lines, -0 lines 0 comments Download
M gcc/configure.ac View 1 2 3 2 chunks +10 lines, -0 lines 0 comments Download
M gcc/cppdefault.c View 1 2 3 1 chunk +6 lines, -3 lines 0 comments Download

Messages

Total messages: 6
shenhan
2011-11-15 Han Shen <shenhan@google.com> * gcc/Makefile.in: * gcc/configure: * gcc/cppdefault.c: diff --git a/gcc/Makefile.in b/gcc/Makefile.in index ...
12 years, 5 months ago (2011-11-16 00:47:10 UTC) #1
shenhan
On 2011/11/16 00:47:10, shenhan wrote: > 2011-11-15 Han Shen <mailto:shenhan@google.com> > > * gcc/Makefile.in: > ...
12 years, 5 months ago (2011-11-16 00:54:09 UTC) #2
joseph_codesourcery.com
On Tue, 15 Nov 2011, Han Shen wrote: > 2011-11-15 Han Shen <shenhan@google.com> > > ...
12 years, 5 months ago (2011-11-18 16:54:35 UTC) #3
shenhan
Hi, Joseph, thanks! ChangeLog entries added to the issue description. ChangeLog * Makefile.in (GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT): add ...
12 years, 5 months ago (2011-11-19 00:10:20 UTC) #4
shenhan
Hi, Joseph, get a chance to take a look? Thanks! -Han On 2011/11/19 00:10:20, shenhan ...
12 years, 5 months ago (2011-11-28 22:48:22 UTC) #5
shenhan
12 years, 4 months ago (2011-12-05 18:12:36 UTC) #6
Ping?
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b