public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/47256] New: "--sysroot" option is not passed to COLLECT_GCC_OPTIONS
@ 2011-01-11  9:12 kevin.tian at intel dot com
  2011-01-20  8:54 ` [Bug c++/47256] " kevin.tian at intel dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: kevin.tian at intel dot com @ 2011-01-11  9:12 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47256

           Summary: "--sysroot" option is not passed to
                    COLLECT_GCC_OPTIONS
           Product: gcc
           Version: 4.5.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: kevin.tian@intel.com


I found that "--sysroot" option is not passed to COLLECT_GCC_OPTIONS:

$ echo '' | mips-poky-linux-g++ -v -E
--sysroot=/home/lulianhao/poky-build/mips/rootfs - 2>&1 | grep -E
'^(COLLECT_GCC_OPTIONS|gcc)'
gcc version 4.5.1 (GCC)
COLLECT_GCC_OPTIONS='-v' '-E' '-shared-libgcc' '-mllsc' '-mno-synci'
'-mno-shared'
COLLECT_GCC_OPTIONS='-v' '-E' '-shared-libgcc' '-mllsc' '-mno-synci'
'-mno-shared'

"-isysroot" does be passed which however is only for headers:

$echo '' | mips-poky-linux-g++ -v -E -isysroot
/home/lulianhao/poky-build/mips/rootfs - 2>&1 | grep -E
'^(COLLECT_GCC_OPTIONS|gcc)'
COLLECT_GCC_OPTIONS='-v' '-E' '-isysroot'
'/home/lulianhao/poky-build/mips/rootfs' '-shared-libgcc' '-mllsc' '-mno-synci'
'-mno-shared'
COLLECT_GCC_OPTIONS='-v' '-E' '-isysroot'
'/home/lulianhao/poky-build/mips/rootfs' '-shared-libgcc' '-mllsc' '-mno-synci'
'-mno-shared'

This brings trouble to our cross-toolchain usage. We generate a cross gcc
compiler, which has a default sysroot configured by "with-sysroot" when
building that cross gcc:
  * Simple usage: When users want to use our cross-toolchain for app
development, they have to extract the sysroot to the default path such as
"/opt/poky/". 
  * flexible usage: we want to relax the position of the sysroot, and thus use
a wrapper script to add a "--sysroot" option to cross gcc which is required to
run before app compilation. This then allows users to install their sysroots
any places.

It generatelly works for all C applications, but then face trouble with C++
projects which use templates and "-frepo". In latter case, collect2 triggers
recompilation to some .cpp files when there's requirement, and then the problem
comes: "--sysroot" is not passed to COLLECT_GCC_OPTIONS, and thus the
recompilation simply fails.

I checked 4.5.1 code, which does't save "--sysroot" to saved switches. Similar
issue may still exists in trunk, of which do_save flag is "false" for
OPTION__sysroot_.

So is there any rationale behind why "--sysroot" is not passed to collect2?


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-11-25 15:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-11  9:12 [Bug c++/47256] New: "--sysroot" option is not passed to COLLECT_GCC_OPTIONS kevin.tian at intel dot com
2011-01-20  8:54 ` [Bug c++/47256] " kevin.tian at intel dot com
2011-03-16  3:15 ` lianhao.lu at intel dot com
2011-10-10 16:32 ` paolo.carlini at oracle dot com
2021-11-25  3:48 ` pinskia at gcc dot gnu.org
2021-11-25 15:25 ` richard.purdie at linuxfoundation dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).