我从以下网址下载了 bash (5.1) 源代码:https://ftp.gnu.org/gnu/bash/
# Both in cygwin and wsl1
./configure && make
运行成功。
当我尝试安装时
# Ran fine on wsl1
make install
我在 cygwin 上收到以下消息:
gcc -shared -Wl,--enable-auto-import -Wl,--enable-auto-image-base -Wl,--export-all -Wl,--out-implib=
print.a -L./lib/termcap -o print print.o
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: print.o: in function `print_bu
iltin':
/c/Users/philippe/sandbox/bash-5.1/examples/loadables/print.c:87: undefined reference to `reset_i
nternal_getopt'
/c/Users/philippe/sandbox/bash-5.1/examples/loadables/print.c:87:(.text+0x28): relocation truncat
ed to fit: R_X86_64_PC32 against undefined symbol `reset_internal_getopt'
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: /c/Users/philippe/sandbox/b
ash-5.1/examples/loadables/print.c:88: undefined reference to `internal_getopt'
/c/Users/philippe/sandbox/bash-5.1/examples/loadables/print.c:88:(.text+0x37): relocation truncat
ed to fit: R_X86_64_PC32 against undefined symbol `internal_getopt'
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: /c/Users/philippe/sandbox/b
ash-5.1/examples/loadables/print.c:127: undefined reference to `builtin_usage'
/c/Users/philippe/sandbox/bash-5.1/examples/loadables/print.c:127:(.text+0x61): relocation trunca
ted to fit: R_X86_64_PC32 against undefined symbol `builtin_usage'
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: /c/Users/philippe/sandbox/b
ash-5.1/examples/loadables/print.c:113: undefined reference to `all_digits'
/c/Users/philippe/sandbox/bash-5.1/examples/loadables/print.c:113:(.text+0x8b): relocation trunca
ted to fit: R_X86_64_PC32 against undefined symbol `all_digits'
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: /c/Users/philippe/sandbox/b
ash-5.1/examples/loadables/print.c:113: undefined reference to `legal_number'
/c/Users/philippe/sandbox/bash-5.1/examples/loadables/print.c:113:(.text+0xa7): relocation trunca
ted to fit: R_X86_64_PC32 against undefined symbol `legal_number'
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: print.o: in function `printarg
s':
/c/Users/philippe/sandbox/bash-5.1/examples/loadables/print.c:183: undefined reference to `ansics
tr'
/c/Users/philippe/sandbox/bash-5.1/examples/loadables/print.c:183:(.text+0x19a): relocation trunc
ated to fit: R_X86_64_PC32 against undefined symbol `ansicstr'
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: print.o: in function `print_bu
iltin':
/c/Users/philippe/sandbox/bash-5.1/examples/loadables/print.c:125: undefined reference to `builti
n_help'
/c/Users/philippe/sandbox/bash-5.1/examples/loadables/print.c:125:(.text+0x259): relocation trunc
ated to fit: R_X86_64_PC32 against undefined symbol `builtin_help'
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: /c/Users/philippe/sandbox/b
ash-5.1/examples/loadables/print.c:142: undefined reference to `make_word'
/c/Users/philippe/sandbox/bash-5.1/examples/loadables/print.c:142:(.text+0x2bc): relocation trunc
ated to fit: R_X86_64_PC32 against undefined symbol `make_word'
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: /c/Users/philippe/sandbox/b
ash-5.1/examples/loadables/print.c:143: undefined reference to `make_word_list'
/c/Users/philippe/sandbox/bash-5.1/examples/loadables/print.c:143:(.text+0x2c7): relocation trunc
ated to fit: R_X86_64_PC32 against undefined symbol `make_word_list'
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: /c/Users/philippe/sandbox/b
ash-5.1/examples/loadables/print.c:144: undefined reference to `printf_builtin'
/c/Users/philippe/sandbox/bash-5.1/examples/loadables/print.c:144:(.text+0x2d2): relocation trunc
ated to fit: R_X86_64_PC32 against undefined symbol `printf_builtin'
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: /c/Users/philippe/sandbox/b
ash-5.1/examples/loadables/print.c:146: undefined reference to `dispose_words'
/c/Users/philippe/sandbox/bash-5.1/examples/loadables/print.c:146:(.text+0x2e5): additional reloc
ation overflows omitted from the output
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: print.o:print.c:(.rdata$.refpt
r.list_optarg[.refptr.list_optarg]+0x0): undefined reference to `list_optarg'
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: print.o:print.c:(.rdata$.refpt
r.loptend[.refptr.loptend]+0x0): undefined reference to `loptend'
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: print.o:print.c:(.rdata$.refpt
r.lcurrent[.refptr.lcurrent]+0x0): undefined reference to `lcurrent'
collect2: error: ld returned 1 exit status
make: *** [Makefile:126: print] Error 1