Author Topic: collect2: error: ld returned 1 exit status on bash shell installation  (Read 9191 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2145
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
collect2: error: ld returned 1 exit status on bash shell installation
« on: กรกฎาคม 07, 2015, 01:49:42 PM »
##In case , you ever build your bash shell and would like to re-build again , please do "make clean" and then re-configure again.

lfs@Microknoppix:/mnt/lfs/sources/bash-4.3.30$ make

          ***********************************************************
          *                                                         *
          * GNU bash, version 4.3.30(3)-release (x86_64-unknown-linux-gnu)
          *                                                         *
          ***********************************************************

rm -f bash
gcc -L./builtins -L./lib/readline -L./lib/readline -L./lib/glob -L./lib/tilde  -L./lib/sh -L./lib/termcap  -rdynamic  -g -O2 -o bash

shell.o eval.o y.tab.o general.o make_cmd.o print_cmd.o  d
ispose_cmd.o execute_cmd.o variables.o copy_cmd.o error.o expr.o flags.o jobs.o subst.o hashcmd.o hashlib.o mailcheck.o trap.o input.o

unwind_prot.o pathexp.o sig.o test.o version.o alias.o a
rray.o arrayfunc.o assoc.o braces.o bracecomp.o bashhist.o bashline.o  list.o stringlib.o locale.o findcmd.o redir.o pcomplete.o

pcomplib.o syntax.o xmalloc.o  -lbuiltins -lglob -lsh -lreadline -lhistory ./lib/termcap/libtermcap.a -ltilde     -ldl
/mnt/lfs/tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.2/../../../../x86_64-unknown-linux-gnu/bin/ld: i386 architecture of input

file `./lib/sh/libsh.a(shmatch.o)' is incompatible with i386:x86-64 output
/mnt/lfs/tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.2/../../../../x86_64-unknown-linux-gnu/bin/ld: i386 architecture of input

file `./lib/sh/libsh.a(winsize.o)' is incompatible with i386:x86-64 output
/mnt/lfs/tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.2/../../../../x86_64-unknown-linux-gnu/bin/ld: i386 architecture of input

file `./lib/sh/libsh.a(unicode.o)' is incompatible with i386:x86-64 output
/mnt/lfs/tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.2/../../../../x86_64-unknown-linux-gnu/bin/ld: i386 architecture of input

file `./lib/sh/libsh.a(shmbchar.o)' is incompatible with i386:x86-64 output
./lib/sh/libsh.a(shmatch.o): In function `sh_regmatch':
/mnt/lfs/sources/bash-4.3.30/lib/sh/shmatch.c:111: undefined reference to `sh_xfree'
/mnt/lfs/sources/bash-4.3.30/lib/sh/shmatch.c:112: undefined reference to `sh_xfree'
collect2: error: ld returned 1 exit status
make: *** [bash] Error 1

==> Fix by change "make" to "make clean" and reconfigure again.

#./configure --prefix=/tools
#make
#make install