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

* [Bug c++/47256] "--sysroot" option is not passed to COLLECT_GCC_OPTIONS
  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 ` kevin.tian at intel dot com
  2011-03-16  3:15 ` lianhao.lu at intel dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: kevin.tian at intel dot com @ 2011-01-20  8:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Kevin Tian <kevin.tian at intel dot com> 2011-01-20 05:28:17 UTC ---
hi, anyone got a chance to take a look?


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

* [Bug c++/47256] "--sysroot" option is not passed to COLLECT_GCC_OPTIONS
  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
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: lianhao.lu at intel dot com @ 2011-03-16  3:15 UTC (permalink / raw)
  To: gcc-bugs

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

lianhao.lu at intel dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lianhao.lu at intel dot com

--- Comment #2 from lianhao.lu at intel dot com 2011-03-16 03:11:48 UTC ---
There is a patch for this in YoctoProject.

http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-devtools/gcc/gcc-4.5.1/COLLECT_GCC_OPTIONS.patch?h=bernard&id=6bb3da22363ced7da04f2b0e70f18b0d9736ff13


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

* [Bug c++/47256] "--sysroot" option is not passed to COLLECT_GCC_OPTIONS
  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
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-10-10 16:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-10-10 16:31:45 UTC ---
Patches go to gcc-patches...


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

* [Bug c++/47256] "--sysroot" option is not passed to COLLECT_GCC_OPTIONS
  2011-01-11  9:12 [Bug c++/47256] New: "--sysroot" option is not passed to COLLECT_GCC_OPTIONS kevin.tian at intel dot com
                   ` (2 preceding siblings ...)
  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
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-25  3:48 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.0

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So I looked into this (since the patch is still in yocto as of today) but the
patch is no longer needed as -frepo support was removed in GCC 10 so keeping
this closed as won't fix.

I suspect yocto can remove this patch also because of that reason too.

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

* [Bug c++/47256] "--sysroot" option is not passed to COLLECT_GCC_OPTIONS
  2011-01-11  9:12 [Bug c++/47256] New: "--sysroot" option is not passed to COLLECT_GCC_OPTIONS kevin.tian at intel dot com
                   ` (3 preceding siblings ...)
  2021-11-25  3:48 ` pinskia at gcc dot gnu.org
@ 2021-11-25 15:25 ` richard.purdie at linuxfoundation dot org
  4 siblings, 0 replies; 6+ messages in thread
From: richard.purdie at linuxfoundation dot org @ 2021-11-25 15:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Richard Purdie <richard.purdie at linuxfoundation dot org> ---
Thanks for the tip, we'll look into dropping it!

^ 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).