This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [CTNG] canadian x86_64 / ia32 / arm


Frederic, All,

On Friday 11 June 2010 23:38:46 Frederic Roussel wrote:
> First of all, in order to build I had to work around what seems to be
> a libstdc++ bug.
> That bug is [Bug libstdc++/40974]
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40974
[--SNIP--]
> So I applied the proposed workaround and added the following to my config file:
> CT_CC_EXTRA_CONFIG="--disable-libstdcxx-pch"

Care to test the attached patch, that includes this as an option in the
menuconfig, please? (applies on tip in the repos)

> With that flag I could build the final toolchain. I have configured
> CTNG for gcc-4.5.0, the bug was reported against 4.4.1, doesn't seem
> to have been fixed..
> I am no C++ expert, so I don't have the slightest clue what that flag
> could do ...

PCH == Pre-Compiled Headers

With C++, the system headers are huge, and processing them can take quite
a long time. So they get somewhat pre-compiled (pre-processed would be
more accurate) to speed up C++ compilation.

> I then tried the resulting toolchain on a 32bits machine and it failed
> to load as the libstdc++ on that machine was
> /usr/lib/libstdc++.so.6.0.13
> whereas the toolchain was built against /usr/lib/libstdc++.so.6.0.14

This is a separate issue, right?

> The question I have is, the tools are dynamically linked against only
> a few libraries:
> ldd arm-sbasa45-linux-gnueabi-gcc-4.5.0
>         libstdc++.so.6 => /usr/lib32/libstdc++.so.6 (0xf76ab000)
>         libc.so.6 => /lib32/libc.so.6 (0xf7550000)
>         libm.so.6 => /lib32/libm.so.6 (0xf7529000)
>         /lib/ld-linux.so.2 (0xf77cf000)
>         libgcc_s.so.1 => /usr/lib32/libgcc_s.so.1 (0xf750c000)
> How could I statically link against libstdc++, libm, libgcc_s ?

There is currently no provision for this in crosstool-NG. Static linking
is a recurrent inquiry, but I have not yet had time to bang on it...

That shall not be very complex, but may require some preparatory work in
the code before we can do it (I'm thinking about libstdc++ linking, in
fact, that can be required by different code-paths, and we're currently
only managing one such requirement: static companion libs).

> I guess that dynamic linking against glibc should be ok.

Hopefully so.

> I really do need the static linking in order to run inside of
> scratchbox, which is using fairly old libraries.

Then I'm all eyes to look at your patches! :-P

> As for the earlier comment from Yann that, as I have the ia32-libs
> installed on my sytem, configure, for glibc and binutils, might get
> confused. I suppose I should I should recompile with older versions of
> the libraries and compiler, but older gcc have way less dependency on
> C++. Any guidance on a useful test I could produce ?

To be sure that ia32-libs are the culprit in your case, could you build
in a chroot that does not have them? (with Debian or its derivatives, I'd
do a debootstrap and chroot into that.)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
diff --git a/config/cc/gcc.in b/config/cc/gcc.in
--- a/config/cc/gcc.in
+++ b/config/cc/gcc.in
@@ -268,6 +268,15 @@
 
       This will compile crossgcc's libs with -Os.
 
+config CC_GCC_DISABLE_PCH
+    bool
+    prompt "Do not build PCH"
+    default n
+    help
+      Say 'y' here to not use Pre-Compiled Headers in the resulting toolchain.
+      
+      Please see: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40974
+
 config CC_PKGVERSION
     string
     prompt "gcc ID string"
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh
--- a/scripts/build/cc/gcc.sh
+++ b/scripts/build/cc/gcc.sh
@@ -367,6 +367,9 @@
     if [ "${CT_CC_GCC_ENABLE_TARGET_OPTSPACE}" = "y" ]; then
         extra_config+=("--enable-target-optspace")
     fi
+    if [ "${CT_CC_GCC_DISABLE_PCH}" = "y" ]; then
+        extra_config+=("--disable-libstdcxx-pch")
+    fi
 
     CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'"
 

--
For unsubscribe information see http://sourceware.org/lists.html#faq

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]