public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/52990] New: bootstrap ia64 cross-compiler gcc (static C-only) includes a broken libgcc.a due to libunwind dependencies
@ 2012-04-14 22:32 vapier at gentoo dot org
  2012-08-24  8:43 ` [Bug target/52990] " thierry.reding@avionic-design.de
  2012-08-24 15:41 ` vapier at gentoo dot org
  0 siblings, 2 replies; 3+ messages in thread
From: vapier at gentoo dot org @ 2012-04-14 22:32 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52990
           Summary: bootstrap ia64 cross-compiler gcc (static C-only)
                    includes a broken libgcc.a due to libunwind
                    dependencies
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vapier@gentoo.org
                CC: toolchain@gentoo.org
            Target: ia64-linux-gnu


when building up a cross-compiler for ia64, we do:
 - install binutils
 - install kernel/C-library headers
 - build a static C-only gcc compiler
 - install glibc
 - try to link a static ELF -> failure

this is due to libgcc on ia64 being dependent on libunwind symbols.  when
shared libs are disabled, the libgcc.a ends up referring to __libunwind_xxx
symbols which aren't provided in the non-shared case.

specifically, we have:
 - ia64 forces t-unwind in config.gcc which adds -DUSE_LIBUNWIND_EXCEPTIONS
 - gcc/unwind-compat.c has a bunch of extern __libunwind_xxx decls
 - libgcc/Makefile.in adds unwind-compat.o to libgcc.a when enable_shared!=yes
 - gcc/config/ia64/unwind-ia64.c defines __libunwind_xxx aliases when SHARED
 - unwind-ia64.o is only added to libunwind.{a,so} and never libgcc.a

so, the end libgcc.a gets unwind-compat.o which refers to __libunwind_xxx, but
doesn't get unwind-ia64.o which could possibly define them, and even if it did,
the aliases aren't enabled for static objects.

looks like we could fix this in the t-glibc-libunwind file, when enable_shared
is disabled, add the ia64 unwind objects to libgcc.a.  additionally, have
unwind-ia64.c key off of not just SHARED but also STATIC_ONLY for declaring the
symbols, and have the t-glibc-unwind file build unwind-ia64.o with that.


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

* [Bug target/52990] bootstrap ia64 cross-compiler gcc (static C-only) includes a broken libgcc.a due to libunwind dependencies
  2012-04-14 22:32 [Bug target/52990] New: bootstrap ia64 cross-compiler gcc (static C-only) includes a broken libgcc.a due to libunwind dependencies vapier at gentoo dot org
@ 2012-08-24  8:43 ` thierry.reding@avionic-design.de
  2012-08-24 15:41 ` vapier at gentoo dot org
  1 sibling, 0 replies; 3+ messages in thread
From: thierry.reding@avionic-design.de @ 2012-08-24  8:43 UTC (permalink / raw)
  To: gcc-bugs

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

Thierry Reding <thierry.reding@avionic-design.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thierry.reding@avionic-desi
                   |                            |gn.de

--- Comment #1 from Thierry Reding <thierry.reding@avionic-design.de> 2012-08-24 08:43:16 UTC ---
I've seen this problem when building glibc as well. It tries to build
a number of utilities and link them against libgcc with the missing
symbols that you mentioned.

In the scripts that I use to build the toolchains, I was able to solve
this by adding a configparms file to the build directory that sets
"build-programs = no".

After the final gcc is built, libunwind is properly installed and can
at least be used for dynamically linked executables. I've also tested
that the resulting gcc can link static executables, though I'm not
able to execute because I lack the hardware.


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

* [Bug target/52990] bootstrap ia64 cross-compiler gcc (static C-only) includes a broken libgcc.a due to libunwind dependencies
  2012-04-14 22:32 [Bug target/52990] New: bootstrap ia64 cross-compiler gcc (static C-only) includes a broken libgcc.a due to libunwind dependencies vapier at gentoo dot org
  2012-08-24  8:43 ` [Bug target/52990] " thierry.reding@avionic-design.de
@ 2012-08-24 15:41 ` vapier at gentoo dot org
  1 sibling, 0 replies; 3+ messages in thread
From: vapier at gentoo dot org @ 2012-08-24 15:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Mike Frysinger <vapier at gentoo dot org> 2012-08-24 15:41:11 UTC ---
(In reply to comment #1)

yes, the "build-programs = no" hack is also what i do.  from my tests in the
past, the cross-compiler produced usable executables.

note, there is an ia64 simulator that you can boot an ia64 kernel + userland in
to do testing (if you really want).

http://ski.sourceforge.net/
http://www.gelato.unsw.edu.au/IA64wiki/SkiSimulator


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

end of thread, other threads:[~2012-08-24 15:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-14 22:32 [Bug target/52990] New: bootstrap ia64 cross-compiler gcc (static C-only) includes a broken libgcc.a due to libunwind dependencies vapier at gentoo dot org
2012-08-24  8:43 ` [Bug target/52990] " thierry.reding@avionic-design.de
2012-08-24 15:41 ` vapier at gentoo 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).