Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 171486 - binutils symlinks ldscripts incorrectly
Summary: binutils symlinks ldscripts incorrectly
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: MIPS Linux
: High critical (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-19 21:41 UTC by Alan Hourihane
Modified: 2012-01-05 00:04 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Hourihane 2007-03-19 21:41:22 UTC
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't find any mention of a mips64 variant of binutils, even though I've emerged kgcc64 too.

Reproducible: Always
Comment 1 Peter Alfredsen (RETIRED) gentoo-dev 2007-03-19 21:47:57 UTC
Please post emerge --info
Also, see: http://www.mail-archive.com/gentoo-mips%40lists.gentoo.org/msg00270.html
Comment 2 Alan Hourihane 2007-03-19 21:54:33 UTC
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="mips"
AUTOCLEAN="yes"
CBUILD="mips-unknown-linux-gnu"
CFLAGS="-O2 -mips4 -mcpu=r12000 -mabi=32"
CHOST="mips-unknown-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -mips4 -mcpu=r12000 -mabi=32"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks metadata-transfer sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--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-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="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" ALSA_PCM_PLUGINS="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" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="dummy fbdev impact newport v4l"
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
Comment 3 Alan Hourihane 2007-03-19 22:00:18 UTC
Doing the symlink is the mail-archive article gets past the build problem, so I'll report back on building my 2.6.17.10 kernel and see if it boots next.
Comment 4 Peter Alfredsen (RETIRED) gentoo-dev 2007-03-19 22:06:30 UTC
(In reply to comment #3)
> Doing the symlink is the mail-archive article gets past the build problem, so
> I'll report back on building my 2.6.17.10 kernel and see if it boots next.
> 

Also see:
http://forums.gentoo.org/viewtopic-t-523419.html
^I think that'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?
Comment 5 Alan Hourihane 2007-03-19 23:50:20 UTC
Yes, now I have a working kernel.
Comment 6 Xavier Neys (RETIRED) gentoo-dev 2007-03-25 20:46:36 UTC
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="mips ~mips"
AUTOCLEAN="yes"
CBUILD="mips-unknown-linux-gnu"
CFLAGS="-O2 -pipe -march=r5000 -fomit-frame-pointer -mabi=32"
CHOST="mips-unknown-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=r5000 -fomit-frame-pointer -mabi=32"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks metadata-transfer parallel-fetch sfperms strict"
GENTOO_MIRRORS="ftp://polly.a.la.maison/gentoo http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--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-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://polly.a.la.maison/portage"
USE="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" ALSA_PCM_PLUGINS="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" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="dummy fbdev impact newport v4l"
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="nls (-altivec) -bootstrap -build -d% -doc -fortran -gcj -gtk (-hardened) -ip28 -ip32r10k -mudflap (-multilib) -multislot (-n32) (-n64) -nocxx -objc -objc++ -objc-gc -test -vanilla"
[ebuild   R   ] sys-devel/kgcc64-4.1.1  USE="-multislot -test"
[ebuild   R   ] sys-devel/binutils-2.17  USE="multitarget nls -multislot -test -vanilla"

# 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 -> 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
Comment 7 Xavier Neys (RETIRED) gentoo-dev 2007-03-25 22:28:21 UTC
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
Comment 8 Joshua Kinard gentoo-dev 2007-05-05 22:57:48 UTC
[18:55] <hardave> `K-[AFK]: bug #171486
[18:55] <jeeves> hardave: https://bugs.gentoo.org/171486 nor, P2, MIPS, alanh@fairlite.demon.co.uk->mips@gentoo.org, NEW, pending, mips-sources fails to find ldscripts/elf64btsmip.xr

[18:56] <hardave> `K-[AFK]: It's due to ldscripts being symlinked into /usr/$HOST/bin instead of /usr/$HOST/lib
Comment 9 SpanKY gentoo-dev 2007-05-06 09:04:45 UTC
looks like i broke that by accident when doing the bin/lib cleanup with /usr/$CTARGET/ -> /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
Comment 10 Alan Hourihane 2007-05-07 11:46:24 UTC
still happens here with binutils-config-1.9-r4
Comment 11 Alan Hourihane 2007-05-07 11:50:26 UTC
actually, i'd of expected binutils-config to re-run the current selected binutils to force the symlinks to get regenerated.

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

Closing as fixed again.
Comment 12 Jess Haas 2012-01-04 23:07:53 UTC
This bug is still there when compiling an avr toochain with crossdev. When compiling it does not find ldscripts in /usr/$CHOST/$CTARGET/lib/ldscripts and binutils-config deletes it from /usr/$CTARGET/lib. Creating a link from /usr/$CHOST/$CTARGET/lib/ldscripts -> /usr/$CTARGET/lib makes everything work correctly but reruning binutils-config deletes it.