<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>171486</bug_id>
          
          <creation_ts>2007-03-19 21:41 0000</creation_ts>
          <short_desc>binutils symlinks ldscripts incorrectly</short_desc>
          <delta_ts>2007-05-07 11:50:26 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Development</component>
          <version>2006.1</version>
          <rep_platform>MIPS</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>alanh@fairlite.co.uk</reporter>
          <assigned_to>toolchain@gentoo.org</assigned_to>
          <cc>loki_val@gentoo.org</cc>
    
    <cc>mips@gentoo.org</cc>
    
    <cc>neysx@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>alanh@fairlite.co.uk</who>
            <bug_when>2007-03-19 21:41:22 0000</bug_when>
            <thetext>when following the gentoo build instructions on mips (Octane) I get this...

ld: cannot open linker script file ldscripts/elf64btsmip.xr: No such file or directory.

I can see this file in /usr/lib/binutils/mips-unknown-linux-gnu/2.16.1/ldscripts/ but I can&apos;t find any mention of a mips64 variant of binutils, even though I&apos;ve emerged kgcc64 too.

Reproducible: Always</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>loki_val@gentoo.org</who>
            <bug_when>2007-03-19 21:47:57 0000</bug_when>
            <thetext>Please post emerge --info
Also, see: http://www.mail-archive.com/gentoo-mips%40lists.gentoo.org/msg00270.html
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>alanh@fairlite.co.uk</who>
            <bug_when>2007-03-19 21:54:33 0000</bug_when>
            <thetext>Portage 2.1.2.2 (default-linux/mips/2006.1/ip30/o32, gcc-4.1.1, glibc-2.3.6-r4, 2.6.14.4-mipsgit-20051030-ip30r10k+ mips64)
=================================================================
System uname: 2.6.14.4-mipsgit-20051030-ip30r10k+ mips64 R12000 V2.3  FPU V0.0
Gentoo Base System release 1.12.6
Timestamp of tree: Mon, 19 Mar 2007 02:20:01 +0000
dev-lang/python:     2.3.5-r2, 2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.14.4
ACCEPT_KEYWORDS=&quot;mips&quot;
AUTOCLEAN=&quot;yes&quot;
CBUILD=&quot;mips-unknown-linux-gnu&quot;
CFLAGS=&quot;-O2 -mips4 -mcpu=r12000 -mabi=32&quot;
CHOST=&quot;mips-unknown-linux-gnu&quot;
CONFIG_PROTECT=&quot;/etc&quot;
CONFIG_PROTECT_MASK=&quot;/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo&quot;
CXXFLAGS=&quot;-O2 -mips4 -mcpu=r12000 -mabi=32&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;autoconfig ccache distlocks metadata-transfer sfperms strict&quot;
GENTOO_MIRRORS=&quot;http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_RSYNC_OPTS=&quot;--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
SYNC=&quot;rsync://rsync.gentoo.org/gentoo-portage&quot;
USE=&quot;berkdb bitmap-fonts cli cracklib fortran gdbm gpm iconv ip30 isdnlog libwww midi mips nls pam pcre perl pppd python readline reflection sdl session spl ssl tcpd truetype-fonts type1-fonts xorg&quot; ALSA_PCM_PLUGINS=&quot;adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol&quot; ELIBC=&quot;glibc&quot; INPUT_DEVICES=&quot;keyboard mouse evdev&quot; KERNEL=&quot;linux&quot; LCD_DEVICES=&quot;bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text&quot; USERLAND=&quot;GNU&quot; VIDEO_CARDS=&quot;dummy fbdev impact newport v4l&quot;
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTAGE_COM
PRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>alanh@fairlite.co.uk</who>
            <bug_when>2007-03-19 22:00:18 0000</bug_when>
            <thetext>Doing the symlink is the mail-archive article gets past the build problem, so I&apos;ll report back on building my 2.6.17.10 kernel and see if it boots next.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>loki_val@gentoo.org</who>
            <bug_when>2007-03-19 22:06:30 0000</bug_when>
            <thetext>(In reply to comment #3)
&gt; Doing the symlink is the mail-archive article gets past the build problem, so
&gt; I&apos;ll report back on building my 2.6.17.10 kernel and see if it boots next.
&gt; 

Also see:
http://forums.gentoo.org/viewtopic-t-523419.html
^I think that&apos;s where that bloke got the idea for the symlink. Not much info out there. Perhaps the #gentoo-mips guys on IRC have experience with this?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>alanh@fairlite.co.uk</who>
            <bug_when>2007-03-19 23:50:20 0000</bug_when>
            <thetext>Yes, now I have a working kernel.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>neysx@gentoo.org</who>
            <bug_when>2007-03-25 20:46:36 0000</bug_when>
            <thetext>I have the same problem with mips-sources-2.6.17.10 on my O2, mips-2.6.16 does compile.

# emerge --info
Portage 2.1.2.2 (default-linux/mips/2006.1/generic-be/o32/nptl, gcc-4.1.2, glibc-2.5-r1, 2.6.16.4-mipsgit-20060320-ip32r5k mips64)
=================================================================
System uname: 2.6.16.4-mipsgit-20060320-ip32r5k mips64 R5000 V2.1  FPU V1.0
Gentoo Base System release 1.12.9
Timestamp of tree: Thu, 22 Mar 2007 05:50:01 +0000
dev-lang/python:     2.4.4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.15-r1
sys-devel/libtool:   1.5.23b
virtual/os-headers:  2.6.16.16
ACCEPT_KEYWORDS=&quot;mips ~mips&quot;
AUTOCLEAN=&quot;yes&quot;
CBUILD=&quot;mips-unknown-linux-gnu&quot;
CFLAGS=&quot;-O2 -pipe -march=r5000 -fomit-frame-pointer -mabi=32&quot;
CHOST=&quot;mips-unknown-linux-gnu&quot;
CONFIG_PROTECT=&quot;/etc&quot;
CONFIG_PROTECT_MASK=&quot;/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo&quot;
CXXFLAGS=&quot;-O2 -pipe -march=r5000 -fomit-frame-pointer -mabi=32&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;autoconfig ccache distlocks metadata-transfer parallel-fetch sfperms strict&quot;
GENTOO_MIRRORS=&quot;ftp://polly.a.la.maison/gentoo http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo&quot;
MAKEOPTS=&quot;-j1&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_RSYNC_OPTS=&quot;--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
PORTDIR_OVERLAY=&quot;/usr/local/portage&quot;
SYNC=&quot;rsync://polly.a.la.maison/portage&quot;
USE=&quot;apache2 berkdb bitmap-fonts cli cracklib fortran gdbm gpm iconv isdnlog libwww mailwrapper midi mips nls no-htdocs nptl nptlonly pcre perl pppd python readline reflection sdl session spl ssl truetype-fonts type1-fonts xorg&quot; ALSA_PCM_PLUGINS=&quot;adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol&quot; ELIBC=&quot;glibc&quot; INPUT_DEVICES=&quot;keyboard mouse evdev&quot; KERNEL=&quot;linux&quot; LCD_DEVICES=&quot;bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text&quot; USERLAND=&quot;GNU&quot; VIDEO_CARDS=&quot;dummy fbdev impact newport v4l&quot;
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


# emerge -vp gcc kgcc64 binutils                                                                                        
[ebuild   R   ] sys-devel/gcc-4.1.2  USE=&quot;nls (-altivec) -bootstrap -build -d% -doc -fortran -gcj -gtk (-hardened) -ip28 -ip32r10k -mudflap (-multilib) -multislot (-n32) (-n64) -nocxx -objc -objc++ -objc-gc -test -vanilla&quot;
[ebuild   R   ] sys-devel/kgcc64-4.1.1  USE=&quot;-multislot -test&quot;
[ebuild   R   ] sys-devel/binutils-2.17  USE=&quot;multitarget nls -multislot -test -vanilla&quot;

# mips64-unknown-linux-gnu-ld -v                                                              
GNU ld version 2.17

# mips64-unknown-linux-gnu-gcc -v                                                             
Using built-in specs.
Target: mips64-unknown-linux-gnu
Configured with: /var/tmp/portage/sys-devel/kgcc64-4.1.1/work/gcc-4.1.1/configure --prefix=/usr --bindir=/usr/mips-unknown-linux-gnu/mips64-unknown-linux-gnu/gcc-bin/4.1.1 --includedir=/usr/lib/gcc/mips64-unknown-linux-gnu/4.1.1/include --datadir=/usr/share/gcc-data/mips64-unknown-linux-gnu/4.1.1 --mandir=/usr/share/gcc-data/mips64-unknown-linux-gnu/4.1.1/man --infodir=/usr/share/gcc-data/mips64-unknown-linux-gnu/4.1.1/info --with-gxx-include-dir=/usr/lib/gcc/mips64-unknown-linux-gnu/4.1.1/include/g++-v4 --host=mips-unknown-linux-gnu --target=mips64-unknown-linux-gnu --build=mips-unknown-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-libunwind-exceptions --disable-multilib --disable-libmudflap --disable-libssp --disable-libgcj --enable-languages=c --disable-shared --disable-threads --without-headers --enable-__cxa_atexit --enable-clocale=gnu
Thread model: single
gcc version 4.1.1 (Gentoo 4.1.1)

Kernel compile of linux-2.6.16.4-20060320 completes:
# make vmlinux.32 CROSS_COMPILE=mips64-unknown-linux-gnu-
....
  AR      arch/mips/lib-64/lib.a
  GEN     .version
  CHK     include/linux/compile.h
  UPD     include/linux/compile.h
  CC      init/version.o
  LD      init/built-in.o
  LD      vmlinux
  SYSMAP  System.map
mips64-unknown-linux-gnu-objcopy -O elf32-tradbigmips  --remove-section=.reginfo vmlinux vmlinux.32


Kernel compile of linux-2.6.17.10-20060618 fails:
# make vmlinux.32 CROSS_COMPILE=mips64-unknown-linux-gnu-
  CHK     include/linux/version.h
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/split-include
  HOSTCC  scripts/basic/docproc
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/mconf.o
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf -s arch/mips/Kconfig
#
# using defaults found in .config
#
  SPLIT   include/linux/autoconf.h -&gt; include/config/*
  CC      arch/mips/kernel/asm-offsets.s
  GEN     include/asm-mips/asm-offsets.h
  HOSTCC  scripts/pnmtologo
  HOSTCC  scripts/conmakehash
  CC      init/main.o
  CHK     include/linux/compile.h
  UPD     include/linux/compile.h
  CC      init/version.o
  CC      init/do_mounts.o
  LD      init/mounts.o
mips64-unknown-linux-gnu-ld: cannot open linker script file ldscripts/elf64btsmip.xr: No such file or directory
make[1]: *** [init/mounts.o] Error 1
make: *** [init] Error 2

Symlinking to the ldscripts dir as suggested solved it for me.
linux # ln -s /usr/lib/binutils/mips-unknown-linux-gnu/2.17/ldscripts</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>neysx@gentoo.org</who>
            <bug_when>2007-03-25 22:28:21 0000</bug_when>
            <thetext>Looks like I spoke too fast. 2.6.17 failed:
...
  AS      arch/mips/lib-64/watch.o
  AR      arch/mips/lib-64/lib.a
  GEN     .version
  CHK     include/linux/compile.h
  UPD     include/linux/compile.h
  CC      init/version.o
  LD      init/built-in.o
  LD      vmlinux
lib/lib.a: could not read symbols: Archive has no index; run ranlib to add one
make: *** [vmlinux] Error 1
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kumba@gentoo.org</who>
            <bug_when>2007-05-05 22:57:48 0000</bug_when>
            <thetext>[18:55] &lt;hardave&gt; `K-[AFK]: bug #171486
[18:55] &lt;jeeves&gt; hardave: https://bugs.gentoo.org/171486 nor, P2, MIPS, alanh@fairlite.demon.co.uk-&gt;mips@gentoo.org, NEW, pending, mips-sources fails to find ldscripts/elf64btsmip.xr

[18:56] &lt;hardave&gt; `K-[AFK]: It&apos;s due to ldscripts being symlinked into /usr/$HOST/bin instead of /usr/$HOST/lib</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2007-05-06 09:04:45 0000</bug_when>
            <thetext>looks like i broke that by accident when doing the bin/lib cleanup with /usr/$CTARGET/ -&gt; /usr/$CHOST/$CTARGET/

the places you want the symlink are:
[native] /usr/$CHOST/lib/ldscripts
[cross]  /usr/$CHOST/$CTARGET/lib/ldscripts

committed with binutils-config-1.9-r4</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>alanh@fairlite.co.uk</who>
            <bug_when>2007-05-07 11:46:24 0000</bug_when>
            <thetext>still happens here with binutils-config-1.9-r4</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>alanh@fairlite.co.uk</who>
            <bug_when>2007-05-07 11:50:26 0000</bug_when>
            <thetext>actually, i&apos;d of expected binutils-config to re-run the current selected binutils to force the symlinks to get regenerated.

That&apos;s not the case and you have to re-run binutils-config yourself - manually.

Closing as fixed again.</thetext>
          </long_desc>
      
    </bug>

</bugzilla>