public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* trouble building glibc-2.3.2/gcc-3.4.0/sparc64 with cvs binutils
@ 2004-05-02 23:17 Dan Kegel
  2004-05-02 23:47 ` Alan Modra
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Kegel @ 2004-05-02 23:17 UTC (permalink / raw)
  To: Binutils; +Cc: vanl

Sigh.  I've been trying to build
binutils-2.15.90.0.3 / gcc-3.4.0 / glibc-2.3.2
for all supported architectures (as a cross from i686-linux),
and sparc64 is just giving me headaches.  (To be fair,
m68k and powerpc64 also had trouble, but not quite as much.)

The latest error, which persists even with binutils straight from cvs, is

.../sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/libc.a(dl-reloc.o)(.text+0x4b4):
In function `elf_machine_load_address.3':
: undefined reference to `_DYNAMIC'
collect2: ld returned 1 exit status
make[2]: *** [.../sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/elf/sln] Error 1

That _DYNAMIC symbol is defined in glibc's link.h along with this comment:

/* This symbol refers to the "dynamic structure" in the `.dynamic' section
    of whatever module refers to `_DYNAMIC'.  So, to find its own
    `struct r_debug', a program could do:
      for (dyn = _DYNAMIC; dyn->d_tag != DT_NULL; ++dyn)
        if (dyn->d_tag == DT_DEBUG)
          r_debug = (struct r_debug *) dyn->d_un.d_ptr;
    */
extern ElfW(Dyn) _DYNAMIC[];

So something pretty low-level seems to be amiss.

Here's how to repeat this from scratch, if you like (this
uses binutils-2.15.90.0.3 with the patch mentioned at
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15247#c10,
and gives the same results as cvs binutils; it builds
an entired gcc/glibc toolchain from virgin sources with
minimal patches):

wget http://kegel.com/crosstool/crosstool-0.28-rc11.tar.gz
tar -xzvf crosstool-0.28-rc11.tar.gz
cd crosstool-0.28-rc11
sudo mkdir -p /opt/crosstool
sudo chown $USER /opt/crosstool
sh demo-sparc64.sh

Here's a log showing the exact command that fails, rerun with -v:

+ PATH=/opt/crosstool/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/bin:/opt/bitkeeper:/home/dank/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin
+ export PATH
++ sparc64-unknown-linux-gnu-gcc --print-file-name=crtbegin.o
++ sparc64-unknown-linux-gnu-gcc --print-file-name=crtend.o
+ sparc64-unknown-linux-gnu-gcc -v -nostdlib -nostartfiles -static -o /home/dank/wk/crosstool-0.28-rc10/build/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/elf/sln 
/home/dank/wk/crosstool-0.28-rc10/build/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/csu/crt1.o /home/dank/wk/crosstool-0.28-rc10/build/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/csu/crti.o 
/opt/crosstool/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/lib/gcc/sparc64-unknown-linux-gnu/3.4.0/crtbegin.o /home/dank/wk/crosstool-0.28-rc10/build/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/elf/sln.o 
/home/dank/wk/crosstool-0.28-rc10/build/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/libc.a -lgcc /home/dank/wk/crosstool-0.28-rc10/build/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/libc.a 
/opt/crosstool/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/lib/gcc/sparc64-unknown-linux-gnu/3.4.0/crtend.o /home/dank/wk/crosstool-0.28-rc10/build/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/csu/crtn.o
Reading specs from /opt/crosstool/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/lib/gcc/sparc64-unknown-linux-gnu/3.4.0/specs
Configured with: /home/dank/wk/crosstool-0.28-rc10/build/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/gcc-3.4.0/configure --target=sparc64-unknown-linux-gnu --host=i686-host_pc-linux-gnu 
--prefix=/opt/crosstool/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2 --with-local-prefix=/opt/crosstool/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/sparc64-unknown-linux-gnu --disable-multilib --with-newlib --disable-multilib 
--with-cpu=ultrasparc3 --without-headers --disable-nls --enable-threads=no --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c --disable-shared
Thread model: single
gcc version 3.4.0
  /opt/crosstool/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/libexec/gcc/sparc64-unknown-linux-gnu/3.4.0/collect2 -m elf64_sparc -Y P,/usr/lib64 -static -relax -o 
/home/dank/wk/crosstool-0.28-rc10/build/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/elf/sln -L/opt/crosstool/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/lib/gcc/sparc64-unknown-linux-gnu/3.4.0 
-L/opt/crosstool/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/lib/gcc/sparc64-unknown-linux-gnu/3.4.0/../../../../sparc64-unknown-linux-gnu/lib 
/home/dank/wk/crosstool-0.28-rc10/build/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/csu/crt1.o /home/dank/wk/crosstool-0.28-rc10/build/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/csu/crti.o 
/opt/crosstool/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/lib/gcc/sparc64-unknown-linux-gnu/3.4.0/crtbegin.o /home/dank/wk/crosstool-0.28-rc10/build/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/elf/sln.o 
/home/dank/wk/crosstool-0.28-rc10/build/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/libc.a -lgcc /home/dank/wk/crosstool-0.28-rc10/build/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/libc.a 
/opt/crosstool/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/lib/gcc/sparc64-unknown-linux-gnu/3.4.0/crtend.o /home/dank/wk/crosstool-0.28-rc10/build/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/csu/crtn.o
/home/dank/wk/crosstool-0.28-rc10/build/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/libc.a(dl-reloc.o)(.text+0x4b4): In function `elf_machine_load_address.3':
: undefined reference to `_DYNAMIC'
collect2: ld returned 1 exit status

-- 
My technical stuff: http://kegel.com
My politics: see http://www.misleader.org for examples of why I'm for regime change

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

* Re: trouble building glibc-2.3.2/gcc-3.4.0/sparc64 with cvs binutils
  2004-05-02 23:17 trouble building glibc-2.3.2/gcc-3.4.0/sparc64 with cvs binutils Dan Kegel
@ 2004-05-02 23:47 ` Alan Modra
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2004-05-02 23:47 UTC (permalink / raw)
  To: Dan Kegel; +Cc: Binutils, vanl

On Sun, May 02, 2004 at 04:15:16PM -0700, Dan Kegel wrote:
[snip]
> + sparc64-unknown-linux-gnu-gcc -v -nostdlib -nostartfiles -static -o 
[snip]
> : undefined reference to `_DYNAMIC'

glibc makefile bug, I'd say.  _DYNAMIC won't be defined unless there is
in fact a dynamic section, and you asked gcc to do a static link.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

end of thread, other threads:[~2004-05-02 23:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-02 23:17 trouble building glibc-2.3.2/gcc-3.4.0/sparc64 with cvs binutils Dan Kegel
2004-05-02 23:47 ` Alan Modra

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